QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#124823 | #5156. Going in Circles | jzh# | WA | 4ms | 3452kb | C++14 | 1.7kb | 2023-07-15 16:16:13 | 2023-07-15 16:16:14 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
const int N = 2e5 + 5;
int rd() {
int u;
cin >> u;
return u;
}
int filp() {
cout << "filp" << endl;
return rd();
}
int lf() {
cout << "left" << endl;
return rd();
}
int rt() {
cout << "right" << endl;
return rd();
}
void answer(int ans) {
cout << "! " << ans << endl;
exit(0);
}
void makeTryEL(int n) {
int new_cur = rt();
if (new_cur == 1) {
filp();
return;
} else if (new_cur == 0) {
filp();
int lst = 0;
for (int i = 0; i < n - 1; i++) {
lst = lf();
}
if (lst == 1) {
answer(n - 1);
}
for (int i = 0; i < n - 1; i++) {
rt();
}
filp();
}
}
deque<int> hashvec = {1, 0, 0, 1, 1,
1, 0, 1, 0, 1,
1, 1, 1, 1, 0,
0, 1, 0, 0, 1};
int main() {
ios::sync_with_stdio(false);
int st = rd();
if (st == 1) {
filp();
}
for (int i = 2; i <= 3; i++) {
int cur = rt();
if (cur == 1) {
filp();
}
}
const int len = 16;
for (int i = 4; i <= len; i++) {
makeTryEL(i);
}
int step_cnt = 0;
deque<int> record;
for (int i = 0; i < len; i++) {
int ret = rt();
if (ret != hashvec[i]) {
filp();
}
}
while (step_cnt < 15500) {
int cur = rt();
step_cnt++;
record.push_back(cur);
while (record.size() > len) record.pop_front();
if (record == hashvec) {
answer(step_cnt);
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 4ms
memory: 3452kb
input:
0
output:
right
result:
wrong answer Wrong answer: invalid response type. Queries used: 0