Submission #226517

#TimeUsernameProblemLanguageResultExecution timeMemory
226517quocnguyen1012Ronald (COCI17_ronald)C++14
120 / 120
56 ms3320 KiB
#include <bits/stdc++.h> #define fi first #define se second #define mp make_pair #define pb push_back #define eb emplace_back #define ar array using namespace std; typedef long long ll; typedef pair<int, int> ii; const int maxn = 1005, maxr = 1005, inf = 2e9; bool have[maxn][maxn]; int col[maxn], N, M; signed main(void) { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #ifdef LOCAL freopen("A.INP", "r", stdin); freopen("A.OUT", "w", stdout); #endif // LOCAL cin >> N >> M; while(M--){ int u, v; cin >> u >> v; have[u][v] = have[v][u] = true; } for(int y = 0; y < 2; ++y){ col[1] = y; for(int i = 2; i <= N; ++i){ col[i] = int(1 ^ col[1] ^ have[1][i]); } bool ok = true; for(int i = 1; i <= N; ++i){ for(int j = 1;j <= N; ++j){ if(i != j){ if(int(col[i] ^ col[j] ^ have[i][j]) == 0) ok = false; } } } if(ok){ cout << "DA"; return 0; } } cout << "NE"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...