QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#647007#1212. NavigationGrand_Elf10 22ms10308kbC++17780b2024-10-17 10:54:182024-10-17 10:54:29

Judging History

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

  • [2024-10-17 10:54:29]
  • 评测
  • 测评结果:10
  • 用时:22ms
  • 内存:10308kb
  • [2024-10-17 10:54:18]
  • 提交

Anna

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

namespace A {
	const int N = 1e5 + 5;

	int n, t;
	vector<int> e[N];

	void dfs(int u, int fa, int dis) {
		Flag(u, dis);
		for (int v : e[u]) {
			if (v == fa) {
				continue;
			}
			dfs(v, u, dis + 1);
		}
	}
}

void Anna(int subid, int n_, int t_, int x[], int y[]) {
	using namespace A;

	n = n_;
	t = t_;
	for (int i = 0; i < n - 1; i++) {
		int u = x[i], v = y[i];
		e[u].emplace_back(v);
		e[v].emplace_back(u);
	}
	dfs(t, 0, 0);
}

Bruno

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

void Bruno(int subid, int s, int F, int L, int P[], int Q[]) {
	for (int i = 0; i < L; i++) {
		if (F > Q[i]) {
			Answer(P[i]);
			return;
		}
	}
	Answer(s);
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 14ms
memory: 9568kb

input:

100000 94560 16294 1
91913 94560
94560 69503
94560 39684
47595 94560
94560 96623
8011 94560
94560 15498
94560 92403
94560 84183
94560 44035
39994 94560
82975 94560
94560 30698
94560 17596
93175 94560
12253 94560
94560 60807
94560 16111
35848 94560
94560 19061
94560 25435
64721 94560
94560 79086
9548...

output:

1 94560 1 99999
91913 69503 39684 47595 96623 8011 15498 92403 84183 44035 39994 82975 30698 17596 93175 12253 60807 16111 35848 19061 25435 64721 79086 95487 98059 93865 84074 47584 77418 15271 82666 57858 21726 62847 90603 40247 64714 59668 13698 15586 58276 57618 20231 16177 77966 44363 69669 679...

input:

1 94560 1 99999
91913 69503 39684 47595 96623 8011 15498 92403 84183 44035 39994 82975 30698 17596 93175 12253 60807 16111 35848 19061 25435 64721 79086 95487 98059 93865 84074 47584 77418 15271 82666 57858 21726 62847 90603 40247 64714 59668 13698 15586 58276 57618 20231 16177 77966 44363 69669 679...

output:

16294

result:

ok 

Test #2:

score: 10
Accepted
time: 4ms
memory: 9772kb

input:

100000 48333 48333 1
927 22305
87188 22305
22305 75567
22305 9347
22305 35901
84454 22305
22305 5403
95165 22305
22305 24449
22305 69669
67307 22305
22305 58710
22305 27193
22305 24006
22305 8159
22305 54726
22305 92239
22305 68605
10968 22305
98683 22305
22305 53333
56288 22305
22305 68487
22305 24...

output:

1 48333 0 1
22305 
1 

input:

1 48333 0 1
22305 
1 

output:

48333

result:

ok 

Test #3:

score: 10
Accepted
time: 2ms
memory: 8804kb

input:

100000 88397 36060 1
36060 49481
36060 89888
46104 36060
36060 6545
36060 10332
91103 36060
99366 36060
36060 91493
28482 36060
36060 50154
61776 36060
36060 86147
36060 26865
36060 59538
3007 36060
45932 36060
87940 36060
27557 36060
84830 36060
99039 36060
36060 56978
36060 67947
45731 36060
36060...

output:

1 88397 1 1
36060 
0 

input:

1 88397 1 1
36060 
0 

output:

36060

result:

ok 

Test #4:

score: 10
Accepted
time: 22ms
memory: 9484kb

input:

100000 38698 38698 1
37846 38698
38698 89559
78769 38698
38698 89020
7513 38698
38698 32101
38698 29025
12438 38698
18470 38698
38698 90109
38698 30769
38698 39527
10263 38698
65118 38698
38698 22415
64062 38698
97159 38698
69847 38698
39786 38698
51210 38698
43668 38698
36191 38698
38698 56728
3869...

output:

1 38698 0 99999
37846 89559 78769 89020 7513 32101 29025 12438 18470 90109 30769 39527 10263 65118 22415 64062 97159 69847 39786 51210 43668 36191 56728 64359 44538 82307 93616 84397 75820 2706 10140 87937 22018 42078 40298 19458 74608 59490 1552 75615 96884 9114 93872 4401 32423 44319 51612 90701 9...

input:

1 38698 0 99999
37846 89559 78769 89020 7513 32101 29025 12438 18470 90109 30769 39527 10263 65118 22415 64062 97159 69847 39786 51210 43668 36191 56728 64359 44538 82307 93616 84397 75820 2706 10140 87937 22018 42078 40298 19458 74608 59490 1552 75615 96884 9114 93872 4401 32423 44319 51612 90701 9...

output:

38698

result:

ok 

Test #5:

score: 10
Accepted
time: 0ms
memory: 9720kb

input:

100000 8245 84923 1
67623 27621
14268 21660
76847 23001
8526 89835
60294 27885
97998 3107
41202 81214
89046 77360
59880 37584
257 27165
98520 84969
86067 72018
56406 64542
8276 24019
2025 20508
41774 84036
98730 17060
95258 43701
9237 70504
60680 4981
37431 88381
35493 76263
67579 96557
38708 14317
...

output:

1 8245 1 1
84923 
0 

input:

1 8245 1 1
84923 
0 

output:

84923

result:

ok 

Test #6:

score: 10
Accepted
time: 4ms
memory: 9884kb

input:

100000 30244 30244 1
73878 14577
56095 37561
47600 77453
5775 66825
58458 94915
99798 36060
47365 16824
9669 42255
33430 40025
41498 48308
18806 35743
41949 2837
90413 81335
23192 16889
45568 74622
4612 60078
69326 26499
28615 69807
86447 94951
28921 39587
92130 49914
84613 67964
64759 79721
1311 61...

output:

1 30244 0 2
40964 19929 
1 1 

input:

1 30244 0 2
40964 19929 
1 1 

output:

30244

result:

ok 

Test #7:

score: 10
Accepted
time: 4ms
memory: 10308kb

input:

100000 96539 83473 1
70154 43134
32826 38352
57782 12788
92705 47501
35880 88824
40402 10256
10743 19914
43415 24282
51931 26190
22666 11483
99042 17829
96021 53017
54819 93863
51864 66957
87319 62434
6849 62344
78818 23795
96092 34357
94603 43233
12795 54707
98761 8205
77768 51553
32961 14830
5637 ...

output:

1 96539 1 2
83473 27443 
0 2 

input:

1 96539 1 2
83473 27443 
0 2 

output:

83473

result:

ok 

Test #8:

score: 10
Accepted
time: 0ms
memory: 9620kb

input:

100000 52817 52817 1
45829 28937
87621 46779
27742 44527
29132 94788
34866 83250
10067 22616
59505 47012
96094 630
61678 67600
71656 43018
34904 61814
76991 78179
94102 12730
40366 90348
7717 42472
68347 67300
14803 29352
26557 92986
20554 25074
36744 72498
39260 58715
67267 83312
35596 27056
93664 ...

output:

1 52817 0 1
115 
1 

input:

1 52817 0 1
115 
1 

output:

52817

result:

ok 

Test #9:

score: 10
Accepted
time: 4ms
memory: 9576kb

input:

100000 14195 67017 1
23788 47378
57548 95872
97584 25942
19288 20314
42260 30765
82001 68266
13774 72423
74387 24887
97 22922
15715 60006
90877 24174
89741 84096
73666 89510
16870 8055
39058 61116
15682 37838
84083 621
97991 8584
31526 9971
46740 96764
77084 70018
24790 67667
59099 77893
24595 18088...

output:

1 14195 50000 1
57259 
49999 

input:

1 14195 50000 1
57259 
49999 

output:

57259

result:

ok 

Test #10:

score: 10
Accepted
time: 4ms
memory: 9264kb

input:

100000 15020 75552 1
70212 19873
39566 51824
72068 30734
50469 52341
45274 22005
90199 3889
1305 93887
96152 44487
15814 30459
52217 65619
29437 28937
28822 60432
27605 9636
524 23527
32956 39952
54216 21069
89870 31269
60600 27898
5414 73324
63840 15129
68618 55508
43871 27794
45462 2089
22374 1384...

output:

1 15020 50000 2
40787 12325 
49999 50001 

input:

1 15020 50000 2
40787 12325 
49999 50001 

output:

40787

result:

ok 

Test #11:

score: 10
Accepted
time: 0ms
memory: 7984kb

input:

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

output:

1 2 4 1
5 
3 

input:

1 2 4 1
5 
3 

output:

5

result:

ok 

Test #12:

score: 10
Accepted
time: 2ms
memory: 8560kb

input:

100000 58067 15674 1
45725 64183
5112 87153
28531 75803
48435 53630
61953 75534
79055 50510
20726 41197
91397 92746
20005 71460
98204 69227
83560 88464
17860 67373
72068 35569
97241 18507
34920 71359
48876 67590
39953 65012
84674 8583
98702 53186
19391 62209
57431 16010
60098 46021
60100 18974
97335...

output:

1 58067 86420 2
89366 28752 
86419 86421 

input:

1 58067 86420 2
89366 28752 
86419 86421 

output:

89366

result:

ok 

Test #13:

score: 10
Accepted
time: 4ms
memory: 9868kb

input:

100000 33281 11995 1
58672 48908
38754 14558
64582 60186
43413 61411
77625 73219
45168 68139
3177 6625
17478 56482
55459 13182
90092 28171
10030 53095
48280 36296
74392 91035
36886 95781
14685 9181
10482 68116
18181 62605
3072 47176
57688 75503
92342 44915
71384 17845
48150 80905
95302 13169
72420 7...

output:

1 33281 8320 2
30431 93535 
8319 8321 

input:

1 33281 8320 2
30431 93535 
8319 8321 

output:

30431

result:

ok 

Test #14:

score: 10
Accepted
time: 2ms
memory: 9760kb

input:

100000 23253 50284 1
33036 8532
16987 23157
24725 11750
82213 25644
19245 26175
33859 72475
84407 19947
54564 86881
9302 71494
54009 18493
13106 61118
57915 16567
43573 81856
69334 73709
92627 10167
45965 79107
39970 26375
29530 62766
31976 46163
79866 68397
18112 264
40637 12599
62736 21658
60811 2...

output:

1 23253 13211 1
72220 
13210 

input:

1 23253 13211 1
72220 
13210 

output:

72220

result:

ok 

Test #15:

score: 10
Accepted
time: 2ms
memory: 8072kb

input:

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

output:

1 2 4 1
5 
3 

input:

1 2 4 1
5 
3 

output:

5

result:

ok 

Test #16:

score: 10
Accepted
time: 0ms
memory: 8696kb

input:

100000 36431 60397 1
17885 95203
62729 35705
17294 50767
52699 82966
52217 24958
82268 43809
51951 88691
3904 35519
47307 51267
69107 53308
96124 58039
480 16881
55918 23129
14004 75060
6440 82509
7484 36128
79431 30923
73398 4082
95871 70336
65848 45640
49823 95127
76767 60115
55027 31892
19212 101...

output:

1 36431 18 5
24830 16000 85236 56668 9570 
19 19 19 17 19 

input:

1 36431 18 5
24830 16000 85236 56668 9570 
19 19 19 17 19 

output:

56668

result:

ok 

Test #17:

score: 10
Accepted
time: 4ms
memory: 9192kb

input:

100000 26991 25105 1
58880 63047
77935 8208
42959 23874
5121 162
30393 86480
78919 38651
15722 8497
6062 2695
11535 61738
14477 16623
30718 50568
71363 57805
79766 92541
10360 58480
9400 89934
85167 59557
24898 24876
20432 3759
53940 92777
48098 72434
90917 40502
21115 66931
80982 1561
27599 41918
6...

output:

1 26991 31 7
983 90216 7275 87818 17497 31675 83454 
32 32 32 30 32 32 32 

input:

1 26991 31 7
983 90216 7275 87818 17497 31675 83454 
32 32 32 30 32 32 32 

output:

87818

result:

ok 

Test #18:

score: 10
Accepted
time: 0ms
memory: 9424kb

input:

100000 55178 17512 1
56702 62074
68613 42359
56090 39239
57168 29611
272 92025
97759 40414
36943 99724
68466 21366
92995 53699
94219 47642
38376 45625
88060 92007
49559 67247
51449 35521
19174 9476
29935 7655
31613 82776
98618 18916
53659 38484
64359 38434
58797 62692
31652 86882
98669 35675
34567 4...

output:

1 55178 33 4
18334 73508 552 39167 
34 32 34 34 

input:

1 55178 33 4
18334 73508 552 39167 
34 32 34 34 

output:

73508

result:

ok 

Test #19:

score: 10
Accepted
time: 0ms
memory: 8544kb

input:

2 2 2 1
2 1

output:

1 2 0 1
1 
1 

input:

1 2 0 1
1 
1 

output:

2

result:

ok 

Test #20:

score: 10
Accepted
time: 4ms
memory: 9528kb

input:

2 1 1 1
2 1

output:

1 1 0 1
2 
1 

input:

1 1 0 1
2 
1 

output:

1

result:

ok 

Test #21:

score: 10
Accepted
time: 4ms
memory: 9956kb

input:

3 1 1 1
3 1
1 2

output:

1 1 0 2
3 2 
1 1 

input:

1 1 0 2
3 2 
1 1 

output:

1

result:

ok 

Test #22:

score: 10
Accepted
time: 2ms
memory: 9624kb

input:

3 1 3 1
2 3
1 2

output:

1 1 2 1
2 
1 

input:

1 1 2 1
2 
1 

output:

2

result:

ok 

Test #23:

score: 10
Accepted
time: 4ms
memory: 9740kb

input:

3 3 3 1
3 1
1 2

output:

1 3 0 1
1 
1 

input:

1 3 0 1
1 
1 

output:

3

result:

ok 

Test #24:

score: 10
Accepted
time: 0ms
memory: 8592kb

input:

3 1 3 1
1 2
3 2

output:

1 1 2 1
2 
1 

input:

1 1 2 1
2 
1 

output:

2

result:

ok 

Test #25:

score: 10
Accepted
time: 0ms
memory: 8748kb

input:

3 1 1 1
3 2
3 1

output:

1 1 0 1
3 
1 

input:

1 1 0 1
3 
1 

output:

1

result:

ok 

Subtask #2:

score: 0
Wrong Answer

Test #26:

score: 15
Accepted
time: 14ms
memory: 10136kb

input:

100000 57165 10261 2
57165 48992
57165 19387
71033 57165
13350 57165
52013 57165
39911 57165
31569 57165
57165 57655
47865 57165
57165 61895
79639 57165
35978 57165
47454 57165
76859 57165
57165 45447
31140 57165
57165 67169
57165 95791
57165 60405
57165 80905
57165 55354
57165 95642
8667 57165
8827...

output:

2 57165 1 99999
48992 19387 71033 13350 52013 39911 31569 57655 47865 61895 79639 35978 47454 76859 45447 31140 67169 95791 60405 80905 55354 95642 8667 88274 721 61541 31467 62158 93646 5791 37673 90967 70822 50373 6922 9211 12493 55791 99612 86337 52418 27225 13284 54010 57405 99213 36389 5528 532...

input:

2 57165 1 99999
48992 19387 71033 13350 52013 39911 31569 57655 47865 61895 79639 35978 47454 76859 45447 31140 67169 95791 60405 80905 55354 95642 8667 88274 721 61541 31467 62158 93646 5791 37673 90967 70822 50373 6922 9211 12493 55791 99612 86337 52418 27225 13284 54010 57405 99213 36389 5528 532...

output:

10261

result:

ok 

Test #27:

score: 15
Accepted
time: 2ms
memory: 8236kb

input:

100000 20690 20690 2
97025 11592
8829 11592
11592 95625
11592 30832
11592 71951
11592 59839
11592 58624
65454 11592
46862 11592
86426 11592
11592 2542
11592 43812
59361 11592
11592 89769
84488 11592
11592 97510
77985 11592
11592 74093
20808 11592
22285 11592
11592 78659
11592 69395
51936 11592
10374...

output:

2 20690 0 1
11592 
1 

input:

2 20690 0 1
11592 
1 

output:

20690

result:

ok 

Test #28:

score: 15
Accepted
time: 4ms
memory: 8552kb

input:

100000 65054 52134 2
52134 74093
74895 52134
19206 52134
4235 52134
52134 74265
52134 96316
52134 22349
52134 81235
24872 52134
52134 18500
65129 52134
4289 52134
52134 41502
52134 62507
52134 58062
52134 9319
52134 9898
52134 98743
52134 73792
62834 52134
71095 52134
52134 50084
16065 52134
68492 5...

output:

2 65054 1 1
52134 
0 

input:

2 65054 1 1
52134 
0 

output:

52134

result:

ok 

Test #29:

score: 15
Accepted
time: 14ms
memory: 9216kb

input:

100000 77363 77363 2
1124 77363
77363 76872
77363 55161
82007 77363
68938 77363
51460 77363
77363 89625
77363 19141
77363 93908
77363 60862
84152 77363
77363 14422
77363 63469
77363 60128
77363 23779
56985 77363
77363 44495
77363 70405
33650 77363
48283 77363
57092 77363
37217 77363
53815 77363
7921...

output:

2 77363 0 99999
1124 76872 55161 82007 68938 51460 89625 19141 93908 60862 84152 14422 63469 60128 23779 56985 44495 70405 33650 48283 57092 37217 53815 79212 18151 21576 9156 40524 58866 61012 13634 47074 71660 61247 9905 35741 62260 39549 6514 48989 68201 6118 63298 59900 55307 44090 11614 32131 3...

input:

2 77363 0 99999
1124 76872 55161 82007 68938 51460 89625 19141 93908 60862 84152 14422 63469 60128 23779 56985 44495 70405 33650 48283 57092 37217 53815 79212 18151 21576 9156 40524 58866 61012 13634 47074 71660 61247 9905 35741 62260 39549 6514 48989 68201 6118 63298 59900 55307 44090 11614 32131 3...

output:

77363

result:

ok 

Test #30:

score: 15
Accepted
time: 4ms
memory: 10040kb

input:

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

output:

2 3 1 1
2 
0 

input:

2 3 1 1
2 
0 

output:

2

result:

ok 

Test #31:

score: 15
Accepted
time: 0ms
memory: 8324kb

input:

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

output:

2 1 0 1
4 
1 

input:

2 1 0 1
4 
1 

output:

1

result:

ok 

Test #32:

score: 15
Accepted
time: 4ms
memory: 9772kb

input:

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

output:

2 5 0 2
2 3 
1 1 

input:

2 5 0 2
2 3 
1 1 

output:

5

result:

ok 

Test #33:

score: 15
Accepted
time: 4ms
memory: 9860kb

input:

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

output:

2 1 1 2
2 3 
2 0 

input:

2 1 1 2
2 3 
2 0 

output:

3

result:

ok 

Test #34:

score: 15
Accepted
time: 2ms
memory: 9620kb

input:

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

output:

2 1 3 1
3 
2 

input:

2 1 3 1
3 
2 

output:

3

result:

ok 

Test #35:

score: 0
Wrong Answer
time: 2ms
memory: 8228kb

input:

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

output:

2 4 3 2
5 2 
2 4 

input:

2 4 3 2
5 2 
2 4 

output:

5

result:

wrong answer the value of V is bigger than 2

Subtask #3:

score: 0
Wrong Answer

Test #53:

score: 0
Wrong Answer
time: 4ms
memory: 9000kb

input:

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

output:

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

input:

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

output:

1

result:

wrong answer the value of V is bigger than 1

Subtask #4:

score: 0
Wrong Answer

Test #85:

score: 0
Wrong Answer
time: 2ms
memory: 8364kb

input:

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

output:

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

input:

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

output:

4

result:

wrong answer the value of V is bigger than 1