QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#141010 | #5156. Going in Circles | As3b_team_f_masr | WA | 43ms | 3632kb | C++14 | 925b | 2023-08-17 06:31:03 | 2023-08-17 06:31:05 |
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<11000;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;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;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 43ms
memory: 3632kb
input:
0 1 1 0 0 1 0 1 1 0 0 1 0 0 1 1 0 1 1 0 1 1 0 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 1 1 0 0 1 1 0 1 1 0 0 1 0 1 1 0 1 0 1 0 0 0 0 0 1 0 1 0 1 0 1 1 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 1 0 1 0 1 1 0 1 1 0 1 0 1 0 0 0 1 0 0 1 1 0 1 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 0 1 0 0 1 0 1 1 0 1 0 0 0 0 0 1 0 1 0 1 0 1 0 ...
output:
? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? right ? flip ? right ? flip ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? right ? right ? fl...
result:
wrong answer Wrong answer: correct guess, but used too many queries. Queries used: 22435 (6935 too many)