fork download
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. #include <chrono>
  5. #include <random>
  6. #include <ctime>
  7. #include <cstdlib>
  8. using namespace std;
  9.  
  10. #define ll long long
  11. const string NAME1 = "sol";
  12. const string NAME2 = "sol_alt";
  13. const ll MAXab = 1000000000;
  14. const int T = 200;
  15. int n, S, temp;
  16.  
  17. ll rg(ll l, ll r) {
  18. mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
  19. return uniform_int_distribution<ll>(l, r)(rng);
  20. }
  21.  
  22. int main() {
  23. for (int i = 1; i <= T; ++i) {
  24. ofstream inp("g_test.inp");
  25. ll a = rg(100000000, MAXab);
  26. ll b = rg(100000000, MAXab);
  27. inp << a << " " << b;
  28. inp.close();
  29. system(("./" + NAME1).c_str());
  30. system(("./" + NAME2).c_str());
  31.  
  32. if (system(("colordiff " + NAME1 + ".out " + NAME2 + ".out").c_str()) != 0) {
  33. cout << "Test " << i << ": WA!\n";
  34. return 0;
  35. }
  36. cout << "Test " << i << ": AC!\n";
  37. }
  38. return 0;
  39. }
  40.  
Success #stdin #stdout #stderr 0.01s 5292KB
stdin
Standard input is empty
stdout
Test 1: WA!
stderr
sh: 1: ./sol: not found
sh: 1: ./sol_alt: not found
sh: 1: colordiff: not found