Solutions are presented as using the least memory and the fastest execution time. It also takes the top
10 most recent solutions from each language. If you want to limit to a specific index, click the
"Solved" button and go to that problem.
Problems
B"You are given a directed acyclic graph with n vertices and m edges. There are no self-loops or multiple edges between any pair of vertices. Graph can be disconnected. You should assign labels to all vertices in such a way that: Find such sequence of labels to satisfy all the conditions. The first line contains two integer numbers n, m (2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105, xe2 x80 x891 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). Next m lines contain two integer numbers v and u (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89v, xe2 x80 x89u xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xe2 x80 x89v xe2 x80 x89 xe2 x89 xa0 xe2 x80 x89u) -- edges of the graph. Edges are directed, graph doesn't contain loops or multiple edges. Print n numbers -- lexicographically smallest correct permutation of labels of vertices. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
30126478 |
dinhquyduc13021 |
E |
Sept. 6, 2017, 8:47 a.m. |
OK |
FPC |
TESTS |
19 |
187 |
28160000 |
|
2400 |
30109161 |
huw |
E |
Sept. 5, 2017, 3:58 p.m. |
OK |
FPC |
TESTS |
19 |
202 |
6860800 |
|
2400 |
30246071 |
toida12chu |
E |
Sept. 10, 2017, 1:22 p.m. |
OK |
FPC |
TESTS |
19 |
249 |
3686400 |
|
2400 |
28730015 |
WARenie |
E |
July 20, 2017, 4:55 p.m. |
OK |
FPC |
TESTS |
19 |
249 |
8192000 |
|
2400 |
33824108 |
AsahiKasugano |
E |
Dec. 31, 2017, 3:18 a.m. |
OK |
FPC |
TESTS |
19 |
264 |
12390400 |
|
2400 |
28835396 |
jkxjkx1031 |
E |
July 24, 2017, 3:04 p.m. |
OK |
GNU C |
TESTS |
19 |
62 |
4300800 |
|
2400 |
33213681 |
Scut82 |
E |
Dec. 13, 2017, 12:54 p.m. |
OK |
GNU C++ |
TESTS |
19 |
31 |
5632000 |
|
2400 |
40980578 |
ReaLNero1 |
E |
July 30, 2018, 5:35 p.m. |
OK |
GNU C++ |
TESTS |
19 |
31 |
28057600 |
|
2400 |
28610069 |
yasugongshang |
E |
July 16, 2017, 4:21 p.m. |
OK |
GNU C++ |
TESTS |
19 |
31 |
30208000 |
|
2400 |
32135433 |
Idvzchuscvol |
E |
Nov. 8, 2017, 8:45 a.m. |
OK |
GNU C++ |
TESTS |
19 |
46 |
2867200 |
|
2400 |
40826307 |
Wuweizheng |
E |
July 27, 2018, 3:13 a.m. |
OK |
GNU C++ |
TESTS |
19 |
46 |
3891200 |
|
2400 |
32095716 |
Ultflash |
E |
Nov. 6, 2017, 12:39 p.m. |
OK |
GNU C++ |
TESTS |
19 |
61 |
3072000 |
|
2400 |
41207964 |
vjudge4 |
E |
Aug. 4, 2018, 8:52 a.m. |
OK |
GNU C++ |
TESTS |
19 |
61 |
3276800 |
|
2400 |
28691269 |
lawyerphx |
E |
July 19, 2017, 8:58 a.m. |
OK |
GNU C++ |
TESTS |
19 |
61 |
5120000 |
|
2400 |
33234698 |
Scut82 |
E |
Dec. 14, 2017, 9:11 a.m. |
OK |
GNU C++ |
TESTS |
19 |
61 |
5632000 |
|
2400 |
35889809 |
yuanwei |
E |
March 3, 2018, 2:46 p.m. |
OK |
GNU C++ |
TESTS |
19 |
61 |
5939200 |
|
2400 |
43429853 |
BriMon |
E |
Sept. 25, 2018, 11:55 p.m. |
OK |
GNU C++11 |
TESTS |
19 |
46 |
3072000 |
|
2400 |
43399633 |
YoungNeal |
E |
Sept. 25, 2018, 7:46 a.m. |
OK |
GNU C++11 |
TESTS |
19 |
46 |
3072000 |
|
2400 |
43363853 |
luogu_bot2 |
E |
Sept. 24, 2018, 11:12 a.m. |
OK |
GNU C++11 |
TESTS |
19 |
46 |
3072000 |
|
2400 |
43363823 |
207M |
E |
Sept. 24, 2018, 11:11 a.m. |
OK |
GNU C++11 |
TESTS |
19 |
46 |
3072000 |
|
2400 |
44115642 |
vjudge2 |
E |
Oct. 11, 2018, 2 p.m. |
OK |
GNU C++11 |
TESTS |
19 |
46 |
3481600 |
|
2400 |
64527564 |
zclong |
E |
Nov. 8, 2019, 2:17 p.m. |
OK |
GNU C++11 |
TESTS |
19 |
46 |
3584000 |
|
2400 |
44543132 |
vjudge5 |
E |
Oct. 19, 2018, 12:24 p.m. |
OK |
GNU C++11 |
TESTS |
19 |
46 |
3584000 |
|
2400 |
56753532 |
lokyo |
E |
July 9, 2019, 12:55 p.m. |
OK |
GNU C++11 |
TESTS |
19 |
46 |
3891200 |
|
2400 |
44907081 |
luogu_bot3 |
E |
Oct. 26, 2018, 11:58 a.m. |
OK |
GNU C++11 |
TESTS |
19 |
46 |
4608000 |
|
2400 |
29210773 |
vjudge2 |
E |
Aug. 5, 2017, 6:07 a.m. |
OK |
GNU C++11 |
TESTS |
19 |
46 |
5427200 |
|
2400 |
33866802 |
newgate |
E |
Jan. 2, 2018, 3:34 p.m. |
OK |
GNU C++14 |
TESTS |
19 |
31 |
25497600 |
|
2400 |
30941275 |
zhangzy |
E |
Oct. 2, 2017, 11:44 a.m. |
OK |
GNU C++14 |
TESTS |
19 |
46 |
4096000 |
|
2400 |
28627151 |
LiChenKoh |
E |
July 17, 2017, 5:11 a.m. |
OK |
GNU C++14 |
TESTS |
19 |
46 |
5734400 |
|
2400 |
29127665 |
fnoi2014xtx |
E |
Aug. 2, 2017, 11:04 a.m. |
OK |
GNU C++14 |
TESTS |
19 |
62 |
5017600 |
|
2400 |
28794794 |
Taco |
E |
July 23, 2017, 7:36 a.m. |
OK |
GNU C++14 |
TESTS |
19 |
62 |
5017600 |
|
2400 |
28689025 |
Grunt |
E |
July 19, 2017, 7:51 a.m. |
OK |
GNU C++14 |
TESTS |
19 |
62 |
5120000 |
|
2400 |
28675946 |
Egor.Lifar |
E |
July 18, 2017, 6:29 p.m. |
OK |
GNU C++14 |
TESTS |
19 |
62 |
7372800 |
|
2400 |
58421957 |
AlecSandra |
E |
Aug. 7, 2019, 8:08 a.m. |
OK |
GNU C++14 |
TESTS |
19 |
77 |
3072000 |
|
2400 |
58381154 |
zstuycz |
E |
Aug. 6, 2019, 10:03 a.m. |
OK |
GNU C++14 |
TESTS |
19 |
77 |
3072000 |
|
2400 |
57255351 |
KevinWan |
E |
July 18, 2019, 2:12 a.m. |
OK |
GNU C++14 |
TESTS |
19 |
77 |
3788800 |
|
2400 |
53853450 |
vjudge5 |
E |
May 7, 2019, 2:39 p.m. |
OK |
GNU C++17 |
TESTS |
19 |
62 |
3481600 |
|
2400 |
64561901 |
vjudge3 |
E |
Nov. 9, 2019, 6:20 a.m. |
OK |
GNU C++17 |
TESTS |
19 |
62 |
3993600 |
|
2400 |
66309380 |
TAB_0905 |
E |
Dec. 5, 2019, 10:48 a.m. |
OK |
GNU C++17 |
TESTS |
19 |
77 |
3788800 |
|
2400 |
52226503 |
vjudge3 |
E |
April 2, 2019, 9:46 a.m. |
OK |
GNU C++17 |
TESTS |
19 |
77 |
3788800 |
|
2400 |
46006693 |
letmeC |
E |
Nov. 20, 2018, 5:22 p.m. |
OK |
GNU C++17 |
TESTS |
19 |
77 |
3788800 |
|
2400 |
64665832 |
Abdelrahman_Elhawary |
E |
Nov. 11, 2019, 2:06 a.m. |
OK |
GNU C++17 |
TESTS |
19 |
77 |
3891200 |
|
2400 |
57504617 |
vjudge1 |
E |
July 22, 2019, 11:34 a.m. |
OK |
GNU C++17 |
TESTS |
19 |
77 |
3891200 |
|
2400 |
47522285 |
vjudge2 |
E |
Dec. 26, 2018, 1:47 p.m. |
OK |
GNU C++17 |
TESTS |
19 |
77 |
3891200 |
|
2400 |
46819076 |
vjudge4 |
E |
Dec. 9, 2018, 2:03 p.m. |
OK |
GNU C++17 |
TESTS |
19 |
77 |
3891200 |
|
2400 |
68040154 |
tranquanghuy |
E |
Jan. 1, 2020, 1:56 p.m. |
OK |
GNU C++17 |
TESTS |
19 |
77 |
4198400 |
|
2400 |
28620204 |
uwi |
E |
July 16, 2017, 9:23 p.m. |
OK |
Java 8 |
TESTS |
19 |
171 |
20582400 |
|
2400 |
68146351 |
bluesky111 |
E |
Jan. 4, 2020, 4:38 a.m. |
OK |
Java 8 |
TESTS |
19 |
187 |
14233600 |
|
2400 |
66797124 |
unicorn20141 |
E |
Dec. 13, 2019, 5:27 p.m. |
OK |
Java 8 |
TESTS |
19 |
202 |
0 |
|
2400 |
45900960 |
AQT |
E |
Nov. 18, 2018, 4:43 a.m. |
OK |
Java 8 |
TESTS |
19 |
202 |
4505600 |
|
2400 |
55240650 |
vaibhavpulastya |
E |
June 7, 2019, 10:48 a.m. |
OK |
Java 8 |
TESTS |
19 |
217 |
4300800 |
|
2400 |
43701774 |
Ahmad |
E |
Oct. 2, 2018, 7 p.m. |
OK |
Java 8 |
TESTS |
19 |
218 |
4403200 |
|
2400 |
29323478 |
mualanhlung017 |
E |
Aug. 10, 2017, 10:15 a.m. |
OK |
Java 8 |
TESTS |
19 |
233 |
28262400 |
|
2400 |
55240231 |
sameep17264 |
E |
June 7, 2019, 10:34 a.m. |
OK |
Java 8 |
TESTS |
19 |
249 |
4198400 |
|
2400 |
68103905 |
Blastman |
E |
Jan. 3, 2020, 5:48 a.m. |
OK |
Java 8 |
TESTS |
19 |
249 |
4198400 |
|
2400 |
28611051 |
fnch |
E |
July 16, 2017, 4:29 p.m. |
OK |
Java 8 |
TESTS |
19 |
264 |
27955200 |
|
2400 |
28628507 |
ldt116 |
E |
July 17, 2017, 5:57 a.m. |
OK |
Kotlin |
TESTS |
19 |
889 |
56012800 |
|
2400 |
28686933 |
leign |
E |
July 19, 2017, 6:42 a.m. |
OK |
Mono C# |
TESTS |
19 |
186 |
21708800 |
|
2400 |
28747841 |
AnatolyTolstobrov |
E |
July 21, 2017, 10:50 a.m. |
OK |
MS C# |
TESTS |
19 |
156 |
26726400 |
|
2400 |
28747813 |
AnatolyTolstobrov |
E |
July 21, 2017, 10:49 a.m. |
OK |
MS C# |
TESTS |
19 |
218 |
27238400 |
|
2400 |
28685679 |
fr0st |
E |
July 19, 2017, 5:55 a.m. |
OK |
MS C# |
TESTS |
19 |
482 |
35328000 |
|
2400 |
29498099 |
fr0st |
E |
Aug. 16, 2017, 6:41 a.m. |
OK |
MS C# |
TESTS |
19 |
483 |
35942400 |
|
2400 |
29497812 |
fr0st |
E |
Aug. 16, 2017, 6:28 a.m. |
OK |
MS C# |
TESTS |
19 |
498 |
34713600 |
|
2400 |
64559646 |
vjudge3 |
E |
Nov. 9, 2019, 5:31 a.m. |
OK |
MS C++ |
TESTS |
19 |
62 |
4198400 |
|
2400 |
35924671 |
Nightmare_n |
E |
March 4, 2018, 1:49 p.m. |
OK |
MS C++ |
TESTS |
19 |
62 |
5324800 |
|
2400 |
44098636 |
vjudge3 |
E |
Oct. 11, 2018, 3:52 a.m. |
OK |
MS C++ |
TESTS |
19 |
77 |
4403200 |
|
2400 |
52221017 |
vjudge5 |
E |
April 2, 2019, 6:35 a.m. |
OK |
MS C++ |
TESTS |
19 |
77 |
6451200 |
|
2400 |
29819065 |
vjudge4 |
E |
Aug. 27, 2017, 5:05 a.m. |
OK |
MS C++ |
TESTS |
19 |
78 |
4198400 |
|
2400 |
28780621 |
egj1996 |
E |
July 22, 2017, 2:09 p.m. |
OK |
MS C++ |
TESTS |
19 |
78 |
5529600 |
|
2400 |
28894073 |
zkw159 |
E |
July 26, 2017, 5 a.m. |
OK |
MS C++ |
TESTS |
19 |
78 |
6144000 |
|
2400 |
29274640 |
bramandia |
E |
Aug. 8, 2017, 12:15 a.m. |
OK |
MS C++ |
TESTS |
19 |
93 |
6144000 |
|
2400 |
64566785 |
vjudge2 |
E |
Nov. 9, 2019, 7:56 a.m. |
OK |
MS C++ |
TESTS |
19 |
93 |
25702400 |
|
2400 |
28628241 |
merzgling |
E |
July 17, 2017, 5:48 a.m. |
OK |
MS C++ |
TESTS |
19 |
140 |
9420800 |
|
2400 |
57566674 |
920848348 |
E |
July 23, 2019, 3:15 a.m. |
OK |
MS C++ 2017 |
TESTS |
19 |
93 |
4915200 |
|
2400 |
57566778 |
vjudge3 |
E |
July 23, 2019, 3:17 a.m. |
OK |
MS C++ 2017 |
TESTS |
19 |
93 |
4915200 |
|
2400 |
40746967 |
Ali_Pi |
E |
July 25, 2018, 3:16 p.m. |
OK |
PyPy 2 |
TESTS |
19 |
685 |
16384000 |
|
2400 |
60686767 |
meooow |
E |
Sept. 16, 2019, 3:44 p.m. |
OK |
PyPy 3 |
TESTS |
19 |
436 |
18841600 |
|
2400 |
28643139 |
isgulkov |
E |
July 17, 2017, 2:55 p.m. |
OK |
Python 2 |
TESTS |
19 |
639 |
15360000 |
|
2400 |
28908040 |
the_silliest |
E |
July 26, 2017, 2:53 p.m. |
OK |
Python 3 |
TESTS |
19 |
577 |
19968000 |
|
2400 |
28701325 |
ArGuTe |
E |
July 19, 2017, 4:25 p.m. |
OK |
Python 3 |
TESTS |
19 |
670 |
19456000 |
|
2400 |
60687060 |
meooow |
E |
Sept. 16, 2019, 3:50 p.m. |
OK |
Python 3 |
TESTS |
19 |
685 |
11468800 |
|
2400 |
28648221 |
yan4ik |
E |
July 17, 2017, 8:05 p.m. |
OK |
Python 3 |
TESTS |
19 |
826 |
38092800 |
|
2400 |
remove filters
Back to search problems