Codeforces Round 286 (Div. 1)

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
506 Codeforces Round 286 (Div. 1) FINISHED False 7200 315853187 Jan. 18, 2015, 1 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2210 ) D Mr. Kitayuta's Colorful Graph PROGRAMMING brute force dfs and similar ds graphs 2300

B"Mr. Kitayuta has just bought an undirected graph with n vertices and m edges. The vertices of the graph are numbered from 1 to n. Each edge, namely edge i, has a color ci, connecting vertex ai and bi. Mr. Kitayuta wants you to process the following q queries. In the i-th query, he gives you two integers - ui and vi. Find the number of the colors that satisfy the following condition: the edges of that color connect vertex ui and vertex vi directly or indirectly. The first line of the input contains space-separated two integers - n and 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), denoting the number of the vertices and the number of the edges, respectively. The next m lines contain space-separated three integers - ai, bi(1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89< xe2 x80 x89bi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) and ci(1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ci xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m). Note that there can be multiple edges between two vertices. However, there are no multiple edges of the same color between two vertices, that is, if i xe2 x80 x89 xe2 x89 xa0 xe2 x80 x89j, xe2 x80 x89(ai, xe2 x80 x89bi, xe2 x80 x89ci) xe2 x80 x89 xe2 x89 xa0 xe2 x80 x89(aj, xe2 x80 x89bj, xe2 x80 x89cj). The next line contains a integer- q(1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89q xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105), denoting the number of the queries. Then follows q lines, containing space-separated two integers - ui and vi(1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ui, xe2 x80 x89vi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n). It is guaranteed that ui xe2 x80 x89 xe2 x89 xa0 xe2 x80 x89vi. For each query, print the answer in a separate line. Let's consider the first sample. "...

Tutorials

Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
9462603 Alex_2oo8 D Jan. 18, 2015, 2:26 p.m. OK FPC TESTS 51 826 208384000 2300
24146083 imathi D Jan. 26, 2017, 10:55 a.m. OK GNU C++ TESTS 51 124 30720000 2300
40987436 ReaLNero1 D July 30, 2018, 9:15 p.m. OK GNU C++ TESTS 51 139 28569600 2300
24146117 vjudge5 D Jan. 26, 2017, 10:57 a.m. OK GNU C++ TESTS 51 139 30822400 2300
9490288 anhhung4u D Jan. 21, 2015, 7:48 a.m. OK GNU C++ TESTS 51 140 14438400 2300
9472945 BSBandme D Jan. 19, 2015, 7:59 a.m. OK GNU C++ TESTS 51 140 23040000 2300
25660881 Stupid_cdd D March 20, 2017, 7:26 a.m. OK GNU C++ TESTS 51 155 13107200 2300
25711053 ray_bb D March 22, 2017, 12:34 p.m. OK GNU C++ TESTS 51 171 29491200 2300
9567336 hzt1 D Jan. 27, 2015, 2:02 a.m. OK GNU C++ TESTS 51 171 150323200 2300
9567165 hzt1 D Jan. 27, 2015, 1:35 a.m. OK GNU C++ TESTS 51 171 150323200 2300
10703993 DemiGuo D April 14, 2015, 12:44 p.m. OK GNU C++ TESTS 51 187 27955200 2300
9462446 ikatanic D Jan. 18, 2015, 2:24 p.m. OK GNU C++0x TESTS 51 202 11673600 2300
9462504 andrew.volchek D Jan. 18, 2015, 2:25 p.m. OK GNU C++0x TESTS 51 202 17100800 2300
9475120 xing89qs D Jan. 19, 2015, 11:43 a.m. OK GNU C++0x TESTS 51 233 11776000 2300
9475110 xing89qs D Jan. 19, 2015, 11:43 a.m. OK GNU C++0x TESTS 51 233 11776000 2300
9466038 sanma D Jan. 18, 2015, 4:50 p.m. OK GNU C++0x TESTS 51 234 10240000 2300
9513444 aaaaajack D Jan. 23, 2015, 12:57 p.m. OK GNU C++0x TESTS 51 249 8499200 2300
9968630 Pudge123 D Feb. 23, 2015, 11:46 a.m. OK GNU C++0x TESTS 51 249 14336000 2300
9462171 yukim D Jan. 18, 2015, 2:19 p.m. OK GNU C++0x TESTS 51 280 16076800 2300
9460700 sdya D Jan. 18, 2015, 1:59 p.m. OK GNU C++0x TESTS 51 295 36966400 2300
9459977 MiFaFaOvO D Jan. 18, 2015, 1:50 p.m. OK GNU C++0x TESTS 51 296 20275200 2300
60458690 rainboy D Sept. 12, 2019, 7:18 p.m. OK GNU C11 TESTS 51 1231 5734400 2300
11380356 zhj D June 1, 2015, 2:54 p.m. OK GNU C++11 TESTS 51 171 27955200 2300
69958124 vjudge2 D Feb. 1, 2020, 10:42 a.m. OK GNU C++11 TESTS 51 171 27955200 2300
37389052 Denverjin D April 17, 2018, 7:22 a.m. OK GNU C++11 TESTS 51 233 267468800 2300
15966404 Bekmyrat.A D Feb. 12, 2016, 6:05 a.m. OK GNU C++11 TESTS 51 264 204902400 2300
27349404 Mhammad1 D May 26, 2017, 5:59 a.m. OK GNU C++11 TESTS 51 265 215347200 2300
10686016 KuchumovIlya D April 12, 2015, 7:22 p.m. OK GNU C++11 TESTS 51 280 10035200 2300
43553047 vjudge4 D Sept. 29, 2018, 3:15 a.m. OK GNU C++11 TESTS 51 280 14131200 2300
43553064 vjudge3 D Sept. 29, 2018, 3:16 a.m. OK GNU C++11 TESTS 51 280 14131200 2300
43553075 vjudge3 D Sept. 29, 2018, 3:17 a.m. OK GNU C++11 TESTS 51 280 14233600 2300
37389002 Denverjin D April 17, 2018, 7:18 a.m. OK GNU C++11 TESTS 51 280 197324800 2300
58686404 shaanknight D Aug. 12, 2019, 11:51 p.m. OK GNU C++14 TESTS 51 156 62054400 2300
58686605 shaanknight D Aug. 13, 2019, 12:06 a.m. OK GNU C++14 TESTS 51 186 70246400 2300
45336476 Arg_007 D Nov. 5, 2018, 5:55 p.m. OK GNU C++14 TESTS 51 187 27852800 2300
58686400 shaanknight D Aug. 12, 2019, 11:50 p.m. OK GNU C++14 TESTS 51 187 62054400 2300
58686412 shaanknight D Aug. 12, 2019, 11:51 p.m. OK GNU C++14 TESTS 51 202 62054400 2300
58686408 shaanknight D Aug. 12, 2019, 11:51 p.m. OK GNU C++14 TESTS 51 233 62054400 2300
26036898 khatribiru D March 31, 2017, 9:38 p.m. OK GNU C++14 TESTS 51 234 60723200 2300
27638538 WuHongxun D June 7, 2017, 12:47 p.m. OK GNU C++14 TESTS 51 249 8601600 2300
55741640 _Ash__ D June 19, 2019, 7:46 a.m. OK GNU C++14 TESTS 51 249 13721600 2300
26036924 khatribiru D March 31, 2017, 9:39 p.m. OK GNU C++14 TESTS 51 249 58777600 2300
68027478 DerekFeng D Jan. 1, 2020, 6:56 a.m. OK GNU C++17 TESTS 51 249 14438400 2300
42735681 redotter D Sept. 10, 2018, 1:42 p.m. OK GNU C++17 TESTS 51 327 192921600 2300
68080451 DerekFeng D Jan. 2, 2020, 2:11 p.m. OK GNU C++17 TESTS 51 420 10752000 2300
68030039 DerekFeng D Jan. 1, 2020, 8:41 a.m. OK GNU C++17 TESTS 51 421 58163200 2300
62650593 saketh D Oct. 15, 2019, 9:28 p.m. OK GNU C++17 TESTS 51 452 6656000 2300
47507707 vjudge2 D Dec. 26, 2018, 3:11 a.m. OK GNU C++17 TESTS 51 499 18636800 2300
47507592 vjudge5 D Dec. 26, 2018, 3:01 a.m. OK GNU C++17 TESTS 51 499 60313600 2300
47507589 nimphy D Dec. 26, 2018, 3:01 a.m. OK GNU C++17 TESTS 51 514 60313600 2300
47507629 vjudge1 D Dec. 26, 2018, 3:04 a.m. OK GNU C++17 TESTS 51 530 60313600 2300
42735525 redotter D Sept. 10, 2018, 1:38 p.m. OK GNU C++17 TESTS 51 545 52940800 2300
9473367 darnley D Jan. 19, 2015, 8:40 a.m. OK Java 7 TESTS 51 1528 122777600 2300
9470897 uwi D Jan. 19, 2015, 4:28 a.m. OK Java 7 TESTS 51 2449 27443200 2300
9464574 hiukim D Jan. 18, 2015, 2:55 p.m. OK Java 7 TESTS 51 2558 53657600 2300
9505610 edorundo D Jan. 22, 2015, 7:20 p.m. OK Java 7 TESTS 51 3119 84377600 2300
9462538 alexey.enkov D Jan. 18, 2015, 2:25 p.m. OK Java 7 TESTS 51 3431 39833600 2300
10037432 odorf D Feb. 26, 2015, 8:38 p.m. OK Java 7 TESTS 51 3463 150732800 2300
17313188 alibaba D April 14, 2016, 11:10 a.m. OK Java 7 TESTS 51 3556 21913600 2300
9464694 VArtem D Jan. 18, 2015, 2:56 p.m. OK Java 8 TESTS 51 561 13107200 2300
9465840 qwerty787788 D Jan. 18, 2015, 4:37 p.m. OK Java 8 TESTS 51 561 19558400 2300
9467939 pashka D Jan. 18, 2015, 9:25 p.m. OK Java 8 TESTS 51 732 259174400 2300
54886363 Ahmad D May 31, 2019, 5:32 p.m. OK Java 8 TESTS 51 1309 79974400 2300
9473404 darnley D Jan. 19, 2015, 8:45 a.m. OK Java 8 TESTS 51 1559 121651200 2300
60458420 Dukkha D Sept. 12, 2019, 7:08 p.m. OK Java 8 TESTS 51 1575 5836800 2300
10666581 hama-du D April 12, 2015, 11:59 a.m. OK Java 8 TESTS 51 2089 10649600 2300
11965546 IgorKoval D July 7, 2015, 11:32 p.m. OK Java 8 TESTS 51 2168 40857600 2300
11965535 IgorKoval D July 7, 2015, 11:29 p.m. OK Java 8 TESTS 51 2230 41267200 2300
9460818 ilyakor D Jan. 18, 2015, 2:01 p.m. OK Java 8 TESTS 51 2246 48947200 2300
9829574 camypaper D Feb. 14, 2015, 3:19 p.m. OK MS C# TESTS 51 1107 36352000 2300
36129579 Nelearin D March 9, 2018, 8:22 p.m. OK MS C# TESTS 51 1497 50585600 2300
36128268 Nelearin D March 9, 2018, 7:26 p.m. OK MS C# TESTS 51 1513 50892800 2300
36126110 Nelearin D March 9, 2018, 6:05 p.m. OK MS C# TESTS 51 1543 49971200 2300
35695419 Nelearin D Feb. 25, 2018, 4:43 p.m. OK MS C# TESTS 51 1544 49971200 2300
36128357 Nelearin D March 9, 2018, 7:30 p.m. OK MS C# TESTS 51 1544 51097600 2300
36128689 Nelearin D March 9, 2018, 7:44 p.m. OK MS C# TESTS 51 1621 51097600 2300
9463738 azukun D Jan. 18, 2015, 2:44 p.m. OK MS C# TESTS 51 2480 116940800 2300
10256309 Carups D March 13, 2015, 10:32 a.m. OK MS C++ TESTS 51 249 223232000 2300
9461050 ainta D Jan. 18, 2015, 2:04 p.m. OK MS C++ TESTS 51 265 116940800 2300
9464432 mjy0503 D Jan. 18, 2015, 2:54 p.m. OK MS C++ TESTS 51 373 8601600 2300
9462258 Milanin D Jan. 18, 2015, 2:21 p.m. OK MS C++ TESTS 51 390 11264000 2300
9463666 Im_too_old_for_this_shit D Jan. 18, 2015, 2:43 p.m. OK MS C++ TESTS 51 405 12902400 2300
9464226 vml D Jan. 18, 2015, 2:51 p.m. OK MS C++ TESTS 51 592 26521600 2300
9945978 absi2011 D Feb. 21, 2015, 8:30 a.m. OK MS C++ TESTS 51 607 218214400 2300
10301775 gxnncrx1993 D March 16, 2015, 3:58 p.m. OK MS C++ TESTS 51 624 197120000 2300
10253752 2015222 D March 13, 2015, 5:18 a.m. OK MS C++ TESTS 51 764 80588800 2300
10253743 2015222 D March 13, 2015, 5:16 a.m. OK MS C++ TESTS 51 904 119808000 2300
35891262 suibaka D March 3, 2018, 3:09 p.m. OK Rust TESTS 51 3322 116838400 2300
35891305 vjudge4 D March 3, 2018, 3:10 p.m. OK Rust TESTS 51 3462 116940800 2300

remove filters

Back to search problems