fork download
  1. #include<bits/stdc++.h>
  2. #include <iostream>
  3. #define ll long long
  4. using namespace std;
  5.  
  6. mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());
  7.  
  8. #define fi first
  9. #define se second
  10. #define MP make_pair
  11. #define PB push_back
  12. #define ll long long
  13. #define pii pair<int, int>
  14. #define SZ(a) int(a.size())
  15. #define ALL(a) a.begin(), a.end()
  16. #define MS(a, v) memset(a, v, sizeof a)
  17. #define REP(i, n) for(int i = 0; i < n; ++ i)
  18. #define FOR(i, a, b) for(int i = (a); i <= (b); ++ i)
  19. #define FOD(i, a, b) for(int i = (a); i >= (b); -- i)
  20. #define TSun(TZ) freopen(TZ".inp", "r", stdin), freopen(TZ".ans", "w", stdout)
  21.  
  22. ll Rand(ll l, ll r){
  23. return l + 1ll * rd() % (r - l + 1) * rd() % (r - l + 1);
  24. }
  25. string s = "{}()[]";
  26. int main(){
  27.  
  28. ios_base :: sync_with_stdio(0);
  29.  
  30. srand(time(NULL));
  31.  
  32.  
  33. for(int test = 1; ; ++ test){
  34.  
  35. ofstream inp("test.inp");
  36.  
  37. int t = 1;
  38. // inp << t << "\n";
  39. while(t--){
  40. int n = Rand(3, 10), m = Rand(n - 1, 2 * n), s = Rand(0, 10), c = Rand(1, 10);
  41. inp << n << " " << m << " " << s << " " << c << '\n';
  42. FOR(i, 1, n){
  43. inp << Rand(1, 10) << ' ';
  44. }
  45. inp << "\n";
  46. FOR(i, 1, m){
  47. int l = Rand(1, n), r = Rand(l + 1, n), w = Rand(1, 10);
  48. inp << l << " " << r << " " << w << "\n";
  49. }
  50. // inp << "\n";
  51. }
  52.  
  53. inp.close();
  54. // return 0;
  55.  
  56. system("test.exe");
  57. system("test_trau.exe");
  58.  
  59. if(system("fc test.out test.ans") != 0){
  60. printf("Test %d Wrong!\n", test);
  61. return 0;
  62. }
  63. printf("Test %d Correct!\n", test);
  64. // return 0;
  65.  
  66. }
  67. return 0;
  68. }
  69.  
Success #stdin #stdout #stderr 0.01s 5320KB
stdin
Standard input is empty
stdout
Test 1 Wrong!
stderr
sh: 1: test.exe: not found
sh: 1: test_trau.exe: not found
sh: 1: fc: not found