QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#428651#7804. Intersegment ActivationJooDdaeWA 1ms3668kbC++20794b2024-06-01 20:49:442024-06-01 20:49:44

Judging History

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

  • [2024-06-01 20:49:44]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3668kb
  • [2024-06-01 20:49:44]
  • 提交

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);
    }
}

Details

Tip: Click on the bar to expand more detailed information

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