# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
29804 | 2017-07-21T01:54:21 Z | Diuven | Ronald (COCI17_ronald) | C++11 | 56 ms | 3020 KB |
#include <bits/stdc++.h> int n, i, m, D[1010], a, b; bool G[1010][1010], flag=true; void toggle(int v){ for(int k=1; k<=n; k++){ if(k==v) continue; if(G[v][k]) G[v][k]=G[k][v]=false, D[v]--, D[k]--; else G[v][k]=G[k][v]=true, D[v]++, D[k]++; } } int main(){ scanf("%d%d", &n, &m); for(; m--; ){ scanf("%d%d", &a, &b); G[a][b]=G[b][a]=true; D[a]++, D[b]++; } for(i=2; i<=n; i++) if(!G[1][i]) toggle(i); for(i=1; i<=n; i++) flag&=(D[i]==n-1); puts(flag?"DA":"NE"); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 3020 KB | Output is correct |
2 | Correct | 0 ms | 3020 KB | Output is correct |
3 | Correct | 0 ms | 3020 KB | Output is correct |
4 | Correct | 0 ms | 3020 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 3020 KB | Output is correct |
2 | Correct | 0 ms | 3020 KB | Output is correct |
3 | Correct | 0 ms | 3020 KB | Output is correct |
4 | Correct | 0 ms | 3020 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 3020 KB | Output is correct |
2 | Correct | 0 ms | 3020 KB | Output is correct |
3 | Correct | 0 ms | 3020 KB | Output is correct |
4 | Correct | 0 ms | 3020 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 3020 KB | Output is correct |
2 | Correct | 0 ms | 3020 KB | Output is correct |
3 | Correct | 0 ms | 3020 KB | Output is correct |
4 | Correct | 0 ms | 3020 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 3020 KB | Output is correct |
2 | Correct | 0 ms | 3020 KB | Output is correct |
3 | Correct | 0 ms | 3020 KB | Output is correct |
4 | Correct | 0 ms | 3020 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 3020 KB | Output is correct |
2 | Correct | 0 ms | 3020 KB | Output is correct |
3 | Correct | 0 ms | 3020 KB | Output is correct |
4 | Correct | 0 ms | 3020 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 3020 KB | Output is correct |
2 | Correct | 16 ms | 3020 KB | Output is correct |
3 | Correct | 3 ms | 3020 KB | Output is correct |
4 | Correct | 0 ms | 3020 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 3020 KB | Output is correct |
2 | Correct | 6 ms | 3020 KB | Output is correct |
3 | Correct | 36 ms | 3020 KB | Output is correct |
4 | Correct | 56 ms | 3020 KB | Output is correct |