fork(10) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. const int MINN = 1, MAXN = 10, MINM = 1, MAXM = 10, MINV = 1, MAXV = 10;
  4. int n, m;
  5.  
  6. int main()
  7. {
  8. srand(time(NULL));
  9. for(int iTest = 1; iTest <= 100; iTest++)
  10. {
  11. ofstream inp("vmellip.inp");
  12. n = MINN + rand() % (MAXN - MINN + 1);
  13. m = MINM + rand() % (MAXM - MINM + 1);
  14. inp << n << " " << m << "\n";
  15. for(int i = 1; i <= n; i++)
  16. {
  17. inp << MINV + rand() % (MAXV - MINV + 1) << " " << MINV + rand() % (MAXV - MINV + 1) << " ";
  18. }
  19. inp << "\n";
  20. for(int i = 1; i <= m; i++)
  21. {
  22. int tp = 1 + rand() % 6, l = 1 + rand() % n, h = 1 + rand() % n, v = MINV + rand() % (MAXV - MINV + 1);
  23. if(l > h)
  24. {
  25. swap(l, h);
  26. }
  27. if(tp <= 4)
  28. {
  29. inp << tp << " " << l << " " << h << " " << v << "\n";
  30. }
  31. else
  32. {
  33. inp << tp << " " << l << " " << h << "\n";
  34. }
  35. }
  36. inp << MINV + rand() % (MAXV - MINV + 1) << " " << MINV + rand() % (MAXV - MINV + 1);
  37. inp.close();
  38. system("vmellip.exe");
  39. system("vmellip_trau.exe");
  40. if(system("fc vmellip.out vmellip.ans") != 0)
  41. {
  42. cout << "Test " << iTest << ": WRONG!\n";
  43. return 0;
  44. }
  45. cout << "Test " << iTest << ": CORRECT!\n";
  46. }
  47. return 0;
  48. }
  49.  
Success #stdin #stdout #stderr 0s 3472KB
stdin
Standard input is empty
stdout
Test 1: WRONG!
stderr
sh: 1: vmellip.exe: not found
sh: 1: vmellip_trau.exe: not found
sh: 1: fc: not found