fork download
  1. #include <bits/stdc++.h>
  2.  
  3. #define oo 1000000007
  4. #define maxN 100005
  5. #define debug(a) cout << #a << " = " << a << endl
  6. #define fdebug(a, x, y) { cout << #a << " : "; fto(_, x, y) cout << a[_] << ' '; cout << endl; }
  7. #define fto(i, x, y) for(int i = (x); i <= (y); ++i)
  8. #define fdto(i, x, y) for(int i = (x); i >= (y); --i)
  9. #define ftoa(i, x, y, a) for(int i = (x); i <= (y); i += a)
  10. #define fdtoa(i, x, y, a) for(int i = (x); i >= (y); i -= a)
  11. #define mp make_pair
  12. #define pb push_back
  13. #define pf push_front
  14. #define ll long long
  15. #define lb lower_bound
  16. #define ub upper_bound
  17. #define ull unsigned long long
  18. #define ii pair<int, int>
  19. #define vi vector<int>
  20. #define vii vector<ii>
  21. #define FF first
  22. #define SS second
  23.  
  24. using namespace std;
  25.  
  26. const string NAME = "template";
  27. const int NTEST = 1000;
  28.  
  29. int main() {
  30. srand(time(NULL));
  31.  
  32. for(int iTest = 1; iTest <= NTEST; iTest++) {
  33. ofstream inp((NAME + ".inp").c_str());
  34.  
  35. int n = rand()%10000+1;
  36. int m = rand()%10000+n;
  37. int k = rand()%100+1;
  38.  
  39. inp << n << " " << m << " " << k;
  40.  
  41. inp.close();
  42.  
  43. system((NAME + ".exe").c_str());
  44. system((NAME + "_trau.exe").c_str());
  45.  
  46. if(system(("fc " + NAME + ".out " + NAME + ".ans").c_str()) != 0) {
  47. cout << "Test " << iTest << ": WRONG!\n";
  48. return 0;
  49. }
  50. cout << "Test " << iTest << ": CORRECT!\n";
  51. }
  52.  
  53. return 0;
  54. }
  55.  
Success #stdin #stdout #stderr 0s 3472KB
stdin
Standard input is empty
stdout
Test 1: WRONG!
stderr
sh: 1: template.exe: not found
sh: 1: template_trau.exe: not found
sh: 1: fc: not found