# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
68138 | 2018-08-16T06:44:44 Z | MrTEK | Conspiracy (POI11_kon) | C++14 | 861 ms | 132096 KB |
#include <cstdio> const int N = 5000; int n; int count[N]; int degree[N]; int main() { scanf("%d", &n); int edges = 0; for (int i = 1; i <= n; ++i) { int currentDegree; scanf("%d", ¤tDegree); ++count[currentDegree]; edges += currentDegree; while (getchar() != '\n'); // pomijamy opis krawedzi } edges /= 2; int last = 0; for (int i = n - 1; i >= 0; --i) for (int j = 0; j < count[i]; ++j) degree[last++] = i; int m = 1; int result = 0; int sum = 0; for (int i = 0; i < n - 1; ++i) { sum += degree[i] - i; if (sum == edges) { if (degree[i + 1] == degree[i]) result += count[degree[i]]; else ++result; } } printf("%d\n", result); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 252 KB | Output is correct |
2 | Correct | 2 ms | 356 KB | Output is correct |
3 | Correct | 2 ms | 396 KB | Output is correct |
4 | Correct | 3 ms | 448 KB | Output is correct |
5 | Correct | 3 ms | 584 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 584 KB | Output is correct |
2 | Correct | 3 ms | 584 KB | Output is correct |
3 | Correct | 2 ms | 620 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 620 KB | Output is correct |
2 | Correct | 3 ms | 620 KB | Output is correct |
3 | Correct | 2 ms | 700 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 700 KB | Output is correct |
2 | Correct | 4 ms | 752 KB | Output is correct |
3 | Correct | 3 ms | 848 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 896 KB | Output is correct |
2 | Correct | 4 ms | 1068 KB | Output is correct |
3 | Correct | 4 ms | 1124 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 1356 KB | Output is correct |
2 | Correct | 27 ms | 3956 KB | Output is correct |
3 | Correct | 126 ms | 17112 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 17388 KB | Output is correct |
2 | Correct | 42 ms | 21192 KB | Output is correct |
3 | Correct | 199 ms | 38976 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 33 ms | 41592 KB | Output is correct |
2 | Correct | 93 ms | 50376 KB | Output is correct |
3 | Correct | 339 ms | 79628 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 65 ms | 84220 KB | Output is correct |
2 | Correct | 235 ms | 104708 KB | Output is correct |
3 | Runtime error | 861 ms | 132096 KB | Memory limit exceeded: We have a known bug that the memory usage is measured incorrectly (possibly because of Meltdown/Spectre patch), so your solution may be correct. Please submit again. Sorry for the inconvenience. |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 648 ms | 132096 KB | Memory limit exceeded: We have a known bug that the memory usage is measured incorrectly (possibly because of Meltdown/Spectre patch), so your solution may be correct. Please submit again. Sorry for the inconvenience. |
2 | Halted | 0 ms | 0 KB | - |