QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#141012 | #5156. Going in Circles | As3b_team_f_masr | WA | 34ms | 3684kb | C++14 | 961b | 2023-08-17 06:32:54 | 2023-08-17 06:32:57 |
Judging History
answer
#include <bits/stdc++.h>
typedef long double ld;
typedef long long ll;
using namespace std;
int di[] = {1, 0, -1, 0, 0, 1, -1, 1};
int dj[] = {0, 1, 0, -1, -1, 0, 1, -1};
const ll oo = 1e18, MOD = 1e9 + 7;
const int N = 1e6 + 5, M = 30005;
//#define endl '\n'
vector<int>v;
int main()
{
srand(time(0));
for(int i=0;i<20000;i++) v.push_back(rand()%2);
vector<int>tmp;
int idx=0;
while(1){
int n;
cin>>n;
tmp.push_back(n);
if(n!=v[idx++]) {cout<<"? flip"<<endl;cout.flush();cin>>n;}
if(tmp.size()%3==0&&tmp.size()>=9){
bool no=0;
for(int i=tmp.size()/3,j=0;i<tmp.size();i++,j++){
if(tmp[i]!=v[j]){
no=1;
break;
}
}
if(!no) return !(cout<<"! "<<tmp.size()/3);
}
cout<<"? right"<<endl;
cout.flush();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 34ms
memory: 3684kb
input:
0 1 1 0 0 1 1 0 0 1 1 0 1 1 0 1 0 1 1 0 0 1 0 0 1 1 1 0 1 0 1 0 1 0 1 1 0 0 1 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 1 0 0 1 0 0 0 1 1 0 0 1 1 0 0 1 1 0 1 1 0 1 0 1 0 0 1 0 1 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 0 1 1 0 1 0 0 1 1 0 0 0 1 0 0 1 0 1 0 1 0 0 0 1 0 1 0 1 1 0 1 ...
output:
? flip ? right ? right ? right ? flip ? right ? flip ? right ? flip ? right ? right ? right ? right ? flip ? right ? flip ? right ? right ? right ? right ? right ? flip ? right ? flip ? right ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? right ? flip ? right ? flip ? right ? ...
result:
wrong answer Wrong answer: correct guess, but used too many queries. Queries used: 22492 (6992 too many)