QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#428651 | #7804. Intersegment Activation | JooDdae | WA | 1ms | 3668kb | C++20 | 794b | 2024-06-01 20:49:44 | 2024-06-01 20:49:44 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n, k;
vector<int> v;
void find(int u) {
if(u == 0) {
v.push_back(0);
return;
}
find(u-1);
v.push_back(u);
find(u-1);
}
int query(int i, int j) {
cout << i << " " << j << endl;
int re; cin >> re;
if(re == n) exit(0);
return re;
}
int main() {
find(9);
cin.tie(0)->sync_with_stdio(0);
cin >> n >> k;
for(int i=1;i<=n;i++) {
int mx = k, mxb = 0, b = 0;
for(int j=0;j<(1<<n-i+1)-1;j++) {
auto re = query(i, i+v[j]);
b ^= 1 << v[j];
if(re > mx) mx = re, mxb = b;
}
for(int j=0;j<n-i+1;j++) if(!(mxb & (1 << j))) k = query(i, i+j);
}
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3668kb
input:
3 0 0 0 1 0 0 0 0 0 0 0 1 1 0 1
output:
1 1 1 2 1 1 1 3 1 1 1 2 1 1 1 1 1 3 2 2 2 3 2 2 3 3 3 3
result:
wrong answer format Unexpected end of file - int32 expected