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.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
739
|
Codeforces Round 381 (Div. 1) |
FINISHED |
False |
7200 |
257261063 |
Nov. 23, 2016, 4:35 p.m. |
Problems
B"Functional graph is a directed graph in which all vertices have outdegree equal to 1. Loops are allowed. Some vertices of a functional graph lay on a cycle. From the others we can come to a cycle by making a finite number of steps along the edges (we consider only finite functional graphs in this problem). Let's compute two values for each vertex. precyclei is the amount of edges we should pass to get to a vertex which is a part of some cycle (zero, if i itself lies on a cycle), cyclei is the length of the cycle we get to. You are given the information about these values for some functional graph. For each vertex you know the values precyclei and cyclei, however, instead of some values there can be the question mark. It means that these values are unknown. Build any functional graph that suits the description or determine that there is no such graph. The first line contains single integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89300) -- the number of vertices in the graph. Each of the next n lines contain two integers -- precyclei (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89precyclei xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89- xe2 x80 x891) and cyclei (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89cyclei xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n). There could be question marks instead of some of these values. In case there is no solution, print -1. Otherwise, print n integers. i-th of them is the number of vertex to which the edge form the i-th vertex go. The vertices should be in the same order as they go in input data. If there are multiple solutions, print any of them. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
50537319 |
Sanja |
D |
Feb. 26, 2019, 4:21 p.m. |
OK |
FPC |
TESTS |
187 |
31 |
13414400 |
|
3400 |
22898476 |
ELNUR.ktl |
D |
Dec. 12, 2016, 6:13 a.m. |
OK |
GNU C++ |
TESTS |
187 |
15 |
819200 |
|
3400 |
22489668 |
baxbaxa |
D |
Nov. 25, 2016, 1:21 p.m. |
OK |
GNU C++ |
TESTS |
187 |
31 |
819200 |
|
3400 |
40581734 |
Scut82 |
D |
July 20, 2018, 2:50 p.m. |
OK |
GNU C++ |
TESTS |
187 |
31 |
1843200 |
|
3400 |
24889147 |
Dylans |
D |
Feb. 22, 2017, 9:35 a.m. |
OK |
GNU C++ |
TESTS |
187 |
31 |
10444800 |
|
3400 |
22456453 |
Amirnasr |
D |
Nov. 24, 2016, 12:16 a.m. |
OK |
GNU C++ |
TESTS |
187 |
46 |
1024000 |
|
3400 |
22699360 |
WhyWhy |
D |
Dec. 4, 2016, 4:25 p.m. |
OK |
GNU C++ |
TESTS |
187 |
46 |
1331200 |
|
3400 |
24889104 |
Dylans |
D |
Feb. 22, 2017, 9:33 a.m. |
OK |
GNU C++ |
TESTS |
187 |
46 |
10444800 |
|
3400 |
36454893 |
XingGeRuCi |
D |
March 21, 2018, 1:18 p.m. |
OK |
GNU C++ |
TESTS |
187 |
108 |
10444800 |
|
3400 |
27766888 |
nonon |
D |
June 14, 2017, 3:55 a.m. |
OK |
GNU C++ |
TESTS |
187 |
140 |
2048000 |
|
3400 |
26654596 |
jiyutian |
D |
April 25, 2017, 7:11 a.m. |
OK |
GNU C++ |
TESTS |
187 |
140 |
3686400 |
|
3400 |
22529560 |
ielenik |
D |
Nov. 27, 2016, 3:43 p.m. |
OK |
GNU C++11 |
TESTS |
187 |
15 |
102400 |
|
3400 |
22593686 |
poursoul |
D |
Nov. 29, 2016, 7:52 a.m. |
OK |
GNU C++11 |
TESTS |
187 |
15 |
16179200 |
|
3400 |
22619813 |
liujunhao |
D |
Nov. 30, 2016, 10:58 a.m. |
OK |
GNU C++11 |
TESTS |
187 |
30 |
14848000 |
|
3400 |
22447769 |
Petr |
D |
Nov. 23, 2016, 6:24 p.m. |
OK |
GNU C++11 |
TESTS |
187 |
31 |
102400 |
|
3400 |
22486587 |
2360 |
D |
Nov. 25, 2016, 10:22 a.m. |
OK |
GNU C++11 |
TESTS |
187 |
31 |
1536000 |
|
3400 |
62063503 |
m_she |
D |
Oct. 7, 2019, 2:25 p.m. |
OK |
GNU C++11 |
TESTS |
187 |
31 |
4915200 |
|
3400 |
22489822 |
Vercingetorix |
D |
Nov. 25, 2016, 1:31 p.m. |
OK |
GNU C++11 |
TESTS |
187 |
31 |
10547200 |
|
3400 |
22619758 |
liujunhao |
D |
Nov. 30, 2016, 10:55 a.m. |
OK |
GNU C++11 |
TESTS |
187 |
31 |
14848000 |
|
3400 |
23484230 |
syc1999 |
D |
Jan. 1, 2017, 1:36 p.m. |
OK |
GNU C++11 |
TESTS |
187 |
31 |
20480000 |
|
3400 |
22450389 |
jcvb |
D |
Nov. 23, 2016, 7:16 p.m. |
OK |
GNU C++11 |
TESTS |
187 |
31 |
22016000 |
|
3400 |
22593432 |
NiroBC |
D |
Nov. 29, 2016, 7:35 a.m. |
OK |
GNU C++14 |
TESTS |
187 |
15 |
307200 |
|
3400 |
23364328 |
Ali.Pi |
D |
Dec. 27, 2016, 5:43 p.m. |
OK |
GNU C++14 |
TESTS |
187 |
15 |
16896000 |
|
3400 |
40983102 |
ReaLNero1 |
D |
July 30, 2018, 6:43 p.m. |
OK |
GNU C++14 |
TESTS |
187 |
31 |
307200 |
|
3400 |
22485915 |
ashmelev |
D |
Nov. 25, 2016, 9:29 a.m. |
OK |
GNU C++14 |
TESTS |
187 |
31 |
1126400 |
|
3400 |
27365705 |
WuHongxun |
D |
May 27, 2017, 1:35 a.m. |
OK |
GNU C++14 |
TESTS |
187 |
31 |
2969600 |
|
3400 |
38919150 |
chkhitu |
D |
June 3, 2018, 11:29 a.m. |
OK |
GNU C++14 |
TESTS |
187 |
31 |
3584000 |
|
3400 |
23004941 |
fqw |
D |
Dec. 15, 2016, 11:53 a.m. |
OK |
GNU C++14 |
TESTS |
187 |
46 |
307200 |
|
3400 |
22469047 |
la1la1la |
D |
Nov. 24, 2016, 2:29 p.m. |
OK |
GNU C++14 |
TESTS |
187 |
46 |
921600 |
|
3400 |
22458782 |
oyu8201 |
D |
Nov. 24, 2016, 4:50 a.m. |
OK |
GNU C++14 |
TESTS |
187 |
46 |
8396800 |
|
3400 |
22454755 |
Sarkin |
D |
Nov. 23, 2016, 9:03 p.m. |
OK |
GNU C++14 |
TESTS |
187 |
46 |
8396800 |
|
3400 |
43701734 |
staffik |
D |
Oct. 2, 2018, 6:59 p.m. |
OK |
GNU C++17 |
TESTS |
187 |
31 |
204800 |
|
3400 |
43700225 |
staffik |
D |
Oct. 2, 2018, 6:10 p.m. |
OK |
GNU C++17 |
TESTS |
187 |
31 |
204800 |
|
3400 |
43602054 |
staffik |
D |
Sept. 30, 2018, 10:39 a.m. |
OK |
GNU C++17 |
TESTS |
187 |
31 |
204800 |
|
3400 |
63075671 |
gongsuidashen |
D |
Oct. 21, 2019, 1:38 p.m. |
OK |
GNU C++17 |
TESTS |
187 |
31 |
14950400 |
|
3400 |
43419729 |
XTyuan |
D |
Sept. 25, 2018, 5:05 p.m. |
OK |
GNU C++17 |
TESTS |
187 |
31 |
30720000 |
|
3400 |
55836087 |
Benq |
D |
June 20, 2019, 3:24 p.m. |
OK |
GNU C++17 |
TESTS |
187 |
124 |
9113600 |
|
3400 |
69512683 |
vjudge3 |
D |
Jan. 25, 2020, 10:59 a.m. |
OK |
GNU C++17 |
TESTS |
187 |
171 |
241766400 |
|
3400 |
69570685 |
vjudge3 |
D |
Jan. 26, 2020, 1:59 p.m. |
OK |
GNU C++17 |
TESTS |
187 |
296 |
122368000 |
|
3400 |
64052949 |
majk |
D |
Nov. 1, 2019, 11 p.m. |
OK |
GNU C++17 |
TESTS |
187 |
405 |
4198400 |
|
3400 |
22454827 |
mmaxio |
D |
Nov. 23, 2016, 9:07 p.m. |
OK |
Java 8 |
TESTS |
187 |
935 |
31846400 |
|
3400 |
22454650 |
mmaxio |
D |
Nov. 23, 2016, 8:57 p.m. |
OK |
Java 8 |
TESTS |
187 |
1918 |
33382400 |
|
3400 |
remove filters
Back to search problems