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 |
|---|---|---|---|---|---|---|
| 500 | Good Bye 2014 | FINISHED | False | 9000 | 356454023 | Dec. 30, 2014, 3 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 168 ) | G | New Year Running | PROGRAMMING | number theory trees | 3000 |
New Year is coming in Tree Island! In this island, as the name implies, there are n cities connected by n - 1 roads, and for any two distinct cities there always exists exactly one path between them. For every person in Tree Island, it takes exactly one minute to pass by exactly one road. There is a weird New Year tradition for runnners in Tree Island, which is called "extreme run". This tradition can be done as follows. A runner chooses two distinct cities a and b . For simplicity, let's denote the shortest path from city a to city b as p 1 , p 2 , ..., p l (here, p 1 = a and p l = b holds). Then following happens: The runner starts at city a . The runner runs from city a to b , following the shortest path from city a to city b . When the runner arrives at city b , he turns his direction immediately (it takes no time), and runs towards city a , following the shortest path from city b to city a . When the runner arrives at city a , he turns his direction immediately (it takes no time), and runs towards city b , following the shortest path from city a to city b . Repeat step 3 and step 4 forever. In short, the course of the runner can be denoted as: Two runners JH and JY decided to run "extremely" in order to celebrate the New Year. JH has chosen two cities u and v , and JY has chosen two cities x and y . They decided to start running at the same moment, and run until they meet at the same city for the first time. Meeting on a road doesn't matter for them. Before running, they want to know the amount of time they will run. It is too hard for JH and JY to calculate this, so they ask you for help. The first line contains a single positive integer n ( 5 ≤ n ≤ 2 × 10 5 ) — the number of cities in Tree Island. Next n - 1 lines describe the roads of Tree Island. The i -th line ( 1 ≤ i ≤ n - 1 ) of them contains two space-separated integers a i and b i ( 1 ≤ a i , b i ≤ n , a i ≠ b i ) — the vertices connected by a single road of the tree. The next line contains a |
| Tutorial 2 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 18121530 | hehe0625 | G | May 27, 2016, 5:09 p.m. | OK | GNU C++ | TESTS | 70 | 873 | 31846400 | 3000 | |
| 35883886 | ______u______ | G | March 3, 2018, 1:03 p.m. | OK | GNU C++ | TESTS | 70 | 1169 | 28057600 | 3000 | |
| 35883547 | ______n______ | G | March 3, 2018, 12:56 p.m. | OK | GNU C++ | TESTS | 70 | 1169 | 28057600 | 3000 | |
| 35882800 | _____k_____ | G | March 3, 2018, 12:44 p.m. | OK | GNU C++ | TESTS | 70 | 1169 | 28057600 | 3000 | |
| 35875470 | _____i_____ | G | March 3, 2018, 8:18 a.m. | OK | GNU C++ | TESTS | 70 | 1169 | 28057600 | 3000 | |
| 35872277 | ______k______ | G | March 3, 2018, 7:07 a.m. | OK | GNU C++ | TESTS | 70 | 1169 | 28057600 | 3000 | |
| 35872202 | ______h______ | G | March 3, 2018, 7:04 a.m. | OK | GNU C++ | TESTS | 70 | 1169 | 28057600 | 3000 | |
| 35871531 | ______i______ | G | March 3, 2018, 6:52 a.m. | OK | GNU C++ | TESTS | 70 | 1169 | 28057600 | 3000 | |
| 35864307 | ______M______ | G | March 2, 2018, 11:06 p.m. | OK | GNU C++ | TESTS | 70 | 1169 | 28057600 | 3000 | |
| 20940539 | GentleSmile | G | Sept. 27, 2016, 8:29 a.m. | OK | GNU C++ | TESTS | 70 | 1325 | 28876800 | 3000 | |
| 69708011 | changle_cyx | G | Jan. 29, 2020, 5:42 a.m. | OK | GNU C++11 | TESTS | 70 | 265 | 41779200 | 3000 | |
| 69889640 | cxcxccx | G | Jan. 31, 2020, 9:32 a.m. | OK | GNU C++11 | TESTS | 70 | 390 | 41779200 | 3000 | |
| 57887239 | lopare | G | July 28, 2019, 10:28 a.m. | OK | GNU C++11 | TESTS | 70 | 451 | 212070400 | 3000 | |
| 57818487 | py_ultron | G | July 26, 2019, 9:12 p.m. | OK | GNU C++11 | TESTS | 70 | 452 | 212070400 | 3000 | |
| 38577845 | sagitta_luminis | G | May 24, 2018, 6:03 a.m. | OK | GNU C++11 | TESTS | 70 | 499 | 44339200 | 3000 | |
| 38578021 | sagitta_luminis | G | May 24, 2018, 6:14 a.m. | OK | GNU C++11 | TESTS | 70 | 530 | 212070400 | 3000 | |
| 40987477 | ReaLNero1 | G | July 30, 2018, 9:17 p.m. | OK | GNU C++11 | TESTS | 70 | 561 | 212070400 | 3000 | |
| 41394675 | jhdjames37 | G | Aug. 9, 2018, 10:21 a.m. | OK | GNU C++11 | TESTS | 70 | 951 | 27852800 | 3000 | |
| 17159412 | freebsdx | G | April 4, 2016, 2:43 p.m. | OK | GNU C++11 | TESTS | 70 | 1044 | 34816000 | 3000 | |
| 15142071 | HappyNewYearMike | G | Dec. 31, 2015, 10:07 p.m. | OK | GNU C++11 | TESTS | 70 | 1075 | 35225600 | 3000 | |
| 23506436 | Ali.Pi | G | Jan. 2, 2017, 8:53 p.m. | OK | GNU C++14 | TESTS | 70 | 1184 | 77926400 | 3000 | |
| 25972429 | la1la1la | G | March 31, 2017, 9:20 a.m. | OK | GNU C++14 | TESTS | 70 | 1762 | 30208000 | 3000 | |
| 25972278 | la1la1la | G | March 31, 2017, 9:11 a.m. | OK | GNU C++14 | TESTS | 70 | 1902 | 58470400 | 3000 | |
| 21257946 | Arpa | G | Oct. 7, 2016, 12:50 p.m. | OK | GNU C++14 | TESTS | 70 | 2230 | 54169600 | 3000 | |
| 21257621 | Arpa | G | Oct. 7, 2016, 12:35 p.m. | OK | GNU C++14 | TESTS | 70 | 2370 | 54169600 | 3000 | |
| 62311496 | ruo | G | Oct. 10, 2019, 2:02 p.m. | OK | GNU C++17 | TESTS | 70 | 1013 | 32256000 | 3000 | |
| 40731776 | Als123 | G | July 25, 2018, 7:57 a.m. | OK | GNU C++17 | TESTS | 70 | 1669 | 59289600 | 3000 |
Back to search problems