QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#133873 | #5156. Going in Circles | BUET_TEAM_ONE# | WA | 37ms | 3724kb | C++20 | 2.5kb | 2023-08-02 16:16:13 | 2023-08-02 16:16:17 |
Judging History
answer
#include <bits/stdc++.h>
typedef long long int ll;
#define pb push_back
#define mp make_pair
#define pll pair<ll,ll>
#define fill(x, y) memset(x, y, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define debug(x) { cerr << #x << " = " << x << endl; }
#define IO { ios_base::sync_with_stdio(false); cin.tie(0); }
#define read(x) freopen(x, "r", stdin)
#define write(x) freopen(x, "w", stdout)
using namespace std;
mt19937 mt(time(nullptr));
void left() {
cout << "? left" << endl;
}
void right() {
cout << "? right" << endl;
}
void flip() {
cout << "? flip" << endl;
}
const int N = 64;
bitset<N> org;
bitset<N> cur_seq;
void solve() {
int cur;
cin >> cur;
bool flag = true;
for (int i=0; i<N; i++) {
right();
cin >> cur;
if (cur != 0) {
flip();
cin >> cur;
}
}
for (int i=0; i<N; i++) {
right();
cin >> cur;
if (cur != 1) {
flip();
cin >> cur;
}
}
bool allOne = true;
for (int i=0; i<2*N; i++) {
left();
cin >> cur;
if (cur != 1) allOne = false;
}
if (allOne) {
// length <= N
flip();
cin >> cur;
int i = 1;
while(1) {
right();
cin >> cur;
if (cur == 0) break;
i++;
}
cout <<"! "<< i<< endl;
} else {
// length > N
for(int i=0;i<N;i++){
org[i]=mt()%2;
}
//cout << org.to_string() << endl;
for(int i=0; i<N; i++) {
right();
cin >> cur;
//cout << cur << " " << org[i] << " " << (cur == org[i]) << endl;
if (cur != org[i]) {
flip();
cin >> cur;
}
}
cur_seq = org;
int idx = 1;
int cnt = 15600;
while(cnt--) {
right();
cin >> cur;
cur_seq <<= 1;
cur_seq |= cur;
//cout << " -> " << cur_seq.to_string() << endl;
if ( (cur_seq ^ org).count() == 0 ) break;
idx++;
}
cout <<"! "<< idx << endl;
}
}
int main() {
//cout << fixed << setprecision(10);
solve();
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 37ms
memory: 3724kb
input:
0 1 0 0 0 1 0 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 1 0 1 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 1 0 1 0 1 0 1 0 0 0 1 0 1 1 1 1 1 1 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 0 1 1 0 1 ...
output:
? right ? flip ? right ? right ? right ? flip ? right ? right ? flip ? right ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? right ? right ? flip ? right ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? right ? flip ? ri...
result:
wrong answer Wrong answer: incorrect guess 15601 (ans: 5000). Queries used: 16012