fork download
  1. #include <bits/stdc++.h>
  2.  
  3. #define ll long long
  4. #define el cout << '\n'
  5. #define ii pair<int, int>
  6. #define fi first
  7. #define se second
  8.  
  9. using namespace std;
  10.  
  11. mt19937_64 rd(chrono::steady_clock::now().time_since_epoch().count());
  12.  
  13. ll random(ll l, ll r)
  14. {
  15. return rd() % (r - l + 1) + l;
  16. }
  17. void makeTest()
  18. {
  19. ofstream cout("TAPPHUDINH.INP");
  20. int t = random(1, 36);
  21. cout << t, el;
  22. while (t--)
  23. {
  24. int n = random(2, 36);
  25. int m = random(0, (n * (n - 1))/2);
  26. // int m = 0;
  27. int MOD = random(1e8, 1e9);
  28. cout << n << ' ' << m << ' ' << MOD, el;
  29. for (int i = 1; i <= n; i++)
  30. cout << random(1, 1e9) << ' ';
  31. el;
  32. set<ii> s;
  33. while (s.size() < m)
  34. {
  35. int x, y;
  36. do
  37. {
  38. x = random(1, n);
  39. y = random(1, n);
  40. } while (x == y);
  41. if (x > y) swap(x, y);
  42. s.insert({x, y});
  43. };
  44. for (ii p : s)
  45. cout << p.fi << ' ' << p.se, el;
  46. }
  47. }
  48.  
  49. int main()
  50. {
  51. ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  52.  
  53. for (int i = 1; i <= 1e5; i++)
  54. {
  55. makeTest();
  56. system("TAPPHUDINH.EXE");
  57. system("TAPPHUDINH_TRAU.EXE");
  58. if (system("fc TAPPHUDINH.OUT TAPPHUDINH_TRAU.OUT"))
  59. {
  60. cerr << i << " WRONG\n";
  61. break;
  62. }
  63. cerr << i << " PASSED\n";
  64. }
  65. }
Success #stdin #stdout #stderr 0.01s 5320KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
sh: 1: TAPPHUDINH.EXE: not found
sh: 1: TAPPHUDINH_TRAU.EXE: not found
sh: 1: fc: not found
1 WRONG