# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1091519 |
2024-09-21T05:04:26 Z |
AndreasK |
Cave (IOI13_cave) |
C++14 |
|
1 ms |
348 KB |
#include <bits/stdc++.h>
#include <cave.h>
using namespace std;
#define designed ios_base::sync_with_stdio(0);
#define by cin.tie(0);
#define AndreasK cout.tie(0);
//#define int long long
#define ii pair <int, int>
#define vi vector <int>
#define iii pair <int, ii>
#define vii vector <ii>
#define vc vector <char>
#define vb vector <bool>
void exploreCave(int n) {
int s[n] = {}, d[n];
int x = tryCombination(s);
stack <int> st;
for (int c = 0; c < n; c++) {
s[c] ^= 1;
cout << '\n';
int prevx = x;
x = tryCombination(s);
if (x == -1)
x = 2 * n;
if (x < prevx) {
s[c] ^= 1;
}
else if (x == prevx) {
st.push(c);
}
else {
while (!st.empty()) {
prevx = x;
x = tryCombination(s);
if (x == -1)
x = 2 * n;
s[st.top()] ^= 1;
if (x > prevx) {
st.pop();
}
else {
s[st.top()] ^= 1;
break;
}
}
}
}
for (int c = 0; c < n; c++) {
s[c] ^= 1;
x = tryCombination(s);
s[c] ^= 1;
d[c] = x;
}
answer(s, d);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Hacked |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Hacked |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Hacked |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Hacked |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Hacked |
2 |
Halted |
0 ms |
0 KB |
- |