QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#496875#4218. Hidden GraphhazeWA 23ms5864kbC++205.2kb2024-07-28 16:40:342024-07-28 16:40:36

Judging History

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

  • [2024-07-28 16:40:36]
  • 评测
  • 测评结果:WA
  • 用时:23ms
  • 内存:5864kb
  • [2024-07-28 16:40:34]
  • 提交

answer

/*

Author: Haze

2024/7/28

*/

#include <bits/stdc++.h>

#define irep(i, l, r) for(int i = (l); i <= (r); ++ i)
#define drep(i, r, l) for(int i = (r); i >= (l); -- i)
#define IOS ios::sync_with_stdio(false), cin.tie(nullptr);
using namespace std;
typedef long long ll;

inline ll readL() {
    ll s = 0;
    bool fl = false;
    char ch = (char) getchar();
    while (!isdigit(ch)) {
        if (ch == '-')fl = true;
        ch = (char) getchar();
    }
    while (isdigit(ch)) {
        s = s * 10 + (ch ^ 48);
        ch = (char) getchar();
    }
    return fl ? -s : s;
}

inline int read() {
    return (int) (readL());
}

const int mod = 1000000000 + 7;
const int itinf = 1000000999;
const ll llinf = 2e18;
const int N = 500099;
int F[N], G[N];
std::mt19937 rng(std::chrono::system_clock::now().time_since_epoch().count());

array<int, 2> query(vector<int>&node){
    if(node.size() == 1){
        return {-1, -1};
    }
    cout << "? " << node.size();
    for(int x : node){
        cout << " " << F[x];
    }
    cout << endl;
    array<int, 2>ar{};
    cin >> ar[0] >> ar[1];
    if(ar[0] != -1)ar[0] = G[ar[0]], ar[1] = G[ar[1]];
    return ar;
}

void solve() {
    int n;
    cin >> n;
    irep(i, 1, n)F[i] = i, G[i] = i;
    shuffle(F + 1, F + n + 1, rng);
    irep(i, 1, n){
        G[F[i]] = i;
    }
    vector<vector<int>>col = {{1}};
    vector<array<int, 2>>edge;
    irep(u, 2, n){
        int to = -1;
        irep(c, 0, col.size() - 1){
            auto vec = col[c];
            vec.push_back(u);
            auto [i, j] = query(vec);
            if(i == -1){
                if(to == -1 or col[to].size() > col[c].size()){
                    to = c;
                }
            }

            while(i != -1){
                edge.push_back({i, j});

                vec.erase(find(vec.begin(), vec.end(), i + j - u));
                auto T = query(vec);
                i = T[0], j = T[1];
            }
        }
        if(to == -1){
            col.push_back({u});
        }
        else col[to].push_back(u);
    }
    cout << "! " << edge.size() << endl;
    for(auto [u, v] : edge){
        cout << F[u] << ' ' << F[v] << endl;
    }
}

int main() {
    // IOS
    int T = 1;
    while (T--) {
        solve();
    }
    return 0;
}
///*
//
//Author: Haze
//
//2024/7/28
//
//*/
//
//#include <bits/stdc++.h>
//
//#define irep(i, l, r) for(int i = (l); i <= (r); ++ i)
//#define drep(i, r, l) for(int i = (r); i >= (l); -- i)
//#define IOS ios::sync_with_stdio(false), cin.tie(nullptr);
//using namespace std;
//typedef long long ll;
//
//inline ll readL() {
//    ll s = 0;
//    bool fl = false;
//    char ch = (char) getchar();
//    while (!isdigit(ch)) {
//        if (ch == '-')fl = true;
//        ch = (char) getchar();
//    }
//    while (isdigit(ch)) {
//        s = s * 10 + (ch ^ 48);
//        ch = (char) getchar();
//    }
//    return fl ? -s : s;
//}
//
//inline int read() {
//    return (int) (readL());
//}
//
//const int mod = 1000000000 + 7;
//const int itinf = 1000000999;
//const ll llinf = 2e18;
//const int N = 500099;
//
//int G[2000][2000];
//int n, sum;
//array<int, 2> query(vector<int>&node) {
//    if (node.size() == 1) {
//        return {-1, -1};
//    }
//    ++ sum;
//    cout << "? " << node.size();
//    for(int x : node){
//        cout << " " << x;
//    }
//    cout << endl;
//    for(int u : node){
//        for(int v : node){
//            if(G[u][v]){
//                return {v, u};
//            }
//        }
//    }
//    return {-1, -1};
//}
//array<int, 2> query0(vector<int>&node){
//    if(node.size() == 1){
//        return {-1, -1};
//    }
//    cout << "? " << node.size();
//    for(int x : node){
//        cout << " " << x;
//    }
//    cout << endl;
//    array<int, 2>ar{};
//    cin >> ar[0] >> ar[1];
//    return ar;
//}
//
//void init(){
//    vector<int>a(n);
//    irep(i, 1, n)a[i - 1] = i;
//    srand(192);
//    random_shuffle(a.begin(), a.end());
//    irep(i, 1, n - 1){
//        G[a[i]][a[i - 1]] = 1;
//        G[a[i - 1]][a[i]] = 1;
//    }
////    G[n][1] = G[1][n] = 1;
//}
//
//void solve() {
//
//    vector<vector<int>>col = {{1}};
//    vector<array<int, 2>>edge;
//    irep(u, 2, n){
//        int to = -1;
//        cerr << col.size() << endl;
//        irep(c, 0, col.size() - 1){
//            auto vec = col[c];
//            vec.push_back(u);
//            auto [i, j] = query(vec);
//            if(i == -1)to = c;
//
//            while(i != -1){
//                edge.push_back({i, j});
//
//                vec.erase(find(vec.begin(), vec.end(), i + j - u));
//                auto T = query(vec);
//                i = T[0], j = T[1];
//            }
//        }
//        if(to == -1){
//            col.push_back({u});
//        }
//        else col[to].push_back(u);
//    }
//    cout << "! " << edge.size() << endl;
//    for(auto [u, v] : edge){
//        cout << u << ' ' << v << endl;
//    }
//}
//
//int main() {
//    // IOS
//    int T = 1;
//    cin >> n;
//    init();
//    while (T--) {
//        solve();
//    }
//    cerr << sum;
//    return 0;
//}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 5704kb

input:

3
1 2
2 3
1 3

output:

? 2 2 1
? 2 2 3
? 2 1 3
! 3
1 2
2 3
1 3

result:

ok correct

Test #2:

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

input:

10
-1 -1
-1 -1
-1 -1
1 2
2 6
-1 -1
-1 -1
-1 -1
1 4
-1 -1
4 8
-1 -1
-1 -1
2 5
-1 -1
4 5
-1 -1
-1 -1
4 10
3 7
1 3
3 9
-1 -1
3 10
3 8
-1 -1
-1 -1

output:

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

result:

ok correct

Test #3:

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

input:

5
-1 -1
-1 -1
4 2
5 2
3 2
4 1
5 1
3 1
2 1

output:

? 2 3 4
? 3 3 4 5
? 4 3 4 5 2
? 3 3 5 2
? 2 3 2
? 4 3 4 5 1
? 3 3 5 1
? 2 3 1
? 2 2 1
! 7
4 2
5 2
3 2
4 1
5 1
3 1
2 1

result:

ok correct

Test #4:

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

input:

3
2 1
1 3
-1 -1

output:

? 2 1 2
? 2 1 3
? 2 2 3
! 2
2 1
1 3

result:

ok correct

Test #5:

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

input:

6
3 5
3 2
2 5
3 4
4 5
4 2
3 1
-1 -1
1 2
-1 -1
3 6
-1 -1
-1 -1
-1 -1

output:

? 2 3 5
? 2 3 2
? 2 5 2
? 2 3 4
? 2 5 4
? 2 2 4
? 2 3 1
? 2 5 1
? 2 2 1
? 2 4 1
? 2 3 6
? 3 5 1 6
? 2 2 6
? 2 4 6
! 9
3 5
3 2
2 5
3 4
4 5
4 2
3 1
1 2
3 6

result:

ok correct

Test #6:

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

input:

27
2 26
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
21 2
-1 -1
-1 -1
-1 -1
26 13
-1 -1
10 16
10 13
-1 -1
10 15
-1 -1
-1 -1
-1 -1
-1 -1
24 13
-1 -1
21 24
-1 -1
14 24
24 10
2 27
-1 -1
27 11
21 27
-1 -1
-1 -1
24 27
-1 -1
12 11
-1 -1
14 12
-1 -1
-1 -1
8 13
-1 -1
21 8
-1 -1
10 8
14 8
-1 -1
24 8
-1 -1...

output:

? 2 2 26
? 2 2 9
? 2 26 9
? 3 2 9 15
? 2 26 15
? 3 2 9 16
? 3 26 15 16
? 4 2 9 16 11
? 3 26 15 11
? 4 2 9 16 21
? 3 9 16 21
? 4 26 15 11 21
? 4 2 9 16 13
? 5 26 15 11 21 13
? 4 15 11 21 13
? 5 2 9 16 13 10
? 4 2 9 13 10
? 3 2 9 10
? 5 26 15 11 21 10
? 4 26 11 21 10
? 5 2 9 16 13 14
? 5 26 15 11 21 1...

result:

ok correct

Test #7:

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

input:

47
43 36
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
43 21
-1 -1
-1 -1
-1 -1
-1 -1
43 2
-1 -1
-1 -1
-1 -1
28 36
21 28
-1 -1
-1 -1
31 36
-1 -1
-1 -1
44 47
-1 -1
-1 -1
6 36
-1 -1
-1 -1
21 42
-1 -1
6 37
31 37
-1 -1
-1 -1
22 43
22 6
22 42
-1 -1
22 21
22 36
-1 -1
10 28
10 42
-1 -1
10 21
-1 -1
22 10
43 19
19 42
-...

output:

? 2 43 36
? 2 43 30
? 2 36 30
? 3 43 30 47
? 2 36 47
? 3 43 30 8
? 3 36 47 8
? 4 43 30 8 21
? 3 30 8 21
? 3 36 47 21
? 4 43 30 8 16
? 4 36 47 21 16
? 5 43 30 8 16 2
? 4 30 8 16 2
? 4 36 47 21 2
? 5 43 30 8 16 28
? 5 36 47 21 2 28
? 4 47 21 2 28
? 3 47 2 28
? 6 43 30 8 16 28 31
? 5 36 47 21 2 31
? 4 ...

result:

ok correct

Test #8:

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

input:

38
-1 -1
-1 -1
7 27
2 7
-1 -1
26 27
-1 -1
-1 -1
2 25
-1 -1
-1 -1
16 27
-1 -1
16 25
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
26 19
-1 -1
19 32
16 19
-1 -1
11 28
-1 -1
28 7
-1 -1
28 33
-1 -1
-1 -1
-1 -1
33 22
-1 -1
28 22
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
33 9
-1 -1
28 9
-1 -1
-1 -1
-1 -1
-1 -...

output:

? 2 2 27
? 3 2 27 11
? 4 2 27 11 7
? 3 2 11 7
? 2 11 7
? 4 2 27 11 26
? 3 2 11 26
? 2 7 26
? 4 2 27 11 25
? 3 27 11 25
? 3 7 26 25
? 4 2 27 11 16
? 3 2 11 16
? 4 7 26 25 16
? 3 7 26 16
? 4 2 27 11 33
? 4 7 26 25 33
? 2 16 33
? 4 2 27 11 32
? 4 7 26 25 32
? 3 16 33 32
? 4 2 27 11 19
? 4 7 26 25 19
? ...

result:

ok correct

Test #9:

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

input:

25
-1 -1
20 22
-1 -1
-1 -1
-1 -1
25 24
-1 -1
-1 -1
-1 -1
22 21
-1 -1
-1 -1
2 22
2 25
-1 -1
6 24
6 21
20 6
-1 -1
6 25
6 22
-1 -1
-1 -1
4 25
4 22
-1 -1
6 4
24 15
-1 -1
-1 -1
-1 -1
2 9
20 9
9 4
-1 -1
-1 -1
-1 -1
10 21
-1 -1
-1 -1
10 15
-1 -1
4 17
-1 -1
10 17
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
18 21
18 2
18 ...

output:

? 2 24 20
? 3 24 20 22
? 2 24 22
? 3 24 20 19
? 2 22 19
? 3 24 20 25
? 2 20 25
? 3 22 19 25
? 3 24 20 21
? 4 22 19 25 21
? 3 19 25 21
? 4 24 20 21 2
? 4 22 19 25 2
? 3 19 25 2
? 2 19 2
? 5 24 20 21 2 6
? 4 20 21 2 6
? 3 20 2 6
? 2 2 6
? 4 22 19 25 6
? 3 22 19 6
? 2 19 6
? 5 24 20 21 2 4
? 4 22 19 25...

result:

ok correct

Test #10:

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

input:

6
-1 -1
2 5
-1 -1
-1 -1
5 6
2 3
-1 -1
-1 -1
-1 -1
-1 -1

output:

? 2 2 1
? 3 2 1 5
? 2 1 5
? 3 2 1 6
? 2 5 6
? 4 2 1 6 3
? 3 1 6 3
? 2 5 3
? 4 2 1 6 4
? 3 5 3 4
! 3
2 5
5 6
2 3

result:

ok correct

Test #11:

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

input:

3
3 1
2 3
2 1

output:

? 2 3 1
? 2 3 2
? 2 1 2
! 3
3 1
2 3
2 1

result:

ok correct

Test #12:

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

input:

3
3 1
2 1
-1 -1

output:

? 2 1 3
? 2 1 2
? 2 3 2
! 2
3 1
2 1

result:

ok correct

Test #13:

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

input:

5
3 1
5 1
-1 -1
2 1
2 5
2 3
-1 -1
-1 -1
-1 -1

output:

? 2 1 3
? 2 1 5
? 2 3 5
? 2 1 2
? 3 3 5 2
? 2 3 2
? 2 1 4
? 3 3 5 4
? 2 2 4
! 5
3 1
5 1
2 1
2 5
2 3

result:

ok correct

Test #14:

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

input:

3
2 1
-1 -1
-1 -1

output:

? 2 1 2
? 2 1 3
? 2 2 3
! 1
2 1

result:

ok correct

Test #15:

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

input:

5
-1 -1
3 5
-1 -1
-1 -1
2 5
4 3
-1 -1
-1 -1

output:

? 2 1 3
? 3 1 3 5
? 2 1 5
? 3 1 3 2
? 2 5 2
? 4 1 3 2 4
? 3 1 2 4
? 2 5 4
! 3
3 5
2 5
4 3

result:

ok correct

Test #16:

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

input:

93
-1 -1
-1 -1
-1 -1
-1 -1
87 22
-1 -1
81 16
6 16
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
15 12
81 15
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
82 15
-1 -1
43 22
-1 -1
-1 -1
75 9
81 75
75 22
-1 -1
-1 -1
-1 -1
-1 -1
73 22
-1 -1
-1 -1
55 22
-1 -1
55 43
-1 -1
-1 -1
69 16
43 69
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
34 9
-1 -1
...

output:

? 2 22 66
? 3 22 66 12
? 4 22 66 12 6
? 5 22 66 12 6 81
? 6 22 66 12 6 81 87
? 5 66 12 6 81 87
? 6 22 66 12 6 81 16
? 5 22 66 12 6 16
? 4 22 66 12 16
? 2 87 16
? 6 22 66 12 6 81 23
? 3 87 16 23
? 6 22 66 12 6 81 19
? 4 87 16 23 19
? 6 22 66 12 6 81 15
? 5 22 66 6 81 15
? 4 22 66 6 15
? 5 87 16 23 19...

result:

ok correct

Test #17:

score: 0
Accepted
time: 4ms
memory: 5864kb

input:

111
-1 -1
-1 -1
-1 -1
-1 -1
12 49
-1 -1
67 99
-1 -1
-1 -1
105 104
67 104
-1 -1
12 104
-1 -1
28 67
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
28 68
-1 -1
-1 -1
-1 -1
69 104
-1 -1
44 71
-1 -1
44 12
-1 -1
44 28
-1 -1
49 52
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
71 72
-1 -1
12 72
-1 ...

output:

? 2 49 67
? 3 49 67 105
? 4 49 67 105 59
? 5 49 67 105 59 71
? 6 49 67 105 59 71 12
? 5 67 105 59 71 12
? 6 49 67 105 59 71 99
? 5 49 105 59 71 99
? 2 12 99
? 6 49 67 105 59 71 104
? 5 49 67 59 71 104
? 4 49 59 71 104
? 3 12 99 104
? 2 99 104
? 6 49 67 105 59 71 28
? 5 49 105 59 71 28
? 3 12 99 28
?...

result:

ok correct

Test #18:

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

input:

132
-1 -1
-1 -1
-1 -1
24 71
24 36
24 41
-1 -1
114 41
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
120 130
-1 -1
-1 -1
-1 -1
131 41
-1 -1
-1 -1
36 86
-1 -1
75 86
-1 -1
17 130
17 36
-1 -1
120 17
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
129 36
-1 -1
-1 -1
129 86
-1 -1
-1 -1
114 110
-1 -1
-1 -1
57 11
91 1...

output:

? 2 71 36
? 3 71 36 91
? 4 71 36 91 41
? 5 71 36 91 41 24
? 4 36 91 41 24
? 3 91 41 24
? 2 91 24
? 5 71 36 91 41 114
? 4 71 36 91 114
? 2 24 114
? 5 71 36 91 41 75
? 3 24 114 75
? 5 71 36 91 41 120
? 4 24 114 75 120
? 5 71 36 91 41 57
? 5 24 114 75 120 57
? 6 71 36 91 41 57 130
? 5 24 114 75 120 130...

result:

ok correct

Test #19:

score: 0
Accepted
time: 6ms
memory: 5712kb

input:

94
15 90
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
47 5
-1 -1
-1 -1
-1 -1
-1 -1
6 91
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
15 16
-1 -1
6 32
-1 -1
-1 -1
-1 -1
-1 -1
67 16
67 5
67 29
-1 -1
67 32
67 47
-1 -1
-1 -1
47 66
-1 -1
-1 -1
87 68
-1 -1
-1 -1
68 66
-1 -1
-1 -1
17 68
17 47
-1 -1
-1 -1
57 90
-1 -1
5...

output:

? 2 90 15
? 2 90 6
? 2 15 6
? 3 90 6 76
? 2 15 76
? 3 90 6 5
? 3 15 76 5
? 4 90 6 5 77
? 3 15 76 77
? 4 90 6 5 47
? 3 90 6 47
? 4 15 76 77 47
? 4 90 6 5 29
? 5 15 76 77 47 29
? 5 90 6 5 29 91
? 4 90 5 29 91
? 5 15 76 77 47 91
? 5 90 6 5 29 23
? 6 15 76 77 47 91 23
? 6 90 6 5 29 23 16
? 6 15 76 77 47...

result:

ok correct

Test #20:

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

input:

73
-1 -1
-1 -1
-1 -1
-1 -1
16 14
10 16
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
20 14
62 20
-1 -1
-1 -1
53 10
-1 -1
53 20
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
38 14
-1 -1
38 5
-1 -1
53 38
-1 -1
-1 -1
16 70
70 5
-1 -1
-1 -1
-1 -1
-1 -1
34 16
-1 -1
-1 -1
-1 -1
62 7
-1 -1
5 7
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
53...

output:

? 2 2 35
? 3 2 35 62
? 4 2 35 62 14
? 5 2 35 62 14 10
? 6 2 35 62 14 10 16
? 5 2 35 62 10 16
? 4 2 35 62 16
? 6 2 35 62 14 10 24
? 2 16 24
? 6 2 35 62 14 10 5
? 3 16 24 5
? 6 2 35 62 14 10 20
? 5 2 35 62 10 20
? 4 2 35 10 20
? 4 16 24 5 20
? 6 2 35 62 14 10 53
? 5 2 35 62 14 53
? 5 16 24 5 20 53
? 4...

result:

ok correct

Test #21:

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

input:

77
-1 -1
-1 -1
-1 -1
33 32
-1 -1
52 63
-1 -1
-1 -1
8 69
8 63
-1 -1
52 8
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
28 32
-1 -1
-1 -1
63 4
-1 -1
52 4
-1 -1
-1 -1
-1 -1
-1 -1
4 27
-1 -1
-1 -1
-1 -1
8 13
13 28
-1 -1
-1 -1
-1 -1
8 45
-1 -1
59 33
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
59 65
32 65
-1 -1
-1 -1
63 20...

output:

? 2 63 69
? 3 63 69 33
? 4 63 69 33 70
? 5 63 69 33 70 32
? 4 63 69 70 32
? 5 63 69 33 70 52
? 4 69 33 70 52
? 2 32 52
? 5 63 69 33 70 8
? 4 63 33 70 8
? 3 33 70 8
? 3 32 52 8
? 2 32 8
? 5 63 69 33 70 76
? 3 32 52 76
? 2 8 76
? 5 63 69 33 70 28
? 3 32 52 28
? 2 52 28
? 3 8 76 28
? 5 63 69 33 70 4
? ...

result:

ok correct

Test #22:

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

input:

81
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
58 79
-1 -1
74 12
65 74
73 74
-1 -1
-1 -1
58 19
65 19
19 3
-1 -1
-1 -1
65 15
-1 -1
19 15
-1 -1
-1 -1
-1 -1
-1 -1
65 32
-1 -1
-1 -1
32 15
-1 -1
-1 -1
-1 -1
38 15
38 5
11 3
-1 -1
-1 -1
-1 -1
31 3
65 31
73 31
-1 -1
-1 -1
31 15
-1 -1
-1 -1
18 74
18 32
-1 -1
-1 -1
65 43
7...

output:

? 2 58 73
? 3 58 73 3
? 4 58 73 3 65
? 5 58 73 3 65 12
? 6 58 73 3 65 12 81
? 7 58 73 3 65 12 81 79
? 6 73 3 65 12 81 79
? 7 58 73 3 65 12 81 74
? 6 58 73 3 65 81 74
? 5 58 73 3 81 74
? 4 58 3 81 74
? 2 79 74
? 7 58 73 3 65 12 81 19
? 6 73 3 65 12 81 19
? 5 73 3 12 81 19
? 4 73 12 81 19
? 3 79 74 19...

result:

ok correct

Test #23:

score: 0
Accepted
time: 6ms
memory: 5692kb

input:

93
-1 -1
-1 -1
-1 -1
-1 -1
69 40
-1 -1
-1 -1
-1 -1
82 59
-1 -1
-1 -1
40 81
-1 -1
-1 -1
5 30
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
40 84
-1 -1
-1 -1
-1 -1
73 48
-1 -1
-1 -1
35 59
-1 -1
93 40
93 71
-1 -1
93 48
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
25 52
-1 -1
-1 -1
90 84
-1 -1
93 90
-1 -1
20 71
20 68
20 4...

output:

? 2 82 5
? 3 82 5 40
? 4 82 5 40 71
? 5 82 5 40 71 31
? 6 82 5 40 71 31 69
? 5 82 5 71 31 69
? 6 82 5 40 71 31 55
? 2 69 55
? 6 82 5 40 71 31 59
? 5 5 40 71 31 59
? 3 69 55 59
? 6 82 5 40 71 31 81
? 5 82 5 71 31 81
? 4 69 55 59 81
? 6 82 5 40 71 31 30
? 5 82 40 71 31 30
? 5 69 55 59 81 30
? 6 82 5 4...

result:

ok correct

Test #24:

score: 0
Accepted
time: 3ms
memory: 5828kb

input:

37
-1 -1
17 18
-1 -1
35 27
35 17
-1 -1
3 17
3 27
3 18
-1 -1
-1 -1
10 18
-1 -1
3 10
10 34
17 34
27 34
35 34
18 34
-1 -1
25 27
25 10
-1 -1
35 25
25 18
25 34
3 25
-1 -1
18 5
35 5
5 34
-1 -1
-1 -1
6 27
-1 -1
6 35
6 18
-1 -1
6 25
-1 -1
27 16
-1 -1
18 16
-1 -1
-1 -1
25 16
5 16
30 27
30 17
-1 -1
30 18
-1 -...

output:

? 2 27 17
? 3 27 17 18
? 2 27 18
? 3 27 17 35
? 2 17 35
? 2 18 35
? 3 27 17 3
? 2 27 3
? 3 18 35 3
? 2 35 3
? 3 27 17 10
? 3 18 35 10
? 2 35 10
? 2 3 10
? 4 27 17 10 34
? 3 27 17 34
? 2 27 34
? 3 18 35 34
? 2 18 34
? 2 3 34
? 4 27 17 10 25
? 3 17 10 25
? 2 17 25
? 3 18 35 25
? 2 18 25
? 3 3 34 25
? ...

result:

ok correct

Test #25:

score: 0
Accepted
time: 4ms
memory: 5848kb

input:

144
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
108 92
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
126 40
-1 -1
-1 -1
108 42
-1 -1
-1 -1
-1 -1
-1 -1
32 45
-1 -1
-1 -1
-1 -1...

output:

? 2 67 56
? 3 67 56 118
? 4 67 56 118 25
? 5 67 56 118 25 119
? 6 67 56 118 25 119 126
? 7 67 56 118 25 119 126 48
? 8 67 56 118 25 119 126 48 55
? 9 67 56 118 25 119 126 48 55 32
? 10 67 56 118 25 119 126 48 55 32 72
? 11 67 56 118 25 119 126 48 55 32 72 8
? 12 67 56 118 25 119 126 48 55 32 72 8 13...

result:

ok correct

Test #26:

score: 0
Accepted
time: 6ms
memory: 5708kb

input:

561
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
319 262
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
494 448
-1 -1
-1 -1
-1 -...

output:

? 2 405 544
? 3 405 544 373
? 4 405 544 373 529
? 5 405 544 373 529 289
? 6 405 544 373 529 289 42
? 7 405 544 373 529 289 42 109
? 8 405 544 373 529 289 42 109 234
? 9 405 544 373 529 289 42 109 234 190
? 10 405 544 373 529 289 42 109 234 190 218
? 11 405 544 373 529 289 42 109 234 190 218 30
? 12 ...

result:

ok correct

Test #27:

score: -100
Wrong Answer
time: 23ms
memory: 5816kb

input:

679
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
348 74
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-...

output:

? 2 168 183
? 3 168 183 27
? 4 168 183 27 584
? 5 168 183 27 584 616
? 6 168 183 27 584 616 46
? 7 168 183 27 584 616 46 581
? 8 168 183 27 584 616 46 581 489
? 9 168 183 27 584 616 46 581 489 484
? 10 168 183 27 584 616 46 581 489 484 434
? 11 168 183 27 584 616 46 581 489 484 434 291
? 12 168 183 ...

result:

wrong answer Query Limit Exceeded (lim = 3395)