Submission #228252

#TimeUsernameProblemLanguageResultExecution timeMemory
228252shengdebaoPlaninarenje (COCI18_planinarenje)C++14
0 / 160
13 ms640 KiB
#include <bits/stdc++.h>//random submition// =|-_-|-=-|-_-|= using namespace std; const int MAXN = 5000 + 23; int n, m, mt[MAXN]; vector<int> g[MAXN]; bitset<MAXN> mark; bool dfs(int v) { mark[v] = true; for (auto u : g[v]) if (mt[u] == -1 || (!mark[mt[u]] && dfs(mt[u]))) { mt[u] = v; return true; } return false; } int main() { cin >> n >> m; for (int i = 0; i < m; i++) { int p, v; cin >> p >> v; g[--p].push_back(--v); } memset(mt, -1, sizeof mt); for (int i = 0; i < n; i++) { mark.reset(); if (dfs(i)) cout << "Slavko\n";//wrong need to edit dfs:)) else cout << "Mirko\n"; } return 0; }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...