QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#43711#1212. Navigationaaaaaa0 14ms8020kbC++141.0kb2022-08-10 10:47:432023-01-16 13:46:07

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-01-16 13:46:07]
  • 评测
  • 测评结果:0
  • 用时:14ms
  • 内存:8020kb
  • [2022-08-10 10:47:43]
  • 提交

Anna

#include <bits/stdc++.h>
#include "Annalib.h"
const int N = 100010;
namespace gf {
	int h[N], c;
	struct node {
		int nxt, to;
	} a[N];
	void init () {
		c = 0;
		memset (h, 0, sizeof (h));
	}
	void add (int x, int y) {
		a[++c].nxt = h[x];
		a[c].to = y;
		h[x] = c;
		a[++c].nxt = h[y];
		a[c].to = x;
		h[y] = c;
	}
}
#define gffor(gf,i,u) for (int i = gf::h[u]; i != 0; i = gf::a[i].nxt)
int flag[N];
void dfs (int u, int fa) {
	gffor (gf, i, u) {
		int v = gf::a[i].to;
		if (v == fa) {
			continue;
		}
		if (v > u) {
			flag[v] = (flag[u] ^ 1);
		} else {
			flag[v] = flag[u];
		}
		dfs (v, u);
	}
}
void Anna (int K, int N, int T, int A[], int B[]) {
	for (int i = 0; i <= N - 2; i++) {
		gf::add (A[i], B[i]);
	}
	dfs (T, -1);
	for (int i = 1; i <= N; i++) {
		Flag (i, flag[i]);
	}
}

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 ((S < P[i]) ^ F ^ Q[i]) {
			Answer (P[i]);
			return;
		}
	}
	Answer (S);
	return;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Stage 1: Program Program Time Limit Exceeded

Test #1:

score: 0
Stage 1: Program Program Time Limit Exceeded

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:


input:


output:


result:


Subtask #2:

score: 0
Stage 1: Program Program Time Limit Exceeded

Test #26:

score: 0
Stage 1: Program Program Time Limit Exceeded

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:


input:


output:


result:


Subtask #3:

score: 0
Stage 1: Program Program Memory Limit Exceeded

Test #53:

score: 20
Accepted
time: 4ms
memory: 5756kb

input:

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

output:

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

input:

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

output:

1

result:

ok 

Test #54:

score: 20
Accepted
time: 4ms
memory: 7724kb

input:

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

output:

3 5 0 1
4 
1 

input:

3 5 0 1
4 
1 

output:

4

result:

ok 

Test #55:

score: 20
Accepted
time: 6ms
memory: 7884kb

input:

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

output:

3 2 0 1
4 
0 

input:

3 2 0 1
4 
0 

output:

4

result:

ok 

Test #56:

score: 20
Accepted
time: 14ms
memory: 8020kb

input:

50000 34879 23464 3
34879 15963
18721 34879
34879 10106
18364 34879
34879 23006
15487 34879
48356 34879
29325 34879
49428 34879
34879 33232
34879 11053
25243 34879
1729 34879
28816 34879
34879 28832
6766 34879
38567 34879
16292 34879
34879 12983
34879 39259
34879 12547
38228 34879
10922 34879
35635 ...

output:

3 34879 1 49999
15963 18721 10106 18364 23006 15487 48356 29325 49428 33232 11053 25243 1729 28816 28832 6766 38567 16292 12983 39259 12547 38228 10922 35635 35095 29959 12379 32853 14075 47835 35673 37166 32219 26253 17599 2709 46140 16178 29606 48367 20875 30557 37853 306 48005 19363 12031 26274 9...

input:

3 34879 1 49999
15963 18721 10106 18364 23006 15487 48356 29325 49428 33232 11053 25243 1729 28816 28832 6766 38567 16292 12983 39259 12547 38228 10922 35635 35095 29959 12379 32853 14075 47835 35673 37166 32219 26253 17599 2709 46140 16178 29606 48367 20875 30557 37853 306 48005 19363 12031 26274 9...

output:

23464

result:

ok 

Test #57:

score: 20
Accepted
time: 6ms
memory: 7800kb

input:

50000 23915 16691 3
5730 47713
5730 30001
5730 37173
5730 48062
5730 47318
25627 5730
38604 5730
5554 5730
28931 5730
5730 4971
8248 5730
2646 5730
5611 5730
42980 5730
5730 11640
5730 5440
15681 5730
41594 5730
5730 3925
24489 5730
28880 5730
5730 22654
5730 40596
5730 42786
35298 5730
33116 5730
5...

output:

3 23915 1 1
5730 
0 

input:

3 23915 1 1
5730 
0 

output:

5730

result:

ok 

Test #58:

score: 20
Accepted
time: 6ms
memory: 7740kb

input:

50000 21541 21500 3
21500 28433
40076 21500
21500 44511
23826 21500
38374 21500
13185 21500
33217 21500
21500 29688
21500 41527
21500 36460
46072 21500
21500 3314
49915 21500
21500 111
25720 21500
7768 21500
48085 21500
38431 21500
44557 21500
41668 21500
21500 44992
21500 6887
21500 20065
21500 222...

output:

3 21541 1 1
21500 
0 

input:

3 21541 1 1
21500 
0 

output:

21500

result:

ok 

Test #59:

score: 20
Accepted
time: 6ms
memory: 7896kb

input:

50000 46350 23808 3
41775 4812
41775 25985
7373 41775
41775 21281
34476 41775
29680 41775
41775 31678
41775 45771
41775 7651
15726 41775
23964 41775
5022 41775
41775 35007
43947 41775
41775 7035
41775 40944
41775 7621
41775 24012
38543 41775
23389 41775
41775 5274
41775 16534
41775 29419
16250 41775...

output:

3 46350 0 1
41775 
1 

input:

3 46350 0 1
41775 
1 

output:

41775

result:

ok 

Test #60:

score: 20
Accepted
time: 2ms
memory: 5848kb

input:

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

output:

3 8 1 1
2 
0 

input:

3 8 1 1
2 
0 

output:

2

result:

ok 

Test #61:

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

input:

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

output:

3 2 0 3
5 8 4 
1 1 0 

input:

3 2 0 3
5 8 4 
1 1 0 

output:

4

result:

ok 

Test #62:

score: 20
Accepted
time: 4ms
memory: 5740kb

input:

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

output:

3 4 0 1
3 
1 

input:

3 4 0 1
3 
1 

output:

3

result:

ok 

Test #63:

score: 20
Accepted
time: 4ms
memory: 5756kb

input:

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

output:

3 2 1 3
7 1 6 
1 1 0 

input:

3 2 1 3
7 1 6 
1 1 0 

output:

7

result:

ok 

Test #64:

score: 20
Accepted
time: 4ms
memory: 5672kb

input:

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

output:

3 2 0 1
5 
0 

input:

3 2 0 1
5 
0 

output:

5

result:

ok 

Test #65:

score: 0
Stage 1: Program Program Memory Limit Exceeded

input:

99998 87386 58198 3
85465 2972
82055 13745
90944 2989
22869 2304
83782 38621
75141 77939
16283 28026
37731 94249
69186 67502
32120 24562
13030 45973
51269 5775
71907 93802
43291 61040
31976 48691
86121 90698
67358 96244
25898 5756
92398 19735
68317 57405
85257 19812
37326 11401
27210 8208
90462 2661...

output:


input:


output:


result:


Subtask #4:

score: 0
Stage 1: Program Program Time Limit Exceeded

Test #85:

score: 55
Accepted
time: 4ms
memory: 5704kb

input:

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

output:

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

input:

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

output:

4

result:

ok 

Test #86:

score: 55
Accepted
time: 2ms
memory: 5844kb

input:

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

output:

4 2 0 1
5 
1 

input:

4 2 0 1
5 
1 

output:

2

result:

ok 

Test #87:

score: 55
Accepted
time: 4ms
memory: 5704kb

input:

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

output:

4 5 1 1
4 
0 

input:

4 5 1 1
4 
0 

output:

4

result:

ok 

Test #88:

score: 55
Accepted
time: 4ms
memory: 5840kb

input:

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

output:

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

input:

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

output:

5

result:

ok 

Test #89:

score: 0
Stage 1: Program Program Time Limit Exceeded

input:

100000 26342 56884 4
26342 46282
85015 26342
78181 26342
26342 55212
26342 56473
26342 22060
26342 25078
26342 20025
29747 26342
26342 28742
46830 26342
26342 18889
98909 26342
92001 26342
20688 26342
54802 26342
26342 29222
76143 26342
26342 85266
26342 6260
26342 60268
4638 26342
90626 26342
26342...

output:


input:


output:


result: