mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-28 02:16:27 +00:00
43 lines
990 B (Stored with Git LFS)
C++
43 lines
990 B (Stored with Git LFS)
C++
#include "testlib.h"
|
|
|
|
int a[100005], c[100005];
|
|
|
|
int main(int argc, char* argv[]) {
|
|
registerTestlibCmd(argc, argv);
|
|
|
|
int pans = ouf.readInt();
|
|
int jans = ans.readInt();
|
|
|
|
if (pans != jans) {
|
|
quitf(_wa, "The answer is wrong: expected = %f, found = %f", jans, pans);
|
|
} else {
|
|
int n = inf.readInt();
|
|
for (int i = 1; i <= n; ++i) {
|
|
a[i] = inf.readInt();
|
|
}
|
|
for (int i = 1; i <= pans; ++i) {
|
|
int l = ouf.readInt();
|
|
int r = ouf.readInt();
|
|
c[l]++;
|
|
c[r + 1]--;
|
|
}
|
|
|
|
bool flag = 0;
|
|
for (int i = 1; i <= n; ++i) {
|
|
c[i] += c[i - 1];
|
|
if (c[i] != a[i]) {
|
|
flag = 1;
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (flag) {
|
|
quitf(_wa, "The answer is wrong.");
|
|
} else {
|
|
quitf(_ok, "The answer is correct.");
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|