QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#403436#5156. Going in Circlesucup-team1716WA 10ms3640kbC++14710b2024-05-02 13:00:182024-05-02 13:00:19

Judging History

你现在查看的是最新测评结果

  • [2024-05-02 13:00:19]
  • 评测
  • 测评结果:WA
  • 用时:10ms
  • 内存:3640kb
  • [2024-05-02 13:00:18]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

typedef unsigned long long ull;

const int L = 25;

bool s[L + 5];
bool rd[20005];

bool check(int l, int r) {
	assert(r - l + 1 == L);
	for (int i = l; i <= r; ++i) {
		if (rd[i] != s[i - l + 1]) {
			return false;
		}
	}
	return true;
}

int main() {
	srand((ull)time(0) ^ (ull)(new char));
	
	for (int i = 1; i <= L; ++i) {
		s[i] = rand() % 2;
	}
	
	for (int i = 1; ; ++i) {
		cin >> rd[i];
		if (i >= L + 3 && check(i - L + 1, i)) {
			cout << "! " << i - L << endl;
			return 0;
		}
		
		if (i <= L && rd[i] != s[(i - 1) % L + 1]) {
			cout << "? flip" << endl;
		}
		
		cout << "? right" << endl;
	}
	
	return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 10ms
memory: 3640kb

input:

0
1
1
0
0
0
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
1
0
1
1
0
1
0
1
1
0
1
1
0
1
0
0
1
1
0
1
0
1
0
1
0
0
1
0
0
0
0
0
0
0
1
1
0
1
0
1
0
1
0
1
0
0
1
0
1
0
1
1
1
1
1
0
0
1
0
1
1
1
1
1
1
1
0
1
0
1
0
1
0
1
0
0
1
0
0
0
0
0
0
0
1
1
0
1
0
1
0
1
0
1
0
0
1
0
1
0
1
1
1
1
1
0
0
1
0
1
1
1
1
1
1
1
0
1
0
1
0
1
0
1
0
0
...

output:

? flip
? right
? flip
? right
? right
? flip
? right
? right
? right
? right
? right
? flip
? right
? flip
? right
? flip
? right
? flip
? right
? right
? flip
? right
? flip
? right
? right
? flip
? right
? flip
? right
? flip
? right
? right
? flip
? right
? right
? flip
? right
? flip
? right
? f...

result:

wrong answer Wrong answer: incorrect guess 20016 (ans: 5000). Queries used: 20056