QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#115448#4926. Where Is the Root?aaargh0 14ms3500kbC++17714b2023-06-26 09:39:192023-06-26 09:39:22

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-26 09:39:22]
  • 评测
  • 测评结果:0
  • 用时:14ms
  • 内存:3500kb
  • [2023-06-26 09:39:19]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define nl '\n'
#define io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

signed main() {
	io; int n; cin >> n;
	// vector<vector<int>> adjlist(n);
	int a,b;
	for (int i = 0; i < n-1; i++) {
		cin >> a >> b;
		// adjlist[a].push_back(b);
		// adjlist[b].push_back(a);
	}
	string temp;
	for (int i = 1; i <= n; i++) {

		cout << "? " << n-1 << ' ';
		for (int j = 1; j <= n; j++) {
			if (i == j) continue;
			if (j == n || (i == n && j == n-1)) cout << j;
			else cout << j << ' ';
		}
		cout << nl;
		cout.flush();
		cin >> temp;
		if (temp[0] == 'N') {
			cout << "! " << i <<  nl;
			break;
		}
	}
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 7
Accepted
time: 1ms
memory: 3420kb

input:

7
4 1
1 2
4 3
3 5
3 6
4 7
YES
YES
YES
NO

output:

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

result:

ok OK

Test #2:

score: -7
Wrong Answer
time: 1ms
memory: 3404kb

input:

9
5 9
8 6
2 8
1 8
3 6
6 7
1 4
4 5
YES
YES
YES
YES
YES
YES
YES
YES
YES

output:

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

result:

wrong output format Unexpected end of file - int32 expected

Subtask #2:

score: 0
Wrong Answer

Test #24:

score: 0
Wrong Answer
time: 3ms
memory: 3492kb

input:

30
1 15
29 30
1 4
7 28
29 17
1 26
26 7
12 5
27 13
3 7
27 1
21 15
9 22
22 5
24 27
19 1
25 30
22 27
6 15
16 13
18 2
27 10
27 30
20 26
8 15
18 8
14 1
27 23
11 3
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES

output:

? 29 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
? 29 1 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
? 29 1 2 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
? 29 1 2 3 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ...

result:

wrong output format Unexpected end of file - int32 expected

Subtask #3:

score: 0
Wrong Answer

Test #54:

score: 18
Acceptable Answer
time: 14ms
memory: 3500kb

input:

500
419 133
44 225
391 269
419 461
293 347
108 31
110 363
423 257
321 155
498 87
180 492
251 5
357 30
341 172
275 109
372 446
286 336
208 339
162 320
138 103
129 219
62 141
359 286
130 238
470 460
418 48
210 358
429 13
323 143
382 415
406 394
309 175
325 170
128 108
6 113
363 17
470 457
7 224
288 48...

output:

? 499 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:

points 0.21686746990 OK

Test #55:

score: 0
Wrong Answer
time: 8ms
memory: 3480kb

input:

500
188 321
193 4
334 269
259 66
121 396
73 153
332 477
263 67
178 262
185 377
175 53
462 245
390 337
387 200
445 92
387 159
135 263
323 312
143 374
252 47
375 382
303 345
345 283
150 1
66 289
462 82
317 201
169 423
154 193
486 251
368 305
357 375
107 443
437 348
64 55
408 465
315 469
186 328
197 39...

output:

? 499 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:

wrong output format Unexpected end of file - int32 expected