fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define ull unsigned long long
  5. #define all(a) (a).begin(), (a).end()
  6. #define NAME "bai1"
  7. const int maxn = 1e6+1;
  8. const int NTEST = 100;
  9. ll Rand(ll l, ll r){
  10. return l+rand() * 1LL * rand() % (r+l-1);
  11. }
  12. void MakeTest(){
  13. ofstream inp(NAME".inp");
  14. int n = Rand(5, 1000);
  15. inp<<n;
  16. for(int i=1;i<=n;++i){
  17. inp<<Rand(1,1e6)<<' ';
  18. }
  19. }
  20. int main()
  21. {
  22. srand(time(0));
  23. for(int i=1;i<=NTEST;++i){
  24. MakeTest();
  25. system(NAME"_trau.exe");
  26. system(NAME".exe");
  27. if(system("fc "NAME".ans "NAME".out") != 0){
  28. cout<<"TEST "<<i<<": Wrong!\n";
  29. return 0;
  30. }
  31. cout<<"TEST "<<i<<": Correct!\n";
  32. }
  33.  
  34. return 0;
  35.  
  36. }
  37. /*---------------END---------------*/
  38.  
  39.  
Success #stdin #stdout #stderr 0.01s 5288KB
stdin
Standard input is empty
stdout
TEST 1: Wrong!
stderr
sh: 1: bai1_trau.exe: not found
sh: 1: bai1.exe: not found
sh: 1: fc: not found