QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#67943 | #5156. Going in Circles | Baltinic | WA | 115ms | 3640kb | C++23 | 1.2kb | 2022-12-13 13:56:41 | 2022-12-13 13:56:44 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(auto i = (a); i < (b); i++)
#define pb push_back
#define fs first
#define sc second
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<vii> vvii;
const double EPS = 1e-9;
int main() {
cin.sync_with_stdio(false);
srand(time(NULL));
vector<int> Pattern;
for(int i = 0; i < 20; i++) {
Pattern.pb(rand() % 2);
}
vector<int> Have;
int s;
int at = 0;
int corr = 0;
while(true) {
cin >> s;
Have.pb(s);
if(s != Pattern[at % 20]) {
cout << "? flip" << endl;
cin >> s;
}
bool same = true;
if(Have.size() < 20) same = false;
else {
for(int i = 0; i < 20; i++) {
if(Pattern[19 - i] != Have[(int)Have.size() - i - 1]) same = false;
}
}
if(same) {
cout << "! " << Have.size() - Pattern.size() << endl;
return 0;
}
// check if done
//
at++;
cout << "? left" << endl;
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 37ms
memory: 3564kb
input:
0 1 0 1 0 0 1 0 0 1 1 0 1 0 0 0 0 1 0 1 0 0 1 0 1 1 0 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0 1 1 0 1 0 1 0 1 0 1 1 1 0 0 1 1 0 0 1 1 1 0 1 0 1 1 0 0 1 0 0 1 0 0 1 0 0 1 0 1 1 0 0 1 1 0 1 1 0 0 0 1 0 0 0 0 1 0 0 1 0 0 1 0 1 1 0 0 1 1 0 1 1 1 0 1 0 1 1 0 1 0 0 1 0 0 1 0 1 0 1 0 1 0 1 1 0 1 0 1 1 0 0 1 0 1 1 0 ...
output:
? left ? left ? left ? flip ? left ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? left ? left ? flip ? left ? flip ? left ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? left ? left ? left ? flip ? left ? left ? flip ? left ? flip ? left...
result:
ok Queries used; 7519.
Test #2:
score: 0
Accepted
time: 53ms
memory: 3492kb
input:
1 0 1 1 0 0 1 1 0 0 1 0 1 1 0 1 0 1 1 0 0 1 1 0 1 0 1 0 1 0 0 0 0 1 1 1 0 1 1 0 0 1 1 0 1 1 0 0 1 1 1 0 0 1 0 1 0 0 1 0 0 0 1 1 1 0 0 1 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 1 0 0 1 0 1 0 1 1 0 0 1 1 1 0 1 0 1 0 0 0 1 0 1 0 1 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 1 0 0 1 0 1 0 1 ...
output:
? flip ? left ? left ? left ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? left ? flip ? left ? flip ? left ? flip ? left ? left ? left ? left ? flip ? left ? left ? flip ? left ? left ? left ? flip ? left ? left ? flip ? left ? left ? flip ? left ? flip ? left ? left...
result:
ok Queries used; 7302.
Test #3:
score: 0
Accepted
time: 44ms
memory: 3556kb
input:
0 0 1 0 1 0 0 0 0 0 1 1 1 0 0 0 1 1 0 1 0 1 1 0 0 1 1 0 0 0 0 1 1 0 1 0 1 0 1 0 0 1 0 1 0 0 1 1 0 0 1 1 0 1 1 0 1 0 1 0 0 0 1 1 0 0 0 1 0 1 0 1 1 0 0 0 1 1 0 1 0 1 1 1 0 1 0 0 1 0 1 0 0 1 1 0 0 0 0 0 1 1 0 1 0 1 0 1 0 1 0 1 1 0 0 1 1 0 1 0 0 0 0 1 0 1 0 1 0 0 0 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 0 1 0 ...
output:
? left ? left ? flip ? left ? left ? left ? left ? left ? left ? flip ? left ? left ? flip ? left ? left ? flip ? left ? flip ? left ? left ? flip ? left ? left ? left ? flip ? left ? flip ? left ? left ? left ? left ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? flip...
result:
ok Queries used; 7519.
Test #4:
score: 0
Accepted
time: 17ms
memory: 3568kb
input:
0 1 0 0 0 1 1 0 1 0 1 0 1 0 1 0 0 0 1 1 0 1 1 0 0 1 0 1 1 0 0 1 0 0 0 1 1 0 0 0 1 1 0 0 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 1 0 0 1 1 0 1 0 1 0 1 0 1 1 1 0 0 0 0 0 1 0 1 0 0 1 1 0 1 0 0 1 0 1 0 1 1 0 1 0 0 1 0 1 0 1 1 0 0 1 0 1 0 1 1 0 1 0 1 1 1 0 1 0 0 0 1 1 1 0 0 0 1 0 1 0 1 ...
output:
? left ? flip ? left ? left ? left ? left ? flip ? left ? flip ? left ? left ? flip ? left ? left ? flip ? left ? left ? flip ? left ? left ? flip ? left ? flip ? left ? left ? left ? flip ? left ? left ? left ? left ? flip ? left ? left ? flip ? left ? flip ? left ? left ? flip ? left ? left ? left...
result:
ok Queries used; 6120.
Test #5:
score: 0
Accepted
time: 47ms
memory: 3564kb
input:
0 1 0 1 1 0 1 0 1 1 1 1 1 0 0 0 1 1 0 0 1 1 0 0 1 0 0 1 0 0 1 1 0 1 0 1 1 0 1 0 1 1 0 1 0 1 0 0 1 0 1 0 0 1 1 0 0 0 1 0 1 0 0 1 0 1 0 1 1 0 1 1 0 1 0 1 0 1 0 0 0 1 1 0 1 1 0 0 0 1 0 1 0 0 1 1 1 0 1 0 1 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 0 1 0 1 0 0 0 1 0 1 1 0 1 1 1 1 1 1 1 0 1 0 1 1 0 0 1 1 0 1 0 0 0 ...
output:
? flip ? left ? flip ? left ? left ? flip ? left ? flip ? left ? left ? left ? left ? flip ? left ? left ? flip ? left ? left ? left ? flip ? left ? flip ? left ? left ? flip ? left ? left ? flip ? left ? flip ? left ? left ? flip ? left ? flip ? left ? left ? flip ? left ? flip ? left ? left ? flip...
result:
ok Queries used; 6178.
Test #6:
score: 0
Accepted
time: 41ms
memory: 3488kb
input:
0 0 0 1 0 0 1 1 0 1 1 1 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 0 1 1 0 0 1 0 1 0 1 0 1 1 0 0 0 1 0 0 1 0 0 1 0 1 0 0 0 0 1 0 1 0 0 1 0 1 0 1 0 0 1 0 1 0 1 0 0 1 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 0 1 0 1 0 1 0 0 0 0 1 0 0 1 1 0 1 1 0 1 1 1 1 0 1 0 1 0 0 1 1 0 0 0 0 0 0 1 0 1 1 0 1 1 0 0 1 ...
output:
? left ? left ? left ? left ? left ? flip ? left ? flip ? left ? left ? left ? left ? left ? left ? left ? left ? left ? left ? left ? flip ? left ? left ? flip ? left ? left ? flip ? left ? left ? flip ? left ? flip ? left ? flip ? left ? left ? left ? flip ? left ? flip ? left ? flip ? left ? left...
result:
ok Queries used; 6185.
Test #7:
score: 0
Accepted
time: 18ms
memory: 3512kb
input:
0 1 0 0 0 1 0 1 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 1 0 1 0 1 0 0 0 0 0 0 1 0 0 1 ...
output:
? left ? flip ? left ? left ? flip ? left ? flip ? left ? flip ? left ? left ? left ? left ? left ? left ? flip ? left ? left ? flip ? left ? left ? left ? flip ? left ? left ? left ? left ? left ? left ? left ? flip ? left ? flip ? left ? flip ? left ? left ? left ? left ? left ? left ? flip ? left...
result:
ok Queries used; 6519.
Test #8:
score: 0
Accepted
time: 41ms
memory: 3556kb
input:
0 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 1 0 1 0 1 0 0 1 0 1 0 0 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 1 0 1 0 1 0 0 1 0 1 0 0 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 1 0 1 0 1 0 0 1 0 1 0 0 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 1 0 1 0 1 0 0 1 0 1 0 0 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 1 0 ...
output:
? left ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? left ? left ? flip ? left ? left ? flip ? left ? flip ? left ? flip ? left ? left ? flip ? left ? flip ? left ? left ? left ? flip ? left ? flip ? left ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left...
result:
ok Queries used; 8018.
Test #9:
score: 0
Accepted
time: 115ms
memory: 3484kb
input:
0 1 1 0 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 0 1 ...
output:
? flip ? left ? left ? left ? flip ? left ? flip ? left ? flip ? left ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? left ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? left ? flip ? left ? flip...
result:
ok Queries used; 8969.
Test #10:
score: 0
Accepted
time: 51ms
memory: 3640kb
input:
0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 ...
output:
? flip ? left ? flip ? left ? flip ? left ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? left ? left ? left ? flip ? left ? left ? flip ? left ? left ? flip ? left ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? left ? flip ? left ? flip...
result:
ok Queries used; 6779.
Test #11:
score: 0
Accepted
time: 48ms
memory: 3572kb
input:
0 1 1 0 0 0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0 1 ...
output:
? flip ? left ? left ? left ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? left ? left ? left ? flip ? left ? flip ? left ? flip ? left ? left ? left ? flip ? left ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? left ? left ? flip ? left ? flip ? left ? flip ? left...
result:
ok Queries used; 6580.
Test #12:
score: 0
Accepted
time: 30ms
memory: 3544kb
input:
0 1 0 1 0 0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 1 0 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 1 0 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 1 0 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 1 0 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0 0 0 0 1 0 ...
output:
? flip ? left ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? left ? left ? left ? flip ? left ? flip ? left ? left ? left ? left ? flip ? left ? flip ? left ? flip ? left ? left ? flip ? left ? flip ? left ? left ? left ? flip ? left ? flip ? left ? flip ? left ? flip...
result:
ok Queries used; 6389.
Test #13:
score: 0
Accepted
time: 5ms
memory: 3380kb
input:
0 0 1 1 0 0 1 1 0 0 1 0 1 0 1 0 0 0 1 1 0 0 1 0 0 0 0 1 1 1 0 1 0 1 1 0 0 1 1 0 1 0 1 0 0 1 1 0 1 0 1 0 0 1 1 0 0 1 0 0 1 0 1 1 0 1 0 0 1 0 0 1 1 0 0 1 0 0 0 1 0 1 0 0 1 1 0 0 1 1 0 0 0 1 0 1 0 1 0 0 1 1 0 0 1 0 0 1 1 0 1 0 0 1
output:
? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? left ? flip ? left ? left ? left ? left ? flip ? left ? flip ? left ? flip ? left ? left ? left ? left ? flip ? left ? left ? flip ? left ? flip ? left ? left ? flip ? left ? flip ? left ? flip ? left ? left ? left ? flip...
result:
ok Queries used; 113.
Test #14:
score: 0
Accepted
time: 47ms
memory: 3556kb
input:
0 1 0 0 1 1 0 1 0 1 0 0 1 1 0 0 1 0 0 1 1 0 1 0 1 0 0 1 0 1 1 0 0 1 0 0 1 1 0 0 1 1 0 0 0 1 1 0 1 0 1 1 0 1 0 0 1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 1 1 0 0 0 1 1 0 1 0 0 1 1 0 1 0 0 1 0 0 1 0 1 1 0 1 0 1 0 1 0 0 1 1 0 0 0 1 1 0 0 1 0 1 0 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 0 0 1 1 0 0 0 1 1 0 1 0 1 1 0 1 1 0 1 ...
output:
? left ? left ? left ? flip ? left ? flip ? left ? left ? left ? flip ? left ? flip ? left ? flip ? left ? left ? left ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? left ? left ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left...
result:
ok Queries used; 2565.
Test #15:
score: 0
Accepted
time: 47ms
memory: 3536kb
input:
0 1 1 0 0 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 1 0 1 1 0 1 0 1 1 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 0 1 1 0 1 0 1 0 1 0 1 1 0 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0 1 1 0 1 0 1 0 0 1 0 1 1 1 0 1 0 0 1 1 0 1 0 0 0 1 1 0 1 0 0 1 0 0 1 0 1 1 0 1 1 0 1 1 1 0 0 1 0 1 0 1 0 0 1 0 1 1 0 0 1 1 0 0 0 0 1 1 0 1 0 1 1 1 0 ...
output:
? flip ? left ? flip ? left ? left ? left ? left ? left ? flip ? left ? flip ? left ? left ? left ? flip ? left ? flip ? left ? left ? left ? flip ? left ? flip ? left ? left ? flip ? left ? flip ? left ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? left ? flip ? left ? left ? flip...
result:
ok Queries used; 4833.
Test #16:
score: 0
Accepted
time: 42ms
memory: 3564kb
input:
0 1 0 0 0 0 1 0 0 1 0 0 0 1 0 0 1 0 1 0 1 1 1 0 1 0 1 0 0 0 1 0 0 1 0 0 0 1 1 0 0 1 0 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0 1 0 1 0 1 1 0 1 0 0 1 0 0 0 0 1 1 0 0 1 1 1 1 1 0 1 0 1 0 0 0 0 1 1 0 0 1 1 0 1 0 1 0 0 1 0 0 1 0 1 0 1 1 0 0 1 1 1 0 1 0 1 0 0 0 1 0 0 0 1 1 0 1 0 1 0 0 1 1 0 1 1 0 1 0 1 0 0 ...
output:
? flip ? left ? left ? left ? left ? left ? left ? left ? left ? left ? left ? left ? left ? left ? left ? flip ? left ? flip ? left ? flip ? left ? left ? flip ? left ? left ? flip ? left ? left ? left ? left ? flip ? left ? flip ? left ? left ? left ? flip ? left ? flip ? left ? left ? flip ? left...
result:
ok Queries used; 7357.
Test #17:
score: 0
Accepted
time: 58ms
memory: 3552kb
input:
0 0 1 0 0 1 0 0 1 0 1 0 1 1 0 0 0 0 1 1 0 1 0 1 0 1 0 0 1 0 0 0 1 1 0 1 1 0 1 0 0 1 0 0 1 1 0 1 0 0 1 0 0 1 1 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 0 0 1 0 1 1 1 0 0 1 1 0 0 1 0 0 1 1 0 0 1 0 0 1 0 0 1 0 1 0 1 1 0 0 0 1 0 1 0 1 0 1 0 1 0 0 1 0 0 0 1 1 0 1 0 1 0 1 0 0 1 0 0 1 1 0 1 0 0 1 0 0 1 1 0 0 1 1 ...
output:
? left ? left ? flip ? left ? flip ? left ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? left ? left ? flip ? left ? left ? flip ? left ? left ? left ? left ? left ? left ? flip ? left ? left ? left ? left ? left ? flip ? left ? left ? left ? flip ? left ? left ? left ? flip ? left...
result:
ok Queries used; 7352.
Test #18:
score: 0
Accepted
time: 46ms
memory: 3544kb
input:
0 1 0 0 1 0 0 1 0 1 0 1 0 0 1 1 0 1 0 1 0 1 0 1 0 0 1 0 1 1 0 0 1 1 0 0 0 0 1 0 1 0 1 0 1 1 0 0 1 0 1 1 0 0 1 0 0 1 0 1 0 0 1 1 1 0 1 0 1 0 0 1 0 1 0 1 1 0 0 1 1 0 0 1 0 1 0 0 1 0 0 1 1 1 0 0 1 1 0 0 1 0 0 1 0 1 0 1 0 0 1 1 0 1 0 1 1 0 0 1 0 0 1 0 1 1 0 0 1 1 0 0 0 0 1 0 1 0 1 1 0 0 1 1 0 0 1 0 1 1 ...
output:
? flip ? left ? left ? left ? flip ? left ? left ? left ? flip ? left ? flip ? left ? left ? flip ? left ? flip ? left ? left ? flip ? left ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? flip ? left ? left ? left ? left ? left ? left ? left ? flip ? left ? flip ? left...
result:
ok Queries used; 7199.
Test #19:
score: -100
Wrong Answer
time: 26ms
memory: 3544kb
input:
1 0 1 1 0 1 1 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 1 0 1 1 0 0 1 0 0 1 1 0 0 0 1 0 1 1 1 1 0 1 0 1 0 0 1 0 0 1 1 1 0 1 1 0 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 1 0 0 1 1 1 0 1 1 0 1 1 0 0 0 0 1 1 0 1 1 0 0 1 1 0 1 1 0 1 1 0 0 1 0 0 1 1 0 0 1 0 0 1 1 1 1 0 1 0 1 0 0 1 0 0 1 1 1 0 1 0 0 1 1 1 0 1 0 1 0 ...
output:
? flip ? left ? left ? flip ? left ? left ? left ? left ? left ? left ? left ? left ? left ? flip ? left ? left ? flip ? left ? left ? flip ? left ? left ? flip ? left ? left ? left ? left ? flip ? left ? left ? flip ? left ? left ? left ? left ? left ? flip ? left ? left ? left ? left ? flip ? left...
result:
wrong answer Wrong answer: incorrect guess 2160 (ans: 4824). Queries used: 3056