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 an undirected bipartite graph without multiple edges. You should paint the edges of graph to minimal number of colours, so that no two adjacent edges have the same colour. The first line contains three integers a, xe2 x80 x89b, xe2 x80 x89m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89a, xe2 x80 x89b xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891000, 0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105), a is the size of the first part, b is the size of the second part, m is the number of edges in the graph. Each of the next m lines contains two integers x, xe2 x80 x89y (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89x xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89a, xe2 x80 x891 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89y xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89b), where x is the number of the vertex in the first part and y is the number of the vertex in the second part. It is guaranteed that there are no multiple edges. In the first line print integer c -- the minimal number of colours. The second line should contain m integers from 1 to c -- the colours of the edges (in the order they appear in the input). If there are several solutions, you can print any one of them.'... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
20809226 |
Paniago |
F |
Sept. 22, 2016, 2:43 a.m. |
OK |
GNU C++ |
TESTS |
47 |
78 |
35635200 |
|
2900 |
22206350 |
laofudasuan |
F |
Nov. 14, 2016, 11:28 a.m. |
OK |
GNU C++ |
TESTS |
47 |
93 |
13107200 |
|
2900 |
28652487 |
dhuacm6 |
F |
July 18, 2017, 2:18 a.m. |
OK |
GNU C++ |
TESTS |
47 |
93 |
14643200 |
|
2900 |
28019941 |
dhuacm2 |
F |
June 25, 2017, 10:09 a.m. |
OK |
GNU C++ |
TESTS |
47 |
93 |
14643200 |
|
2900 |
28009806 |
dhuacm6 |
F |
June 24, 2017, 6:01 p.m. |
OK |
GNU C++ |
TESTS |
47 |
93 |
22323200 |
|
2900 |
20809361 |
Paniago |
F |
Sept. 22, 2016, 3:01 a.m. |
OK |
GNU C++ |
TESTS |
47 |
93 |
35635200 |
|
2900 |
21751206 |
iKID.Huy |
F |
Oct. 24, 2016, 3:23 p.m. |
OK |
GNU C++ |
TESTS |
47 |
93 |
35840000 |
|
2900 |
40227744 |
vjudge4 |
F |
July 12, 2018, 9:55 a.m. |
OK |
GNU C++ |
TESTS |
47 |
108 |
16179200 |
|
2900 |
37623871 |
vjudge3 |
F |
April 26, 2018, 3:43 a.m. |
OK |
GNU C++ |
TESTS |
47 |
108 |
16896000 |
|
2900 |
40232391 |
vjudge5 |
F |
July 12, 2018, 12:48 p.m. |
OK |
GNU C++ |
TESTS |
47 |
109 |
16384000 |
|
2900 |
22092942 |
CuSO45H2O |
F |
Nov. 7, 2016, 11:14 a.m. |
OK |
GNU C++11 |
TESTS |
47 |
46 |
12595200 |
|
2900 |
44542649 |
vjudge2 |
F |
Oct. 19, 2018, 12:11 p.m. |
OK |
GNU C++11 |
TESTS |
47 |
78 |
21299200 |
|
2900 |
21597066 |
YoungPhoenix |
F |
Oct. 19, 2016, 3:04 p.m. |
OK |
GNU C++11 |
TESTS |
47 |
93 |
15155200 |
|
2900 |
18649723 |
WorstCoder |
F |
June 22, 2016, 4:31 p.m. |
OK |
GNU C++11 |
TESTS |
47 |
93 |
17408000 |
|
2900 |
30797866 |
Toxel |
F |
Sept. 28, 2017, 7:42 a.m. |
OK |
GNU C++11 |
TESTS |
47 |
93 |
20480000 |
|
2900 |
44542660 |
Ithea_Myse_Valgulious |
F |
Oct. 19, 2018, 12:12 p.m. |
OK |
GNU C++11 |
TESTS |
47 |
93 |
21299200 |
|
2900 |
44542630 |
Fuko_Ibuki |
F |
Oct. 19, 2018, 12:11 p.m. |
OK |
GNU C++11 |
TESTS |
47 |
93 |
21299200 |
|
2900 |
35072627 |
Auto |
F |
Feb. 8, 2018, 9:19 p.m. |
OK |
GNU C++11 |
TESTS |
47 |
93 |
24678400 |
|
2900 |
62084961 |
Rockett |
F |
Oct. 8, 2019, 12:45 a.m. |
OK |
GNU C++11 |
TESTS |
47 |
93 |
35532800 |
|
2900 |
36212705 |
RNS_MHB |
F |
March 12, 2018, 12:42 a.m. |
OK |
GNU C++11 |
TESTS |
47 |
108 |
11776000 |
|
2900 |
46814491 |
imxian |
F |
Dec. 9, 2018, 12:01 p.m. |
OK |
GNU C++14 |
TESTS |
47 |
77 |
25395200 |
|
2900 |
61872273 |
Jubair_2147483647 |
F |
Oct. 4, 2019, 6:40 p.m. |
OK |
GNU C++14 |
TESTS |
47 |
77 |
34508800 |
|
2900 |
53848122 |
DougNobrega |
F |
May 7, 2019, 12:08 p.m. |
OK |
GNU C++14 |
TESTS |
47 |
78 |
35532800 |
|
2900 |
53847727 |
DougNobrega |
F |
May 7, 2019, 11:56 a.m. |
OK |
GNU C++14 |
TESTS |
47 |
92 |
35737600 |
|
2900 |
58492413 |
Bartholomew |
F |
Aug. 9, 2019, 10:30 a.m. |
OK |
GNU C++14 |
TESTS |
47 |
93 |
9625600 |
|
2900 |
29455827 |
NiroBC |
F |
Aug. 14, 2017, 10:31 a.m. |
OK |
GNU C++14 |
TESTS |
47 |
93 |
11161600 |
|
2900 |
37880095 |
kut_kjb1994 |
F |
May 4, 2018, 10:26 a.m. |
OK |
GNU C++14 |
TESTS |
47 |
93 |
23756800 |
|
2900 |
53847958 |
DougNobrega |
F |
May 7, 2019, 12:03 p.m. |
OK |
GNU C++14 |
TESTS |
47 |
93 |
35532800 |
|
2900 |
28673367 |
shadowatyy |
F |
July 18, 2017, 4:20 p.m. |
OK |
GNU C++14 |
TESTS |
47 |
93 |
37785600 |
|
2900 |
27614989 |
t3a |
F |
June 6, 2017, 1:32 p.m. |
OK |
GNU C++14 |
TESTS |
47 |
93 |
50176000 |
|
2900 |
66599191 |
yorky |
F |
Dec. 10, 2019, 3:52 p.m. |
OK |
GNU C++17 |
TESTS |
47 |
93 |
10444800 |
|
2900 |
49958510 |
Holidin |
F |
Feb. 15, 2019, 5:05 p.m. |
OK |
GNU C++17 |
TESTS |
47 |
93 |
81612800 |
|
2900 |
57948520 |
Benq |
F |
July 29, 2019, 3:22 p.m. |
OK |
GNU C++17 |
TESTS |
47 |
108 |
12492800 |
|
2900 |
54335850 |
vjudge3 |
F |
May 18, 2019, 8:06 a.m. |
OK |
GNU C++17 |
TESTS |
47 |
108 |
33075200 |
|
2900 |
58135938 |
Shayan.P |
F |
Aug. 1, 2019, 4:06 p.m. |
OK |
GNU C++17 |
TESTS |
47 |
109 |
13107200 |
|
2900 |
58135842 |
Shayan.P |
F |
Aug. 1, 2019, 4:04 p.m. |
OK |
GNU C++17 |
TESTS |
47 |
109 |
13107200 |
|
2900 |
62042173 |
AlexPanda |
F |
Oct. 7, 2019, 6:20 a.m. |
OK |
GNU C++17 |
TESTS |
47 |
109 |
13312000 |
|
2900 |
61361953 |
Lrztxdy |
F |
Sept. 27, 2019, 12:25 p.m. |
OK |
GNU C++17 |
TESTS |
47 |
109 |
16384000 |
|
2900 |
50860046 |
supremeyu |
F |
March 5, 2019, 5:54 p.m. |
OK |
GNU C++17 |
TESTS |
47 |
109 |
16691200 |
|
2900 |
62050426 |
vjudge4 |
F |
Oct. 7, 2019, 9:16 a.m. |
OK |
GNU C++17 |
TESTS |
47 |
109 |
33075200 |
|
2900 |
23478910 |
Ali.Pi |
F |
Jan. 1, 2017, 6:19 a.m. |
OK |
Haskell |
TESTS |
47 |
826 |
93696000 |
|
2900 |
19385371 |
pavel.rosputko |
F |
July 24, 2016, 2:13 p.m. |
OK |
Haskell |
TESTS |
47 |
841 |
48844800 |
|
2900 |
64718155 |
Oom |
F |
Nov. 12, 2019, 12:47 a.m. |
OK |
Java 8 |
TESTS |
47 |
217 |
15769600 |
|
2900 |
remove filters
Back to search problems