fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. const int TESTS = 11; // including sample one
  4. int main() {
  5. srand(42);
  6. char dr[200];
  7. scanf("%s", dr);
  8. vector<bool> scores;
  9. for(int t = 0; t < TESTS; ++t) {
  10. char input[100], output[100];
  11. snprintf(input, sizeof(input), "%sinput%05d.in", dr, t);
  12. snprintf(output, sizeof(output), "%soutput%05d.out", dr, t);
  13.  
  14. freopen(input, "r", stdin);
  15.  
  16. // read input
  17.  
  18. freopen(output, "r", stdin);
  19.  
  20. // read participant output
  21. // if(the answer is correct) scores.push_back(true);
  22. // else scores.push_back(false);
  23. }
  24. int total = 0;
  25. // count correct tests, except for the sample test
  26. for(int i = 1; i < (int) scores.size(); ++i)
  27. total += scores[i];
  28. printf("%lf\n", (double) total / (TESTS - 1)); // the number of points
  29. for(int rep = 0; rep < 2; ++rep) // for some reason you have to print this twice, I don't know why
  30. for(int i = 0; i < (int) scores.size(); ++i) {
  31. printf("%d", (int) scores[i]);
  32. if(i == (int) scores.size() - 1) puts("");
  33. else printf(" ");
  34. }
  35. return 0;
  36. }
  37.  
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
0.000000