Submission #642544

#TimeUsernameProblemLanguageResultExecution timeMemory
642544danikoynovGame (APIO22_game)C++17
60 / 100
2725 ms119544 KiB
#include<bits/stdc++.h> #define endl '\n' using namespace std; typedef long long ll; const int maxk = 5010, maxn = 30010; vector < int > g[maxn]; int used[maxk][maxn], tf, K; void add_edge(int i, int u, int v) { if (used[i][u] == 0) return; if (used[i][v]) { if (v <= i) tf = 1; return; } queue < int > q; q.push(v); used[i][v] = 1; while(!q.empty()) { int cur = q.front(); ///cout << i << " :: " << cur << endl; q.pop(); if (cur <= i) tf = 1; for (int nb : g[cur]) { if (used[i][nb] == 0) { used[i][nb] = 1; q.push(nb); } else if (nb <= i) tf = 1; } } } void init(int n, int k) { K = k; for (int i = 0; i < k; i ++) for (int j = i; j < k; j ++) used[i][j] = 1; } int add_teleporter(int u, int v) { g[u].push_back(v); for (int i = 0; i < K; i ++) { add_edge(i, u, v); } return tf; }

Compilation message (stderr)

game.cpp: In function 'void add_edge(int, int, int)':
game.cpp:31:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   31 |         if (cur <= i)
      |         ^~
game.cpp:33:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   33 |             for (int nb : g[cur])
      |             ^~~
#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...