Submission #228252

# Submission time Handle Problem Language Result Execution time Memory
228252 2020-04-30T09:39:27 Z shengdebao Planinarenje (COCI18_planinarenje) C++14
0 / 160
13 ms 640 KB
#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
1 Correct 5 ms 384 KB Output is correct
2 Incorrect 5 ms 384 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 512 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 640 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 512 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 512 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 512 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 512 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 512 KB Output isn't correct
2 Halted 0 ms 0 KB -