QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#489704#8812. Library 3bambam#21 45ms4064kbC++17487b2024-07-24 23:10:052024-07-24 23:10:05

Judging History

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

  • [2024-07-24 23:10:05]
  • 评测
  • 测评结果:21
  • 用时:45ms
  • 内存:4064kb
  • [2024-07-24 23:10:05]
  • 提交

answer

#include "library3.h"

#include <bits/stdc++.h>
using namespace std;

void solve(int n) {
    vector<int> p(n);
    iota(p.begin(), p.end(), 0);
    int cur = query(p);
    for (int i = 0; i < n; ++i) {
        for (int j = i + 1; j < n; ++j) {
            swap(p[i], p[j]);
            int nxt = query(p);
            if (nxt < cur) {
                cur = nxt;
            } else {
                swap(p[i], p[j]);
            }
        }
    }
    answer(p);
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 2
Accepted

Test #1:

score: 2
Accepted
time: 1ms
memory: 4048kb

input:

2
0
1

output:

? 0 1
? 1 0
! 0 1
-

result:

ok Accepted

Test #2:

score: 2
Accepted
time: 1ms
memory: 3768kb

input:

3
2
1
2
0

output:

? 0 1 2
? 1 0 2
? 2 0 1
? 1 2 0
! 1 2 0
-

result:

ok Accepted

Test #3:

score: 2
Accepted
time: 1ms
memory: 3768kb

input:

4
3
2
3
3
1
2
0

output:

? 0 1 2 3
? 1 0 2 3
? 2 0 1 3
? 3 0 2 1
? 1 2 0 3
? 1 3 0 2
? 1 2 3 0
! 1 2 3 0
-

result:

ok Accepted

Test #4:

score: 2
Accepted
time: 1ms
memory: 3792kb

input:

5
2
1
2
0
1
1
1
1
1
1
1

output:

? 0 1 2 3 4
? 1 0 2 3 4
? 2 0 1 3 4
? 3 0 2 1 4
? 4 0 2 1 3
? 3 2 0 1 4
? 3 1 2 0 4
? 3 4 2 1 0
? 3 0 1 2 4
? 3 0 4 1 2
? 3 0 2 4 1
! 3 0 2 1 4
-

result:

ok Accepted

Test #5:

score: 2
Accepted
time: 0ms
memory: 3792kb

input:

5
1
2
2
0
1
1
1
1
1
1
1

output:

? 0 1 2 3 4
? 1 0 2 3 4
? 2 1 0 3 4
? 3 1 2 0 4
? 4 1 2 0 3
? 3 2 1 0 4
? 3 0 2 1 4
? 3 4 2 0 1
? 3 1 0 2 4
? 3 1 4 0 2
? 3 1 2 4 0
! 3 1 2 0 4
-

result:

ok Accepted

Test #6:

score: 2
Accepted
time: 0ms
memory: 3760kb

input:

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

output:

? 0 1 2 3 4 5
? 1 0 2 3 4 5
? 2 0 1 3 4 5
? 3 0 2 1 4 5
? 4 0 2 3 1 5
? 5 0 2 3 4 1
? 1 2 0 3 4 5
? 1 3 2 0 4 5
? 1 4 2 3 0 5
? 1 5 2 3 0 4
? 1 4 3 2 0 5
? 1 4 0 2 3 5
? 1 4 5 2 0 3
? 1 4 5 0 2 3
? 1 4 5 3 0 2
? 1 4 5 2 3 0
! 1 4 5 2 0 3
-

result:

ok Accepted

Test #7:

score: 2
Accepted
time: 0ms
memory: 4052kb

input:

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

output:

? 0 1 2 3 4 5
? 1 0 2 3 4 5
? 2 1 0 3 4 5
? 3 1 0 2 4 5
? 4 1 0 2 3 5
? 5 1 0 2 4 3
? 3 0 1 2 4 5
? 3 2 0 1 4 5
? 3 4 0 2 1 5
? 3 5 0 2 1 4
? 3 4 2 0 1 5
? 3 4 1 2 0 5
? 3 4 5 2 1 0
? 3 4 0 1 2 5
? 3 4 0 5 1 2
? 3 4 0 2 5 1
! 3 4 0 2 1 5
-

result:

ok Accepted

Test #8:

score: 2
Accepted
time: 0ms
memory: 4048kb

input:

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

output:

? 0 1 2 3 4 5
? 1 0 2 3 4 5
? 2 1 0 3 4 5
? 3 1 0 2 4 5
? 4 1 0 3 2 5
? 5 1 0 3 2 4
? 4 0 1 3 2 5
? 4 3 0 1 2 5
? 4 2 0 3 1 5
? 4 5 0 3 2 1
? 4 1 3 0 2 5
? 4 1 2 3 0 5
? 4 1 5 3 2 0
? 4 1 5 2 3 0
? 4 1 5 0 2 3
? 4 1 5 3 0 2
! 4 1 5 3 2 0
-

result:

ok Accepted

Test #9:

score: 2
Accepted
time: 1ms
memory: 4064kb

input:

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

output:

? 0 1 2 3 4
? 1 0 2 3 4
? 2 0 1 3 4
? 3 0 1 2 4
? 4 0 1 3 2
? 4 1 0 3 2
? 4 3 1 0 2
? 4 2 1 3 0
? 4 0 3 1 2
? 4 0 2 1 3
? 4 0 3 2 1
! 4 0 3 1 2
-

result:

ok Accepted

Test #10:

score: 2
Accepted
time: 1ms
memory: 3764kb

input:

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

output:

? 0 1 2 3 4 5
? 1 0 2 3 4 5
? 2 0 1 3 4 5
? 3 0 2 1 4 5
? 4 0 2 3 1 5
? 5 0 2 3 4 1
? 1 2 0 3 4 5
? 1 3 0 2 4 5
? 1 4 0 2 3 5
? 1 5 0 2 4 3
? 1 3 2 0 4 5
? 1 3 4 2 0 5
? 1 3 5 2 4 0
? 1 3 0 4 2 5
? 1 3 0 5 2 4
? 1 3 0 5 4 2
! 1 3 0 5 2 4
-

result:

ok Accepted

Subtask #2:

score: 19
Accepted

Dependency #1:

100%
Accepted

Test #11:

score: 19
Accepted
time: 0ms
memory: 3860kb

input:

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

output:

? 0 1 2 3 4 5 6
? 1 0 2 3 4 5 6
? 2 0 1 3 4 5 6
? 3 0 1 2 4 5 6
? 4 0 1 3 2 5 6
? 5 0 1 3 4 2 6
? 6 0 1 3 4 5 2
? 2 1 0 3 4 5 6
? 2 3 1 0 4 5 6
? 2 4 1 3 0 5 6
? 2 5 1 3 4 0 6
? 2 6 1 3 4 5 0
? 2 0 3 1 4 5 6
? 2 0 4 3 1 5 6
? 2 0 5 3 1 4 6
? 2 0 6 3 1 5 4
? 2 0 4 1 3 5 6
? 2 0 4 5 1 3 6
? 2 0 4 6 1 ...

result:

ok Accepted

Test #12:

score: 19
Accepted
time: 8ms
memory: 3852kb

input:

50
49
48
49
49
49
49
49
49
49
49
49
49
49
49
49
49
47
48
48
48
48
48
48
48
46
47
47
47
47
47
47
47
47
47
47
47
47
47
47
47
47
47
47
47
47
47
47
47
47
47
45
44
45
43
44
42
41
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
42
...

output:

? 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
? 1 0 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
? 2 0 1 3 4 5 6 ...

result:

ok Accepted

Test #13:

score: 19
Accepted
time: 19ms
memory: 4012kb

input:

98
91
92
92
92
90
91
89
90
90
90
90
90
90
90
88
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
...

output:

? 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
? 1 0 2 3 4 5 ...

result:

ok Accepted

Test #14:

score: 19
Accepted
time: 26ms
memory: 3768kb

input:

98
97
96
95
96
96
96
96
96
96
96
96
96
94
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
...

output:

? 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
? 1 0 2 3 4 5 ...

result:

ok Accepted

Test #15:

score: 19
Accepted
time: 16ms
memory: 3764kb

input:

99
90
91
89
90
90
90
90
90
90
90
90
90
90
90
90
90
90
90
88
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
...

output:

? 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
? 1 0 2 3 4...

result:

ok Accepted

Test #16:

score: 19
Accepted
time: 37ms
memory: 3768kb

input:

99
94
95
95
95
95
95
95
95
93
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
...

output:

? 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
? 1 0 2 3 4...

result:

ok Accepted

Test #17:

score: 19
Accepted
time: 30ms
memory: 3788kb

input:

99
96
97
95
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
94
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
...

output:

? 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
? 1 0 2 3 4...

result:

ok Accepted

Test #18:

score: 19
Accepted
time: 45ms
memory: 3864kb

input:

100
94
93
94
92
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
91
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92...

output:

? 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
? 1 0 2 ...

result:

ok Accepted

Test #19:

score: 19
Accepted
time: 32ms
memory: 4060kb

input:

100
96
95
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
96
94
95
95
95
95
95
95
95
95
95
95
95
95
95
95
95
93
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94...

output:

? 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
? 1 0 2 ...

result:

ok Accepted

Test #20:

score: 19
Accepted
time: 27ms
memory: 3844kb

input:

100
95
94
95
95
95
95
95
95
95
95
93
94
94
94
94
94
94
94
94
94
94
94
94
94
92
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
91
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
92
90
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91
91...

output:

? 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
? 1 0 2 ...

result:

ok Accepted

Test #21:

score: 19
Accepted
time: 28ms
memory: 3844kb

input:

100
91
92
92
92
90
91
91
91
91
91
91
91
91
89
88
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89
89...

output:

? 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
? 1 0 2 ...

result:

ok Accepted

Test #22:

score: 19
Accepted
time: 19ms
memory: 3772kb

input:

99
98
97
96
95
96
96
96
96
94
93
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
...

output:

? 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
? 1 0 2 3 4...

result:

ok Accepted

Test #23:

score: 19
Accepted
time: 33ms
memory: 3860kb

input:

100
99
98
97
96
95
96
94
95
93
94
94
94
94
94
94
94
92
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93...

output:

? 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
? 1 0 2 ...

result:

ok Accepted

Test #24:

score: 19
Accepted
time: 36ms
memory: 3784kb

input:

100
99
98
97
96
97
95
96
96
94
95
95
93
94
94
94
94
94
94
94
94
94
94
94
94
94
94
94
92
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
93
91
92
92
92
92
92
92
92
92
92
92
92
92
92
92...

output:

? 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
? 1 0 2 ...

result:

ok Accepted

Subtask #3:

score: 0
Time Limit Exceeded

Dependency #2:

100%
Accepted

Test #25:

score: 0
Time Limit Exceeded

input:

498
493
492
493
493
493
493
493
493
491
492
492
492
492
492
492
490
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
491
...

output:

? 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result: