QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#106181 | #6394. Turn on the Light | Sylvia# | WA | 3ms | 3360kb | C++11 | 243b | 2023-05-16 20:06:03 | 2023-05-16 20:06:04 |
Judging History
answer
#include<iostream>
using namespace std;
int n;
int x;
int main() {
cin >> n;
for(int i = 1; i <= n; i++) {
cout << "? " << i << endl;
cout.flush();
cin >> x;
if(x != i) {
cout << "! " << i;
}
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 3240kb
input:
3 1 2 2
output:
? 1 ? 2 ? 3 ! 3
result:
ok Correct position at 3
Test #2:
score: -100
Wrong Answer
time: 3ms
memory: 3360kb
input:
10 1 2 3 4 5 6 7 8 8
output:
? 1 ? 2 ? 3 ? 4 ? 5 ? 6 ? 7 ? 8 ? 9 ! 9? 10
result:
wrong answer format Expected integer, but "9?" found