fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. using namespace std::chrono;
  4. // Tên chương trình
  5. const string NAME = "tem";
  6. const string MAIN = "main.exe";
  7. const string TEST = "test.exe";
  8. // Số test kiểm tra
  9. const int NTEST = 10;
  10.  
  11. mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
  12.  
  13. long long Rand(long long l, long long h) {
  14. return uniform_int_distribution<long long>(l, h)(rng);
  15. }
  16. typedef long long ll;
  17. int main()
  18. {
  19. srand(time(NULL));
  20. for (int iTest = 1; iTest <= 20000; iTest++)
  21. {
  22. ofstream inp((NAME + ".inp").c_str());
  23.  
  24. // Write your input here
  25.  
  26. inp.close();
  27. // Nếu dùng Linux thì "./" + Tên chương trình
  28. //
  29. system((MAIN).c_str());
  30. system((TEST).c_str());
  31. //system((TEST).c_str());
  32. // Nếu dùng linux thì thay fc bằng diff
  33. if (system(("fc " + NAME + ".out " + NAME + ".ans").c_str()) != 0)
  34. {
  35. cout << "Test " << iTest << ": WRONG!\n";
  36. return 0;
  37. }
  38.  
  39. cout << "Test " << iTest << ": " << "ACCEPTED" << "\n";
  40. }
  41. return 0;
  42. }
  43.  
Success #stdin #stdout #stderr 0.01s 5300KB
stdin
Standard input is empty
stdout
Test 1: WRONG!
stderr
sh: 1: main.exe: not found
sh: 1: test.exe: not found
sh: 1: fc: not found