fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define int long long
  4. #define all(ac) ac.begin(),ac.end()
  5. #define task "tet"
  6. mt19937_64 rd(chrono::steady_clock::now().time_since_epoch().count());
  7. int rand(int l, int r) {return l+rd()%(r-l+1);}
  8. void test_gen() {
  9. ofstream cout(task".inp");
  10. int tc=rand(4,10);
  11. cout << tc << '\n';
  12. while(tc-->0) {
  13. int n=rand(10,50), m=rand(30,60);
  14. cout << n << ' ' << m << '\n';
  15. for(int i=1;i<=m;i++) {
  16. int u=rand(1,n), v=u;
  17. while(u==v) v=rand(1,n);
  18. cout << u << ' ' << v << ' ' << rand(1,44) << '\n';
  19. }
  20. cout << '\n';
  21. }
  22. cout.close();
  23. return;
  24. }
  25. int32_t main() {
  26. ios::sync_with_stdio(false);
  27. cin.tie(0), cout.tie(0);
  28. int tc=30;
  29. system("cls");
  30. system("g++ sol.cpp -o sol.exe");
  31. system("g++ brute.cpp -o brute.exe");
  32. for(int i=1;i<=tc;i++) {
  33. test_gen();
  34. system("sol.exe");
  35. system("brute.exe");
  36. if(system("fc " task ".out " task ".ans") != 0) {
  37. cerr << "TEST " << i << ": Wrong Answer!";
  38. return 0;
  39. }
  40. cerr << "TEST " << i << ": ACCEPTED!\n\n";
  41. }
  42. return 0;
  43. }
Success #stdin #stdout #stderr 0.01s 5324KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
sh: 1: cls: not found
g++: error: sol.cpp: No such file or directory
g++: fatal error: no input files
compilation terminated.
g++: error: brute.cpp: No such file or directory
g++: fatal error: no input files
compilation terminated.
sh: 1: sol.exe: not found
sh: 1: brute.exe: not found
sh: 1: fc: not found
TEST 1: Wrong Answer!