v2.cpp 638 B

123456789101112131415161718192021222324252627
  1. #include "testlib.h"
  2. using namespace std;
  3. int main(int argc, char *argv[]) {
  4. registerValidation(argc, argv);
  5. int t = inf.readInt(1, 3, "~t");
  6. inf.readEoln();
  7. for (int tt = 1; tt <= t; tt++) {
  8. setTestCase(tt + 1);
  9. int n = inf.readInt(1, 4, "n~");
  10. inf.readSpace();
  11. inf.readInt(-2, 2, "l0l");
  12. inf.readSpace();
  13. inf.readInt(-5, 5, "r1d");
  14. inf.readEoln();
  15. vector<int> a = inf.readInts(n, 1, n, "a");
  16. ensuref(int(set<int>(a.begin(), a.end()).size()) == n, "not a permutation (duplicates)");
  17. inf.readEoln();
  18. }
  19. inf.readEof();
  20. }