# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
68139 | MrTEK | 무제 (POI11_kon) | C++14 | 1127 ms | 132096 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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);
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |