# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
122980 | 2019-06-29T21:54:48 Z | Leonardo_Paes | Ronald (COCI17_ronald) | C++11 | 32 ms | 1272 KB |
#include <bits/stdc++.h> using namespace std; const int maxn = 1e3+3; bool state[maxn], tab[maxn][maxn], ok=1; #define gc getchar inline int scan(void){ int n = 0, x = gc(), s =1; for (;x<'0'||x>'9';x=gc()) if(x=='-') s=-1; for (;x>='0'&&x<='9';x=gc()) n = (n<<3) + (n<<1) + x-'0'; return n; } int main(){ int n, m; n = scan(), m = scan(); for(int i=0; i<m; i++){ int x, y; x = scan(), y = scan(); tab[x][y]=tab[y][x]=1; } for(int i=2; i<=n; i++){ state[i]=state[i-1]; if(tab[i][i-1]==0)state[i]^=1; } for(int i=1; i<=n; i++){ for(int j=i+1; j<=n; j++){ int sum = state[i]+state[j]; if(tab[i][j]==0)if(sum%2==0)ok=0; if(tab[i][j]==1)if(sum%2==1)ok=0; } if(ok==0){ printf("NE\n"); return 0; } } printf("DA\n"); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 300 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 3 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 3 ms | 380 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 504 KB | Output is correct |
2 | Correct | 10 ms | 888 KB | Output is correct |
3 | Correct | 5 ms | 632 KB | Output is correct |
4 | Correct | 5 ms | 632 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 504 KB | Output is correct |
2 | Correct | 7 ms | 888 KB | Output is correct |
3 | Correct | 21 ms | 1272 KB | Output is correct |
4 | Correct | 32 ms | 1272 KB | Output is correct |