QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#647008#1212. Navigationfast_photon10 20ms9952kbC++14881b2024-10-17 10:54:232024-10-17 10:54:35

Judging History

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

  • [2024-10-17 10:54:35]
  • 评测
  • 测评结果:10
  • 用时:20ms
  • 内存:9952kb
  • [2024-10-17 10:54:23]
  • 提交

Anna

#include "Annalib.h"
#include<vector>
#include<queue>
#include<cstring>

using namespace std;

int dis[100005], h[100005], en;
queue<int> q;
struct edge {
	int v, next;
} e[200005];
void add(int u, int v) {
	e[en] = (edge){v, h[u]}; h[u] = en++;
}

void Anna(int K, int N, int T, int A[], int B[]) {
	memset(dis, 0x3f, sizeof(dis));
	memset(h, 0xff, sizeof(h));
	en = 0;
	for(int i = 0; i < N - 1; i++) add(A[i], B[i]), add(B[i], A[i]);
	q.push(T);
	dis[T] = 1;
	while(!q.empty()) {
		int r = q.front(); q.pop();
		Flag(r, dis[r]);
		for(int j = h[r]; ~j; j = e[j].next) {
			int v = e[j].v;
			if(dis[v] > dis[r] + 1) {
				dis[v] = dis[r] + 1;
				q.push(v);
			}
		}
	}
}

Bruno

#include "Brunolib.h"

void Bruno(int K, int S, int F, int L, int P[], int Q[]) {
	for(int i =  0; i < L; i++) {
		if(Q[i] < F) F = Q[i], S = P[i];
	}
	Answer(S);
}

詳細信息

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 20ms
memory: 7964kb

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 2 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 2 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: 0ms
memory: 8184kb

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 1 1
22305 
2 

input:

1 48333 1 1
22305 
2 

output:

48333

result:

ok 

Test #3:

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

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 2 1
36060 
1 

input:

1 88397 2 1
36060 
1 

output:

36060

result:

ok 

Test #4:

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

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 1 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 1 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: 2ms
memory: 7908kb

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 2 1
84923 
1 

input:

1 8245 2 1
84923 
1 

output:

84923

result:

ok 

Test #6:

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

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 1 2
40964 19929 
2 2 

input:

1 30244 1 2
40964 19929 
2 2 

output:

30244

result:

ok 

Test #7:

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

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 2 2
83473 27443 
1 3 

input:

1 96539 2 2
83473 27443 
1 3 

output:

83473

result:

ok 

Test #8:

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

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 1 1
115 
2 

input:

1 52817 1 1
115 
2 

output:

52817

result:

ok 

Test #9:

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

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 50001 1
57259 
50000 

input:

1 14195 50001 1
57259 
50000 

output:

57259

result:

ok 

Test #10:

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

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 50001 2
40787 12325 
50000 50002 

input:

1 15020 50001 2
40787 12325 
50000 50002 

output:

40787

result:

ok 

Test #11:

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

input:

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

output:

1 2 5 1
5 
4 

input:

1 2 5 1
5 
4 

output:

5

result:

ok 

Test #12:

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

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 86421 2
89366 28752 
86420 86422 

input:

1 58067 86421 2
89366 28752 
86420 86422 

output:

89366

result:

ok 

Test #13:

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

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 8321 2
30431 93535 
8320 8322 

input:

1 33281 8321 2
30431 93535 
8320 8322 

output:

30431

result:

ok 

Test #14:

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

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 13212 1
72220 
13211 

input:

1 23253 13212 1
72220 
13211 

output:

72220

result:

ok 

Test #15:

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

input:

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

output:

1 2 5 1
5 
4 

input:

1 2 5 1
5 
4 

output:

5

result:

ok 

Test #16:

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

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 19 5
24830 16000 85236 56668 9570 
20 20 20 18 20 

input:

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

output:

56668

result:

ok 

Test #17:

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

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 32 7
983 90216 7275 87818 17497 31675 83454 
33 33 33 31 33 33 33 

input:

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

output:

87818

result:

ok 

Test #18:

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

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 34 4
18334 73508 552 39167 
35 33 35 35 

input:

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

output:

73508

result:

ok 

Test #19:

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

input:

2 2 2 1
2 1

output:

1 2 1 1
1 
2 

input:

1 2 1 1
1 
2 

output:

2

result:

ok 

Test #20:

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

input:

2 1 1 1
2 1

output:

1 1 1 1
2 
2 

input:

1 1 1 1
2 
2 

output:

1

result:

ok 

Test #21:

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

input:

3 1 1 1
3 1
1 2

output:

1 1 1 2
3 2 
2 2 

input:

1 1 1 2
3 2 
2 2 

output:

1

result:

ok 

Test #22:

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

input:

3 1 3 1
2 3
1 2

output:

1 1 3 1
2 
2 

input:

1 1 3 1
2 
2 

output:

2

result:

ok 

Test #23:

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

input:

3 3 3 1
3 1
1 2

output:

1 3 1 1
1 
2 

input:

1 3 1 1
1 
2 

output:

3

result:

ok 

Test #24:

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

input:

3 1 3 1
1 2
3 2

output:

1 1 3 1
2 
2 

input:

1 1 3 1
2 
2 

output:

2

result:

ok 

Test #25:

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

input:

3 1 1 1
3 2
3 1

output:

1 1 1 1
3 
2 

input:

1 1 1 1
3 
2 

output:

1

result:

ok 

Subtask #2:

score: 0
Wrong Answer

Test #26:

score: 0
Wrong Answer
time: 14ms
memory: 8680kb

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 2 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 2 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:

wrong answer the value of V is bigger than 2

Subtask #3:

score: 0
Wrong Answer

Test #53:

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

input:

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

output:

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

input:

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

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

input:

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

output:

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

input:

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

output:

4

result:

wrong answer the value of V is bigger than 1