Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- mt19937 rnd(123);
- int gen() {
- return rnd() % 100;
- }
- int smart(int n) {
- if (n % 12 == 0) {
- return 3; // uhh... stupid mistake!
- }
- return n * n;
- }
- int stupid(int n) {
- return n * n;
- }
- int check(int n, int smartans, int stupidans) {
- return smartans == stupidans;
- }
- int main() {
- for (int test = 0;; test++) {
- if (test % 1000000 == 0) {
- cout << "Running test # " << test << endl;
- }
- int n = gen();
- int smartans = smart(n);
- int stupidans = stupid(n);
- if (!check(n, smartans, stupidans)) { // here we may not use any checker
- cout << "Test found!" << endl << "n = " << n << ", smartans = " << smartans << ", stupidans = " << stupidans << endl;
- break;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement