fork download
  1. #include <bits/stdc++.h>
  2.  
  3. #define int long long
  4. #define ll long long
  5. #define double long double
  6. #define all(v) v.begin(), v.end()
  7. #define ii pair<int, int>
  8. #define fi first
  9. #define se second
  10. #define pb push_back
  11. #define maximize(a, b) a = max(a, b)
  12. #define minimize(a, b) a = min(a, b)
  13. #define cbit(n) __builtin_popcount(n)
  14. #define getbit(mask, i) ((mask >> i) & 1LL)
  15. #define onbit(mask, i) (mask | (1LL << i))
  16. #define offbit(mask, i) (mask ^ (1LL << i))
  17. #define TASK "1"
  18.  
  19. using namespace std;
  20.  
  21. const int N = 2e5 + 5;
  22. const ll oo = 1e18;
  23. const int base = 311;
  24. //const int sz = sqrt(N);
  25. const int mod = 1e9 + 7;
  26.  
  27. mt19937_64 rd(chrono::steady_clock::now().time_since_epoch().count());
  28.  
  29. int Rand(int l, int r)
  30. {
  31. return uniform_int_distribution<int> (l, r) (rd);
  32. }
  33.  
  34. signed main()
  35. {
  36. ios_base::sync_with_stdio(false);
  37. cin.tie(NULL);
  38. cout.tie(NULL);
  39.  
  40. if(fopen(TASK".inp", "r")){
  41. freopen(TASK".inp", "r", stdin);
  42. freopen(TASK".out", "w", stdout);
  43. }
  44.  
  45. srand(time(NULL));
  46. int nTest = 1000;
  47. for(int test = 1; test <= nTest; test++){
  48. ofstream inp("test.inp");
  49. int n = Rand(1, 300), q = Rand(1, 300);
  50. // n = 500000;
  51. inp << n << " " << q << "\n";
  52. for(int i = 1; i <= n; i++) inp << Rand(-100, 100) << " \n"[i == n];
  53. for(int i = 1; i <= q; i++) inp << Rand(-100, 100) << " \n"[i == q];
  54.  
  55. inp.close();
  56. system("./test");
  57. system("./test_trau");
  58. if(system("diff test.out test.ans") != 0) return 0;
  59. cerr << "Test " << test << ": AC\n";
  60. }
  61. return 0;
  62. }
  63.  
Success #stdin #stdout #stderr 0.01s 5312KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
sh: 1: ./test: not found
sh: 1: ./test_trau: not found
diff: test.out: No such file or directory
diff: test.ans: No such file or directory