Advertisement
skaram

stresser.cpp

Apr 19th, 2024 (edited)
528
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. signed main() {
  6.         system("g++-13 ../solve.cpp -o solve -O2");
  7.         system("g++-13 ../stress-testing/unsolve.cpp -o unsolve -O2");
  8.         system("g++-13 ../stress-testing/generator.cpp -o gen -O2");
  9.         for (int test = 1;; ++test) {
  10.                 cout << "#" << test << " ";
  11.                 system("./gen > input.txt");
  12.                 system("./solve < input.txt > solve.txt");
  13.                 system("./unsolve < input.txt > unsolve.txt");
  14.                 if (system("diff solve.txt unsolve.txt")) {
  15.                         cout << "WA" << endl;
  16.                         break;
  17.                 }
  18.                 cout << "OK" << endl;
  19.         }
  20.        
  21.         return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement