#include "testlib.h" #include using namespace std; int main(int argc, char * argv[]) { setName("compare ordered sequences of signed int%d numbers", 8 * int(sizeof(long long))); registerTestlibCmd(argc, argv); int n = 0; while (!ans.seekEof() && !ouf.seekEof()) { n++; long long place_correct = ans.readLong(); long long place_contestant = ouf.readLong(); if (place_correct != place_contestant) { quitf(_wa, "%d%s numbers differ - expected: '%s', found: '%s'", n, englishEnding(n).c_str(), vtos(place_correct).c_str(), vtos(place_contestant).c_str()); } } int extraInAnsCount = 0; while (!ans.seekEof()) { ans.readLong(); extraInAnsCount++; } int extraInOufCount = 0; while (!ouf.seekEof()) { ouf.readLong(); extraInOufCount++; } if (extraInAnsCount > 0) { quitf(_wa, "Answer contains longer sequence [length = %d], but output contains %d elements", n + extraInAnsCount, n); } if (extraInOufCount > 0) { quitf(_wa, "Output contains longer sequence [length = %d], but answer contains %d elements", n + extraInOufCount, n); } quitf(_ok, "%d numbers", n); }