Submission #237390

#TimeUsernameProblemLanguageResultExecution timeMemory
237390marlicuRonald (COCI17_ronald)C++14
120 / 120
45 ms4216 KiB
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e3 + 5; int n; bool linija[MAXN][MAXN]; bool kopija[MAXN][MAXN]; void promjena (int x) { for (int i = 0; i < n; i++) { if (i == x) continue; kopija[i][x] = kopija[x][i] = 1 - kopija[i][x]; } } bool ok(int pocetno) { for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { kopija[i][j] = linija[i][j]; } } if (pocetno) promjena(0); for (int i = 1; i < n; i++) { if (!kopija[0][i]) promjena(i); } int koliko; for (int i = 0; i < n; i++) { koliko = 0; for (int j = 0; j < n; j++) { if (kopija[i][j] || i == j) koliko++; } if (koliko != n) return false; } return true; } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> n; int m, a, b; cin >> m; for (int i = 0; i < m; i++) { cin >> a >> b; a--; b--; linija[a][b]++; linija[b][a]++; } if (ok(0) || ok(1)) cout << "DA\n"; else cout << "NE\n"; return 0; }

Compilation message (stderr)

ronald.cpp: In function 'int main()':
ronald.cpp:54:21: warning: use of an operand of type 'bool' in 'operator++' is deprecated [-Wdeprecated]
         linija[a][b]++;
                     ^~
ronald.cpp:55:21: warning: use of an operand of type 'bool' in 'operator++' is deprecated [-Wdeprecated]
         linija[b][a]++;
                     ^~
#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...