QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#598318#9432. Permutationucup-team3924#AC ✓308ms3876kbC++202.7kb2024-09-28 21:17:332024-09-28 21:17:38

Judging History

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

  • [2024-09-28 21:17:38]
  • 评测
  • 测评结果:AC
  • 用时:308ms
  • 内存:3876kb
  • [2024-09-28 21:17:33]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
mt19937 rng(42);
vector<int> cor;
vector<int> BRR;
int ask(vector<int> &q){
    cout << "0 ";
    for(int i : q){
        cout << i << " ";
    }
    cout << endl;
    int ret = 0;
    cin >> ret;
    return ret;
}

void distribute(vector<int> &arr, vector<int> &brr, vector<int> &posl, vector<int> &posr){
    int l = brr.back();
    while(arr.size()){
        if(l){
            posr.push_back(arr.back());
        }
        else{
            posl.push_back(arr.back());
        }
        arr.pop_back();
        brr.pop_back();
    }
}

void rec(int L, int R, vector<int> &pos, int N){
    if(pos.size() == 1){
        cor[L] = pos[0];
        return;
    }
    vector<int> posl, posr;
    int mid = (L + R) / 2;
    vector<int> arr;
    vector<int> quest;
    for(int i : pos){
        if(arr.size() == 0){
            arr.push_back(i);
            quest.push_back(rng() % 2);
        }
        else if(arr.size() >= 1){
            int a = arr.back();
            arr.pop_back();
            int b = i;
            int ca = quest.back();
            quest.pop_back();
            int cb = ca ^ 1;
            fill(BRR.begin(), BRR.end(), a);
            if(cb){
                for(int j = mid; j < R; j ++){
                    BRR[j] = b;
                }
            }
            else{
                for(int j = L; j < mid; j ++){
                    BRR[j] = b;
                }
            }
            int ans = ask(BRR);
            if(ans == 0){
                swap(ca, cb);
            }
            arr.push_back(a);
            quest.push_back(ca);
            if(ans % 2 == 0){
                if(cb){
                    posr.push_back(b);
                }
                else{
                    posl.push_back(b);
                }
                distribute(arr, quest, posl, posr);
            }
            else{
                arr.push_back(b);
                quest.push_back(cb);
            }
        }
    }
    if(quest.size() && mid - L == posl.size() + arr.size()){
        quest.back() = 0;
        distribute(arr, quest, posl, posr);
    }
    else if(quest.size()){
        quest.back() = 1;
        distribute(arr, quest, posl, posr);
    }
    rec(L, mid, posl, N);
    rec(mid, R, posr, N);
}

void answer(){
    cout << 1 << " ";
    for(int i : cor){
        cout << i << " ";
    }
    cout << endl;
}

void solve(){
    int N;
    cin >> N;
    int L = 0, R = N;
    vector<int> pos(N);
    cor.assign(N, -1);
    BRR.assign(N, 1);
    iota(pos.begin(), pos.end(), 1);
    rec(L, R, pos, N);
    answer();
}

int main() {
    solve();
    return 0;
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3560kb

input:

5
1
2
0
2
2
0

output:

0 1 1 2 2 2 
0 3 3 2 2 2 
0 5 5 4 4 4 
0 3 4 3 3 3 
0 2 2 2 1 1 
0 1 1 1 5 1 
1 3 4 2 1 5 

result:

ok Accepted

Test #2:

score: 0
Accepted
time: 308ms
memory: 3608kb

input:

1000
2
2
0
1
2
0
1
0
2
1
1
1
1
1
0
1
1
1
2
1
1
2
0
1
1
2
1
1
1
0
0
1
0
2
0
2
1
0
0
0
1
2
1
1
1
2
1
0
1
1
1
1
2
1
1
0
2
1
1
1
1
2
0
0
1
0
0
2
1
1
1
2
1
1
0
1
0
0
2
1
1
1
1
2
1
1
1
0
1
0
1
1
2
1
0
2
1
1
1
0
2
1
1
2
1
1
2
0
0
1
0
2
2
0
2
1
1
1
2
1
1
1
1
1
0
1
0
1
1
0
0
1
0
2
1
2
2
1
2
1
1
2
2
0
0
1
2
1...

output:

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

result:

ok Accepted

Test #3:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

1

output:

1 1 

result:

ok Accepted

Test #4:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

2
0

output:

0 1 2 
1 2 1 

result:

ok Accepted

Test #5:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

3
1
2
2

output:

0 1 2 2 
0 3 2 2 
0 2 1 2 
1 3 1 2 

result:

ok Accepted

Test #6:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

4
1
2
2
2

output:

0 1 1 2 2 
0 3 3 2 2 
0 3 4 3 3 
0 2 2 2 1 
1 3 4 2 1 

result:

ok Accepted

Test #7:

score: 0
Accepted
time: 1ms
memory: 3592kb

input:

6
0
1
2
1
2
2
0
0

output:

0 1 1 1 2 2 2 
0 4 4 4 3 3 3 
0 4 4 4 5 5 5 
0 2 4 4 2 2 2 
0 3 4 4 4 4 4 
0 4 4 2 4 4 4 
0 1 1 1 5 1 1 
0 5 5 5 5 5 6 
1 3 4 2 1 6 5 

result:

ok Accepted

Test #8:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

7
0
0
1
2
0
2
2
2
2
2

output:

0 1 1 1 2 2 2 2 
0 4 4 4 3 3 3 3 
0 5 5 5 6 6 6 6 
0 7 7 7 6 6 6 6 
0 2 3 3 2 2 2 2 
0 2 7 2 2 2 2 2 
0 1 1 1 1 1 4 4 
0 6 6 6 6 6 5 5 
0 1 1 1 1 6 1 1 
0 4 4 4 4 4 5 4 
1 3 7 2 1 6 5 4 

result:

ok Accepted

Test #9:

score: 0
Accepted
time: 1ms
memory: 3820kb

input:

8
1
1
2
1
0
2
0
0
2
0
2
0
2

output:

0 1 1 1 1 2 2 2 2 
0 3 3 3 3 2 2 2 2 
0 3 3 3 3 4 4 4 4 
0 6 6 6 6 5 5 5 5 
0 6 6 6 6 7 7 7 7 
0 3 3 2 2 3 3 3 3 
0 1 1 7 7 1 1 1 1 
0 7 3 3 3 3 3 3 3 
0 2 2 2 1 2 2 2 2 
0 4 4 4 4 4 4 6 6 
0 5 5 5 5 5 5 8 8 
0 6 6 6 6 5 6 6 6 
0 4 4 4 4 4 4 4 8 
1 3 7 2 1 6 5 4 8 

result:

ok Accepted

Test #10:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

9
1
1
2
1
0
1
2
0
0
2
1
2
2
2
0
0

output:

0 1 1 1 1 2 2 2 2 2 
0 3 3 3 3 2 2 2 2 2 
0 3 3 3 3 4 4 4 4 4 
0 6 6 6 6 5 5 5 5 5 
0 6 6 6 6 7 7 7 7 7 
0 8 8 8 8 9 9 9 9 9 
0 3 3 2 2 3 3 3 3 3 
0 1 1 7 7 1 1 1 1 1 
0 7 3 3 3 3 3 3 3 3 
0 2 2 2 1 2 2 2 2 2 
0 4 4 4 4 4 4 6 6 6 
0 6 6 6 6 5 5 6 6 6 
0 9 9 9 9 9 9 8 8 8 
0 5 5 5 5 9 5 5 5 5 
0 6 6 ...

result:

ok Accepted

Test #11:

score: 0
Accepted
time: 1ms
memory: 3612kb

input:

10
2
0
1
2
0
2
2
2
1
0
0
0
0
2
1
2
0

output:

0 1 1 1 1 1 2 2 2 2 2 
0 4 4 4 4 4 3 3 3 3 3 
0 5 5 5 5 5 6 6 6 6 6 
0 7 7 7 7 7 6 6 6 6 6 
0 8 8 8 8 8 9 9 9 9 9 
0 3 3 1 1 1 1 1 1 1 1 
0 7 7 9 9 9 7 7 7 7 7 
0 3 7 3 3 3 3 3 3 3 3 
0 1 1 9 1 1 1 1 1 1 1 
0 9 9 9 10 10 9 9 9 9 9 
0 9 9 9 9 1 9 9 9 9 9 
0 2 2 2 2 2 2 2 4 4 4 
0 6 6 6 6 6 6 6 5 5 5 ...

result:

ok Accepted

Test #12:

score: 0
Accepted
time: 1ms
memory: 3856kb

input:

11
2
0
1
2
0
2
2
2
2
1
0
0
0
0
0
2
0
2
2

output:

0 1 1 1 1 1 2 2 2 2 2 2 
0 4 4 4 4 4 3 3 3 3 3 3 
0 5 5 5 5 5 6 6 6 6 6 6 
0 7 7 7 7 7 6 6 6 6 6 6 
0 8 8 8 8 8 9 9 9 9 9 9 
0 10 10 10 10 10 11 11 11 11 11 11 
0 3 3 1 1 1 1 1 1 1 1 1 
0 7 7 9 9 9 7 7 7 7 7 7 
0 3 7 3 3 3 3 3 3 3 3 3 
0 1 1 9 1 1 1 1 1 1 1 1 
0 9 9 9 10 10 9 9 9 9 9 9 
0 9 9 9 9 1 ...

result:

ok Accepted

Test #13:

score: 0
Accepted
time: 1ms
memory: 3612kb

input:

12
2
0
2
2
1
0
0
0
2
0
2
2
2
0
1
0
0
0
2
0

output:

0 1 1 1 1 1 1 2 2 2 2 2 2 
0 4 4 4 4 4 4 3 3 3 3 3 3 
0 5 5 5 5 5 5 6 6 6 6 6 6 
0 7 7 7 7 7 7 8 8 8 8 8 8 
0 9 9 9 9 9 9 10 10 10 10 10 10 
0 11 11 11 11 11 11 10 10 10 10 10 10 
0 1 1 1 3 3 3 1 1 1 1 1 1 
0 5 5 5 7 7 7 5 5 5 5 5 5 
0 10 10 10 9 9 9 10 10 10 10 10 10 
0 7 3 3 3 3 3 3 3 3 3 3 3 
0 7...

result:

ok Accepted

Test #14:

score: 0
Accepted
time: 1ms
memory: 3852kb

input:

13
2
1
0
0
0
2
2
1
2
0
1
0
0
0
0
2
1
1
0
0
2
1
2
2
0

output:

0 1 1 1 1 1 1 2 2 2 2 2 2 2 
0 4 4 4 4 4 4 3 3 3 3 3 3 3 
0 4 4 4 4 4 4 5 5 5 5 5 5 5 
0 6 6 6 6 6 6 7 7 7 7 7 7 7 
0 8 8 8 8 8 8 9 9 9 9 9 9 9 
0 10 10 10 10 10 10 11 11 11 11 11 11 11 
0 13 13 13 13 13 13 12 12 12 12 12 12 12 
0 1 1 1 5 5 5 1 1 1 1 1 1 1 
0 7 7 7 5 5 5 5 5 5 5 5 5 5 
0 9 9 9 10 10...

result:

ok Accepted

Test #15:

score: 0
Accepted
time: 1ms
memory: 3620kb

input:

14
2
2
1
2
0
2
2
1
2
0
0
1
2
0
0
2
0
0
0
1
1
2
0
0
2
2
0
0

output:

0 1 1 1 1 1 1 1 2 2 2 2 2 2 2 
0 4 4 4 4 4 4 4 3 3 3 3 3 3 3 
0 5 5 5 5 5 5 5 6 6 6 6 6 6 6 
0 7 7 7 7 7 7 7 6 6 6 6 6 6 6 
0 8 8 8 8 8 8 8 9 9 9 9 9 9 9 
0 10 10 10 10 10 10 10 11 11 11 11 11 11 11 
0 13 13 13 13 13 13 13 12 12 12 12 12 12 12 
0 1 1 1 4 4 4 4 1 1 1 1 1 1 1 
0 7 7 7 4 4 4 4 4 4 4 4 ...

result:

ok Accepted

Test #16:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

15
2
2
1
2
0
2
2
0
1
2
0
0
1
2
0
0
2
0
0
0
1
0
1
2
1
2
0
2
0
0
2
0

output:

0 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 
0 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 
0 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 
0 7 7 7 7 7 7 7 6 6 6 6 6 6 6 6 
0 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 
0 10 10 10 10 10 10 10 11 11 11 11 11 11 11 11 
0 13 13 13 13 13 13 13 12 12 12 12 12 12 12 12 
0 14 14 14 14 14 14 14 15 15 15 15 15 1...

result:

ok Accepted

Test #17:

score: 0
Accepted
time: 270ms
memory: 3632kb

input:

975
2
2
0
1
2
0
1
0
2
1
1
1
1
1
0
1
1
1
2
1
1
2
0
1
1
2
1
1
1
0
0
1
0
2
0
2
1
0
0
0
1
2
1
1
1
2
1
0
1
1
1
1
2
1
1
0
2
1
1
1
1
2
0
0
1
0
1
1
0
1
1
1
2
1
1
0
1
2
2
0
1
1
1
1
2
1
1
1
0
1
0
1
1
2
1
2
2
1
1
1
0
2
2
2
2
0
0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 1 1 1 1 1 1 1 ...

result:

ok Accepted

Test #19:

score: 0
Accepted
time: 273ms
memory: 3672kb

input:

977
2
2
0
1
2
0
1
0
2
1
1
1
1
1
0
1
1
1
2
1
1
2
0
1
1
2
1
1
1
0
0
1
0
2
0
2
1
0
0
0
1
2
1
1
1
2
1
0
1
1
1
1
2
1
1
0
2
1
1
1
1
2
0
0
1
0
0
2
1
1
1
2
1
1
0
1
0
0
2
1
1
1
1
2
1
1
1
0
1
0
1
1
2
1
0
2
1
1
1
0
2
1
1
2
2
0
0
2
1
2
0
0
2
0
1
1
1
2
1
1
1
1
1
2
1
0
1
1
0
0
1
0
2
1
2
2
1
0
1
1
2
0
2
0
1
2
1
2
...

output:

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

result:

ok Accepted

Test #20:

score: 0
Accepted
time: 264ms
memory: 3636kb

input:

978
2
2
0
1
2
0
1
0
2
1
1
1
1
1
0
1
1
1
2
1
1
2
0
1
1
2
1
1
1
0
0
1
0
2
0
2
1
0
0
0
1
2
1
1
1
2
1
0
1
1
1
1
2
1
1
0
2
1
1
1
1
2
0
0
1
0
0
2
1
1
1
2
1
1
0
1
0
0
2
1
1
1
1
2
1
1
1
0
1
0
1
1
2
1
0
2
1
1
1
0
2
1
1
2
2
0
0
2
1
2
0
0
2
0
1
1
1
2
1
1
1
1
1
2
1
0
1
1
0
0
1
0
2
1
2
2
1
0
1
1
2
0
2
0
1
2
1
2
...

output:

0 1 1 1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1 1 1 1 ...

result:

ok Accepted

Test #30:

score: 0
Accepted
time: 287ms
memory: 3796kb

input:

988
2
2
0
1
2
0
1
0
2
1
1
1
1
1
0
1
1
1
2
1
1
2
0
1
1
2
1
1
1
0
0
1
0
2
0
2
1
0
0
0
1
2
1
1
1
2
1
0
1
1
1
1
2
1
1
0
2
1
1
1
1
2
0
0
1
0
0
2
1
1
1
2
1
1
0
1
0
0
2
1
1
1
1
2
1
1
1
0
1
0
1
1
2
1
0
2
1
1
1
0
2
1
1
2
2
0
0
2
1
2
0
0
2
0
1
1
1
2
1
1
1
1
1
2
1
0
1
1
0
0
1
0
2
1
2
2
1
0
1
1
2
0
2
0
1
2
1
2
...

output:

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

result:

ok Accepted

Test #31:

score: 0
Accepted
time: 285ms
memory: 3492kb

input:

989
2
2
0
1
2
0
1
0
2
1
1
1
1
1
0
1
1
1
2
1
1
2
0
1
1
2
1
1
1
0
0
1
0
2
0
2
1
0
0
0
1
2
1
1
1
2
1
0
1
1
1
1
2
1
1
0
2
1
1
1
1
2
0
0
1
0
0
2
1
1
1
2
1
1
0
1
0
0
2
1
1
1
1
2
1
1
1
0
1
0
1
1
2
1
0
2
1
1
1
0
2
1
1
2
2
0
0
2
1
2
0
0
2
0
1
1
1
2
1
1
1
1
1
2
1
0
1
1
0
0
1
0
2
1
2
2
1
0
1
1
2
0
2
0
1
2
1
2
...

output:

0 1 1 1 1 1 1 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