fork download
  1. #include <bits/stdc++.h>
  2. #include "testlib.h"
  3. typedef long long ll;
  4. using namespace std;
  5. int a[1000100], b[1000100];
  6. int main(int argc, char * argv[])
  7. {
  8. setName("Compare test");
  9. registerTestlibCmd(argc, argv);
  10. int n = ans.readInt();
  11. int m = inf.readInt();
  12. if (n == m && n == 0) quitf(_ok, "correct !!");
  13.  
  14. if (n > m) quitf(_wa, "Are you kidding me ??");
  15. for (int i=1; i<=m; i++) b[i] = inf.readInt();
  16. for (int i=1; i<=n; i++) a[i] = ans.readInt();
  17. int our = b[1];
  18. ll s = 0, t = our;
  19. for (int i=2; i<=m; i++)
  20. {
  21. t += (ll)b[i];
  22. }
  23. for (int i=1; i<=n; i++)
  24. {
  25. if (b[a[i]] > our/2 && a[i] > 1) quitf(_wa,"nooooo!!");
  26. s += (ll)b[a[i]];
  27. }
  28. if (s > t/2) quitf(_ok,"Correct!!");
  29. else quitf(_wa, "False!!");
  30. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
5
compilation info
prog.cpp:2:10: fatal error: testlib.h: No such file or directory
 #include "testlib.h"
          ^~~~~~~~~~~
compilation terminated.
stdout
Standard output is empty