# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
316348 |
2020-10-26T04:24:36 Z |
thecodingwizard |
Walk (POI13_spa) |
C++11 |
|
5000 ms |
221752 KB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n, k;
ll read() {
ll num = 0;
for (int i = n-1; i >= 0; i--) {
char c; cin >> c;
if (c == '1') {
num |= (1 << i);
}
}
return num;
}
int main() {
cin.tie(0)->sync_with_stdio(0);
cin >> n >> k;
map<ll, int> deadCt;
set<ll> dead;
queue<ll> q;
ll a, b; a = read(), b = read();
for (int i = 0; i < k; i++) {
ll x = read();
dead.insert(x);
q.push(x);
}
while (!q.empty()) {
ll x = q.front(); q.pop();
for (int i = 0; i < n; i++) {
ll y = x ^ (1 << i);
deadCt[y]++;
if (deadCt[y] == n && !dead.count(y)) {
q.push(y);
dead.insert(y);
}
}
}
if (dead.count(a) || dead.count(b)) cout << "NIE" << "\n";
else cout << "TAK" << "\n";
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
1920 KB |
Output is correct |
2 |
Incorrect |
3 ms |
512 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
5031 ms |
81400 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
22 ms |
3192 KB |
Output is correct |
2 |
Incorrect |
46 ms |
2936 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
69 ms |
3576 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4162 ms |
208424 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3036 ms |
131932 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
5080 ms |
221752 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
5080 ms |
212084 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |