QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#142405#1139. StationsAbdelmagedNour#0 2ms3800kbC++20725b2023-08-19 02:42:162024-07-04 01:48:09

Judging History

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

  • [2024-07-04 01:48:09]
  • 评测
  • 测评结果:0
  • 用时:2ms
  • 内存:3800kb
  • [2023-08-19 02:42:16]
  • 提交

stations

#include <bits/stdc++.h>
//#include "stub.cpp"
using namespace std;
#include "stations.h"
int id;
vector<vector<int>>adj;
vector<int>labels;
void dfs(int v, int p, int d) {
	if(!d)labels[v]=id;
	id++;
	for(auto u:adj[v]){
        if(u==p)continue;
        dfs(u,v,d^1);
    }
	if(d)labels[v]=id;
	id++;
}
vector<int>label(int n,int k,vector<int>u,vector<int>v){
	labels.assign(n,-1);
    adj.assign(n,{});
    id=0;
    dfs(0,0,0);
	return labels;
}
int find_next_station(int s,int t,vector<int>c){
	if(s<c[0]){
		if(t<s||t>=c.back())return c.back();
		return *lower_bound(c.begin(),c.end(),t);
	}
	if(t>s||t<=c[0])return c[0];
	return *--upper_bound(c.begin(),c.end(),t);
    return c[0];
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

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

input:

0
10
10 1000
4 5
9 0
2 6
5 2
8 3
1 4
8 1
6 0
3 7
3 1000
0 1
1 2
998 1000
166 178
393 452
389 179
622 429
892 866
872 18
899 227
835 637
587 769
504 386
369 577
65 441
523 17
803 221
878 321
637 892
696 473
16 146
840 322
495 986
353 275
330 585
831 402
719 810
704 830
780 940
53 901
894 911
394 482
...

output:

10
0
-1
-1
-1
-1
-1
-1
-1
-1
-1
3
0
-1
-1
998
0
-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
-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
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

input:

1
-1
0

output:


result:

FAIL Unexpected end of file - int32 expected (/opt/uoj/judger/uoj_judger/work/channel_2_answer.txt)

Subtask #2:

score: 0
Wrong Answer

Test #11:

score: 0
Wrong Answer
time: 0ms
memory: 3652kb

input:

0
10
996 1000
0 1
2 0
1 3
4 1
5 2
6 2
7 3
3 8
4 9
10 4
11 5
12 5
6 13
14 6
7 15
7 16
17 8
18 8
19 9
9 20
21 10
10 22
23 11
24 11
12 25
26 12
27 13
13 28
14 29
30 14
15 31
15 32
16 33
34 16
35 17
17 36
18 37
38 18
39 19
40 19
41 20
42 20
43 21
44 21
45 22
46 22
23 47
48 23
49 24
24 50
25 51
52 25
26 ...

output:

996
0
-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
-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
-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
-1
-1
...

input:

1
-1
0

output:


result:

FAIL Unexpected end of file - int32 expected (/opt/uoj/judger/uoj_judger/work/channel_2_answer.txt)

Subtask #3:

score: 0
Wrong Answer

Test #17:

score: 0
Wrong Answer
time: 0ms
memory: 3648kb

input:

0
10
2 1000000
1 0
997 1000000
830 513
223 672
727 200
763 415
581 440
34 42
267 325
912 693
753 59
401 289
198 641
982 214
41 49
453 107
940 806
905 732
153 482
248 405
102 79
480 837
534 620
564 856
679 178
278 247
899 206
333 672
297 308
407 863
26 752
272 178
204 603
208 10
715 562
785 285
184 5...

output:

2
0
-1
997
0
-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
-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
-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...

input:

1
-1
0

output:


result:

FAIL Unexpected end of file - int32 expected (/opt/uoj/judger/uoj_judger/work/channel_2_answer.txt)

Subtask #4:

score: 0
Wrong Answer

Test #34:

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

input:

0
10
2 1000000000
0 1
2 1000000000
0 1
2 1000000000
1 0
2 1000000000
1 0
2 1000000000
0 1
2 1000000000
1 0
2 1000000000
1 0
2 1000000000
0 1
2 1000000000
0 1
2 1000000000
0 1

output:

2
0
-1
2
0
-1
2
0
-1
2
0
-1
2
0
-1
2
0
-1
2
0
-1
2
0
-1
2
0
-1
2
0
-1

input:

1
-1
0

output:


result:

FAIL Unexpected end of file - int32 expected (/opt/uoj/judger/uoj_judger/work/channel_2_answer.txt)

Subtask #5:

score: 0
Wrong Answer

Test #54:

score: 0
Wrong Answer
time: 0ms
memory: 3584kb

input:

0
10
3 1000000000
1 0
2 1
998 1000000000
928 443
90 795
55 379
957 417
759 300
960 136
309 858
833 370
228 827
876 955
619 365
15 108
243 388
54 925
141 894
272 634
0 989
600 346
380 277
350 113
326 613
975 946
660 98
34 538
220 864
9 585
185 860
458 424
509 14
22 275
109 872
153 233
76 834
972 736
...

output:

3
0
-1
-1
998
0
-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
-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
-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...

input:

1
-1
0

output:


result:

FAIL Unexpected end of file - int32 expected (/opt/uoj/judger/uoj_judger/work/channel_2_answer.txt)