Submission #710365

#TimeUsernameProblemLanguageResultExecution timeMemory
710365AstraytGame (APIO22_game)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define maxn 300005 int N, K, low[maxn]; vector<int> adj[maxn], rev[maxn]; void init(int n, int k){ N = n, K = k; for(int i = 0; i < k - 1; ++i) adj[i].pb(i + 1), rev[i + 1].pb(i); for(int i = 0; i < n; ++i) low[i] = i; } int add_teleporter(int u, int v){ if(u == v){ if(u < K) return 1; else return 0; } adj[u].pb(v); rev[v].pb(u); if(low[v] >= K) return 0; queue<int> bfs; bfs.push(v); while(bfs.size()){ int a = bfs.front(); bfs.pop(); for(auto b:rev[a]){ if(b == low[a] && b < K) return 1; if(low[b] > low[a]) { low[b] = low[a]; bfs.push(b); } if(low[b] < b && b < K) return 1; } } return 0; } int main(){ int n, m, k; cin >> n >> m >> k; init(n, k); bool ok = 1; for(int i = 0; i < m; ++i){ int u, v; cin >> u >> v; if(add_teleporter(u, v)) { cout << i << '\n'; ok = 0; break; } } if(ok) cout << m << '\n'; }

Compilation message (stderr)

/usr/bin/ld: /tmp/cc2V8M4r.o: in function `main':
stub.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc5f6wQq.o:game.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status