QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#403428#5156. Going in Circlesucup-team1716WA 6ms3644kbC++14712b2024-05-02 12:36:362024-05-02 12:36:36

Judging History

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

  • [2024-05-02 12:36:36]
  • 评测
  • 测评结果:WA
  • 用时:6ms
  • 内存:3644kb
  • [2024-05-02 12:36:36]
  • 提交

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) {
			if (check(i - L + 1, i)) {
				cout << "! " << i - L << endl;
				return 0;
			}
		}
		
		if (rd[i] != s[(i - 1) % L + 1]) {
			cout << "? flip" << endl;
		}
		cout << "? right" << endl;
	}
	
	return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 6ms
memory: 3644kb

input:

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

output:

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

result:

wrong answer Wrong answer: used too many queries. Queries used: 26001 (10501 too many, terminated)