// validator.cpp — input validator for the “MEX sequence counting” problem // Uses Codeforces/Polygon testlib (https://codeforces.com/problemset/problemset#testlib) // // The input format is: // N M\n // Constraints // 1 ≤ N ≤ 5·10^5 // 1 ≤ M ≤ 5·10^5 // (single test case per file) // // The validator checks: // * exactly two integers on the first line // * both lie inside the stated ranges // * the file contains nothing after the first EOLN // // Build example (Polygon default): // g++ -std=c++17 -O2 -pipe -static -s validator.cpp -o validator #include "testlib.h" int main(int argc, char **argv) { registerValidation(argc, argv); // Read N and M with explicit bounds const int MAX_N = 500000; const int MAX_M = 490000; int N = inf.readInt(1, MAX_N, "N"); inf.readSpace(); int M = inf.readInt(1, MAX_M, "M"); inf.readEoln(); // No further tokens should exist inf.readEof(); return 0; }