QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#496868#4218. Hidden GraphhazeWA 6ms5864kbC++205.1kb2024-07-28 16:38:262024-07-28 16:38:27

Judging History

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

  • [2024-07-28 16:38:27]
  • 评测
  • 测评结果:WA
  • 用时:6ms
  • 内存:5864kb
  • [2024-07-28 16:38:26]
  • 提交

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)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: 5576kb

input:

3
1 2
1 3
2 3

output:

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

result:

ok correct

Test #2:

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

input:

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

output:

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

result:

ok correct

Test #3:

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

input:

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

output:

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

result:

ok correct

Test #4:

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

input:

3
-1 -1
1 3
2 1

output:

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

result:

ok correct

Test #5:

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

input:

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

output:

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

result:

ok correct

Test #6:

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

input:

27
22 11
5 11
-1 -1
4 11
-1 -1
-1 -1
5 13
22 13
-1 -1
-1 -1
-1 -1
19 11
19 13
5 19
-1 -1
-1 -1
22 20
9 20
5 20
-1 -1
-1 -1
24 13
-1 -1
24 5
-1 -1
24 19
-1 -1
12 11
-1 -1
5 12
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
2 5
-1 -1
2 19
-1 -1
-1 -1
-1 -1
-1 -1
20 18
-1 -1
17 18
24 18
12 18
-1 -1
27...

output:

? 2 11 22
? 2 11 5
? 2 22 5
? 2 11 4
? 3 22 5 4
? 2 11 13
? 4 22 5 4 13
? 3 22 4 13
? 2 4 13
? 3 11 13 9
? 4 22 5 4 9
? 3 11 13 19
? 2 13 19
? 5 22 5 4 9 19
? 4 22 4 9 19
? 3 11 13 20
? 5 22 5 4 9 20
? 4 5 4 9 20
? 3 5 4 20
? 2 4 20
? 2 19 20
? 3 11 13 24
? 2 11 24
? 5 22 5 4 9 24
? 4 22 4 9 24
? 3 ...

result:

ok correct

Test #7:

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

input:

47
-1 -1
-1 -1
-1 -1
20 15
-1 -1
-1 -1
-1 -1
5 40
-1 -1
40 36
-1 -1
21 25
21 15
21 5
-1 -1
20 21
-1 -1
-1 -1
13 15
13 5
-1 -1
-1 -1
-1 -1
2 33
-1 -1
-1 -1
-1 -1
-1 -1
20 24
-1 -1
-1 -1
5 28
-1 -1
28 36
-1 -1
28 40
21 28
-1 -1
-1 -1
20 41
-1 -1
-1 -1
-1 -1
46 5
46 15
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 ...

output:

? 2 15 2
? 3 15 2 5
? 4 15 2 5 25
? 5 15 2 5 25 20
? 4 2 5 25 20
? 5 15 2 5 25 36
? 2 20 36
? 5 15 2 5 25 40
? 4 15 2 25 40
? 3 20 36 40
? 2 20 40
? 5 15 2 5 25 21
? 4 15 2 5 21
? 3 2 5 21
? 2 2 21
? 3 20 36 21
? 2 36 21
? 2 40 21
? 5 15 2 5 25 13
? 4 2 5 25 13
? 3 2 25 13
? 3 20 36 13
? 3 40 21 13
...

result:

ok correct

Test #8:

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

input:

38
16 25
-1 -1
-1 -1
-1 -1
16 6
-1 -1
-1 -1
3 5
-1 -1
-1 -1
-1 -1
-1 -1
3 34
16 34
-1 -1
6 20
-1 -1
16 20
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
31 6
31 25
31 5
-1 -1
16 31
-1 -1
31 26
31 9
38 31
11 31
-1 -1
4 5
4 6
-1 -1
-1 -1
11 4
4 20
4 10
...

output:

? 2 25 16
? 2 25 3
? 2 16 3
? 2 25 6
? 3 16 3 6
? 2 3 6
? 3 25 6 5
? 3 16 3 5
? 2 16 5
? 4 25 6 5 32
? 3 16 3 32
? 4 25 6 5 34
? 4 16 3 32 34
? 3 16 32 34
? 2 32 34
? 5 25 6 5 34 20
? 4 25 5 34 20
? 4 16 3 32 20
? 3 3 32 20
? 5 25 6 5 34 38
? 4 16 3 32 38
? 2 20 38
? 5 25 6 5 34 10
? 4 16 3 32 10
? ...

result:

ok correct

Test #9:

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

input:

25
-1 -1
2 9
-1 -1
2 25
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
25 24
-1 -1
24 15
-1 -1
-1 -1
5 2
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
16 9
-1 -1
16 21
-1 -1
5 21
-1 -1
16 12
-1 -1
12 25
-1 -1
-1 -1
16 7
-1 -1
7 19
7 17
7 25
5 7
-1 -1
-1 -1
2 11
-1 -1
19 11
9 11
-1 -1
21 11
-1 -1
16 3
-1 -1
25 3
-1 -1
7 3
-1 -1
-1 -...

output:

? 2 1 2
? 3 1 2 9
? 2 1 9
? 3 1 2 25
? 2 1 25
? 2 9 25
? 3 1 2 19
? 3 9 25 19
? 3 1 2 24
? 4 9 25 19 24
? 3 9 19 24
? 4 1 2 24 15
? 3 1 2 15
? 4 9 25 19 15
? 4 1 2 24 5
? 3 1 24 5
? 5 9 25 19 15 5
? 4 1 2 24 17
? 6 9 25 19 15 5 17
? 4 1 2 24 16
? 7 9 25 19 15 5 17 16
? 6 25 19 15 5 17 16
? 5 1 2 24 ...

result:

ok correct

Test #10:

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

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: 5700kb

input:

3
2 3
3 1
2 1

output:

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

result:

ok correct

Test #12:

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

input:

3
3 1
-1 -1
2 1

output:

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

result:

ok correct

Test #13:

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

input:

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

output:

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

result:

ok correct

Test #14:

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

input:

3
-1 -1
2 1
-1 -1

output:

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

result:

ok correct

Test #15:

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

input:

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

output:

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

result:

ok correct

Test #16:

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

input:

93
-1 -1
19 79
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
73 22
87 22
-1 -1
-1 -1
42 60
42 76
-1 -1
-1 -1
-1 -1
69 42
-1 -1
-1 -1
80 22
80 24
-1 -1
80 76
-1 -1
71 22
-1 -1
71 87
71 69
-1 -1
-1 -1
-1 -1
92 60
-1 -1
-1 -1
-1 -1
88 73
88 60
88 87
-1 -1
-1 -1
-1 -1
-1 -1
-1 ...

output:

? 2 19 24
? 3 19 24 79
? 2 24 79
? 3 19 24 51
? 2 79 51
? 3 19 24 60
? 3 79 51 60
? 3 19 24 87
? 4 79 51 60 87
? 3 19 24 76
? 5 79 51 60 87 76
? 3 19 24 73
? 6 79 51 60 87 76 73
? 3 19 24 22
? 7 79 51 60 87 76 73 22
? 6 79 51 60 87 76 22
? 5 79 51 60 76 22
? 4 19 24 22 42
? 7 79 51 60 87 76 73 42
? ...

result:

ok correct

Test #17:

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

input:

111
12 104
12 72
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
10 34
-1 -1
66 12
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
70 33
-1 -1
-1 -1
-1 -1
-1 -1
67 104
66 67
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
28 10
28 67
-1 -1
28 68
-1 -1
12 46
-1 -1
72 46
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
83 12
-1 -1
...

output:

? 2 12 104
? 2 12 72
? 2 104 72
? 2 12 70
? 3 104 72 70
? 2 12 63
? 4 104 72 70 63
? 2 12 34
? 5 104 72 70 63 34
? 2 12 78
? 6 104 72 70 63 34 78
? 2 12 55
? 7 104 72 70 63 34 78 55
? 2 12 10
? 8 104 72 70 63 34 78 55 10
? 7 104 72 70 63 78 55 10
? 3 12 10 66
? 2 10 66
? 8 104 72 70 63 34 78 55 66
?...

result:

ok correct

Test #18:

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

input:

132
-1 -1
-1 -1
-1 -1
40 71
-1 -1
-1 -1
-1 -1
40 46
64 46
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
61 40
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
131 46
131 32
-1 -1
-1 -1
-1 -1
35 50
-1 -1
16 35
71 35
-1 -1
-1 -1
10 8
-1 -1
-1 -1
82 40
82 54
-1 -1
-1 -1
-1 -1
40 12
-1 -1
-1 -1
1...

output:

? 2 64 54
? 3 64 54 40
? 4 64 54 40 50
? 5 64 54 40 50 71
? 4 64 54 50 71
? 5 64 54 40 50 121
? 2 71 121
? 5 64 54 40 50 46
? 4 64 54 50 46
? 3 54 50 46
? 3 71 121 46
? 5 64 54 40 50 16
? 4 71 121 46 16
? 5 64 54 40 50 126
? 5 71 121 46 16 126
? 5 64 54 40 50 32
? 6 71 121 46 16 126 32
? 5 64 54 40 ...

result:

ok correct

Test #19:

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

input:

94
-1 -1
-1 -1
-1 -1
39 92
92 46
92 45
-1 -1
51 46
-1 -1
51 92
20 46
20 50
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
51 26
-1 -1
39 22
-1 -1
-1 -1
-1 -1
-1 -1
82 26
92 82
-1 -1
39 55
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
51 94
94 22
-1 -1
43 50
43 45
43 39
-1 -1
43 92
-1 -1
43 22
43 55
-1 -1
39 85
-1 -1
-1 -1
-1 -1
-1 ...

output:

? 2 45 50
? 3 45 50 46
? 4 45 50 46 39
? 5 45 50 46 39 92
? 4 45 50 46 92
? 3 45 50 92
? 2 50 92
? 5 45 50 46 39 51
? 4 45 50 39 51
? 2 92 51
? 5 45 50 46 39 20
? 4 45 50 39 20
? 3 45 39 20
? 2 92 20
? 2 51 20
? 5 45 50 46 39 26
? 2 92 26
? 3 51 20 26
? 2 20 26
? 5 45 50 46 39 22
? 4 45 50 46 22
? 3...

result:

ok correct

Test #20:

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

input:

73
-1 -1
-1 -1
-1 -1
-1 -1
29 19
42 19
9 19
-1 -1
1 9
1 29
-1 -1
1 19
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
42 59
9 59
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
51 42
-1 -1
51 19
51 50
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
52 9
52 42
-1 -1
52 19
52 71
1 52
-1 -1
-1 -1
9 40
-1 -1
40 19
1 40
40 59
-1 -1
-1 -1
-1 -1
-...

output:

? 2 41 42
? 3 41 42 9
? 4 41 42 9 29
? 5 41 42 9 29 2
? 6 41 42 9 29 2 19
? 5 41 42 9 2 19
? 4 41 9 2 19
? 3 41 2 19
? 6 41 42 9 29 2 1
? 5 41 42 29 2 1
? 4 41 42 2 1
? 2 19 1
? 6 41 42 9 29 2 71
? 2 19 71
? 2 1 71
? 6 41 42 9 29 2 24
? 2 19 24
? 3 1 71 24
? 6 41 42 9 29 2 59
? 5 41 9 29 2 59
? 4 41...

result:

ok correct

Test #21:

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

input:

77
34 73
73 11
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
59 47
-1 -1
8 73
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
26 11
-1 -1
-1 -1
75 34
75 8
75 2
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
8 13
-1 -1
-1 -1
34 67
8 67
-1 -1
-1 -1
6 31
-1 -1
26 56
73 56
75 56
-1 -1
8 56
-1 -1
20 67
75 20
26 20
20 4...

output:

? 2 73 34
? 2 73 11
? 2 34 11
? 2 73 59
? 3 34 11 59
? 2 73 53
? 4 34 11 59 53
? 2 73 2
? 5 34 11 59 53 2
? 2 73 47
? 6 34 11 59 53 2 47
? 5 34 11 53 2 47
? 3 73 47 8
? 2 47 8
? 6 34 11 59 53 2 8
? 3 73 47 40
? 7 34 11 59 53 2 8 40
? 3 73 47 29
? 8 34 11 59 53 2 8 40 29
? 3 73 47 26
? 9 34 11 59 53 ...

result:

ok correct

Test #22:

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

input:

81
69 71
-1 -1
-1 -1
-1 -1
47 43
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
68 55
-1 -1
71 24
24 47
-1 -1
-1 -1
-1 -1
41 23
-1 -1
79 68
71 79
-1 -1
24 79
79 23
-1 -1
60 47
-1 -1
60 69
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
71 45
-1 -1
45 23
45 55
-1 -1
79 45
-1 -1
58 71
58 68
58 41
-1 -1
58 69
-1 -1
58 79
-1 -1
-1 ...

output:

? 2 71 69
? 2 71 43
? 2 69 43
? 2 71 47
? 3 69 43 47
? 2 69 47
? 3 71 47 55
? 3 69 43 55
? 3 71 47 23
? 4 69 43 55 23
? 3 71 47 68
? 5 69 43 55 23 68
? 4 69 43 23 68
? 4 71 47 68 24
? 3 47 68 24
? 2 68 24
? 5 69 43 55 23 24
? 4 71 47 68 41
? 6 69 43 55 23 24 41
? 5 69 43 55 24 41
? 5 71 47 68 41 79
...

result:

ok correct

Test #23:

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

input:

93
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
38 3
-1 -1
83 62
-1 -1
-1 -1
-1 -1
-1 -1
38 27
78 27
27 59
27 10
-1 -1
-1 -1
-1 -1
-1 -1
63 59
-1 -1
27 63
-1 -1
90 10
83 90
-1 -1
-1 -1
-1 -1
53 10
53 38
-1 -1
53 27
-1 -1
-1 -1
2 38
2 78
-1 -1
-1 -1
-1 -1
34 16
-1 -1
16 30
-1 -1
-1 -1
-1 -1
69 3
-1 -1
69 63
6...

output:

? 2 34 78
? 3 34 78 10
? 4 34 78 10 19
? 5 34 78 10 19 59
? 6 34 78 10 19 59 83
? 7 34 78 10 19 59 83 38
? 8 34 78 10 19 59 83 38 3
? 7 34 78 10 19 59 83 3
? 8 34 78 10 19 59 83 38 62
? 7 34 78 10 19 59 38 62
? 2 3 62
? 8 34 78 10 19 59 83 38 73
? 3 3 62 73
? 8 34 78 10 19 59 83 38 27
? 7 34 78 10 1...

result:

ok correct

Test #24:

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

input:

37
-1 -1
33 14
33 21
-1 -1
33 32
14 29
29 21
-1 -1
33 29
-1 -1
-1 -1
12 29
-1 -1
12 13
-1 -1
-1 -1
36 14
36 21
-1 -1
36 12
-1 -1
36 29
-1 -1
-1 -1
33 18
12 18
29 18
13 18
-1 -1
-1 -1
33 17
-1 -1
13 17
-1 -1
17 18
-1 -1
17 26
14 26
26 21
-1 -1
33 26
12 26
-1 -1
18 26
-1 -1
7 17
7 32
-1 -1
12 7
-1 -1
...

output:

? 2 14 21
? 3 14 21 33
? 2 21 33
? 3 14 21 32
? 2 33 32
? 4 14 21 32 29
? 3 21 32 29
? 2 32 29
? 2 33 29
? 4 14 21 32 12
? 2 33 12
? 2 29 12
? 4 14 21 32 13
? 3 33 12 13
? 2 33 13
? 2 29 13
? 4 14 21 32 36
? 3 21 32 36
? 2 32 36
? 3 33 12 36
? 2 33 36
? 3 29 13 36
? 2 13 36
? 4 14 21 32 18
? 3 33 12...

result:

ok correct

Test #25:

score: -100
Wrong Answer
time: 4ms
memory: 5700kb

input:

144
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
112 23
-1 -1
-1 -1
-1 -1
140 113
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
81 43
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
81 122
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
43 5
-1 -1
-1 -1
131 1...

output:

? 2 103 117
? 3 103 117 112
? 4 103 117 112 81
? 5 103 117 112 81 74
? 6 103 117 112 81 74 17
? 7 103 117 112 81 74 17 92
? 8 103 117 112 81 74 17 92 113
? 9 103 117 112 81 74 17 92 113 82
? 10 103 117 112 81 74 17 92 113 82 139
? 11 103 117 112 81 74 17 92 113 82 139 23
? 10 103 117 81 74 17 92 113...

result:

wrong answer Query Limit Exceeded (lim = 432)