This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |