Codeforces Round 407 (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
788 Codeforces Round 407 (Div. 1) FINISHED False 7200 285602123 March 29, 2017, 4:05 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 409 ) D Finding lines PROGRAMMING constructive algorithms divide and conquer interactive 2900

After some programming contest Roma decided to try himself in tourism. His home country Uzhlyandia is a Cartesian plane. He wants to walk along each of the Main Straight Lines in Uzhlyandia. It is known that each of these lines is a straight line parallel to one of the axes (i.e. it is described with the equation x = a or y = a , where a is integer called the coordinate of this line). Roma lost his own map, so he should find out the coordinates of all lines at first. Uncle Anton agreed to help him, using the following rules: Initially Roma doesn't know the number of vertical and horizontal lines and their coordinates; Roma can announce integer coordinates of some point in Uzhlandia, and Anton then will tell him the minimum among the distances from the chosen point to each of the lines. However, since the coordinates of the lines don't exceed 10 8 by absolute value, Roma can't choose a point with coordinates exceeding 10 8 by absolute value. Uncle Anton is in a hurry to the UOI (Uzhlandian Olympiad in Informatics), so he can only answer no more than 3·10 5 questions. The problem is that Roma doesn't know how to find out the coordinates of the lines. Write a program that plays Roma's role and finds the coordinates. There is no input initially. Your program should make queries to get information. It is guaranteed that the number of horizontal and vertical lines is at least 1 and less than or equal to 10 4 for each type. To make a query, print a line " 0 x y " (- 10 8 ≤ x , y ≤ 10 8 ), where x and y are the coordinates of the point. After each query you need to print end-of-line, make " flush " operation, and then read the answer to the query — the minimum among the distances prom this point to the Main Straight Lines of Uzhlyandia. You can do no more than 3·10 5 queries. When you are ready to print the answer, print three lines: In the first line print " 1 n m ", where n is the number of vertical lines (parallel to OY ), and m is the number of horizontal line

Tutorials

Codeforces Round #407(Div.1 + Div.2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
25949525 Nicolas16 D March 30, 2017, 11:06 a.m. OK GNU C++ TESTS 89 374 2764800 2900
25949308 Nicolas16 D March 30, 2017, 10:58 a.m. OK GNU C++ TESTS 89 389 2764800 2900
27365532 fanzhirui D May 27, 2017, 1:04 a.m. OK GNU C++ TESTS 89 421 4710400 2900
27451814 Scut82 D May 30, 2017, 4:07 p.m. OK GNU C++ TESTS 89 452 409600 2900
26785444 cbhcbh D May 1, 2017, 12:33 p.m. OK GNU C++ TESTS 89 452 3379200 2900
27791820 Chloe_fan D June 15, 2017, 11:01 a.m. OK GNU C++ TESTS 89 467 409600 2900
36560251 26319 D March 24, 2018, 2:19 a.m. OK GNU C++ TESTS 89 467 3788800 2900
36506022 Spylft D March 22, 2018, 2:23 p.m. OK GNU C++ TESTS 89 483 3788800 2900
36467195 vjudge2 D March 22, 2018, 1:32 a.m. OK GNU C++ TESTS 89 498 3891200 2900
36503954 Spylft D March 22, 2018, 1:24 p.m. OK GNU C++ TESTS 89 498 4710400 2900
27316364 150137 D May 24, 2017, 7:57 a.m. OK GNU C++11 TESTS 89 374 409600 2900
25934733 krijgertje D March 29, 2017, 9:15 p.m. OK GNU C++11 TESTS 89 389 2150400 2900
25965462 stczhc D March 30, 2017, 11:48 p.m. OK GNU C++11 TESTS 89 404 2560000 2900
27366454 YxuanwKeith D May 27, 2017, 3:18 a.m. OK GNU C++11 TESTS 89 405 921600 2900
34534234 RNS3 D Jan. 25, 2018, 3:13 a.m. OK GNU C++11 TESTS 89 405 2355200 2900
25915181 Um_nik D March 29, 2017, 5:06 p.m. OK GNU C++11 TESTS 89 421 2457600 2900
26511281 FizzyDavid D April 20, 2017, 8:47 a.m. OK GNU C++11 TESTS 89 436 2355200 2900
26043257 matthew99 D April 1, 2017, 5:18 a.m. OK GNU C++11 TESTS 89 436 2355200 2900
26104610 aid D April 3, 2017, 4:34 p.m. OK GNU C++11 TESTS 89 436 2457600 2900
25939395 Syloviaely D March 30, 2017, 3:17 a.m. OK GNU C++11 TESTS 89 436 3379200 2900
25932297 marX D March 29, 2017, 7:48 p.m. OK GNU C++14 TESTS 89 420 3174400 2900
26068193 bibibibi D April 2, 2017, 3:04 a.m. OK GNU C++14 TESTS 89 452 2457600 2900
25949281 koratel D March 30, 2017, 10:57 a.m. OK GNU C++14 TESTS 89 452 2764800 2900
27670498 I_Love_Umirzhanova_Amina D June 8, 2017, 11:53 a.m. OK GNU C++14 TESTS 89 467 1126400 2900
25932844 King_George D March 29, 2017, 8 p.m. OK GNU C++14 TESTS 89 482 2457600 2900
25924944 Shik D March 29, 2017, 5:49 p.m. OK GNU C++14 TESTS 89 482 3072000 2900
26043116 thai9cdb1 D April 1, 2017, 5:11 a.m. OK GNU C++14 TESTS 89 483 2457600 2900
25958735 liujunhao D March 30, 2017, 4:40 p.m. OK GNU C++14 TESTS 89 483 2457600 2900
25970143 pps789 D March 31, 2017, 7:21 a.m. OK GNU C++14 TESTS 89 483 2969600 2900
25944952 Philipsweng D March 30, 2017, 8:09 a.m. OK GNU C++14 TESTS 89 483 2969600 2900
39896218 Nazikk D July 3, 2018, 2:11 p.m. OK GNU C++17 TESTS 89 795 3584000 2900
42091777 VladaMG98 D Aug. 25, 2018, 1:40 p.m. OK GNU C++17 TESTS 89 810 10342400 2900
50096459 vjudge4 D Feb. 18, 2019, 12:59 p.m. OK GNU C++17 TESTS 89 842 921600 2900
58411389 Romeolong D Aug. 7, 2019, 1:52 a.m. OK GNU C++17 TESTS 89 904 1228800 2900
53075381 vladalos D April 20, 2019, 8:47 p.m. OK GNU C++17 TESTS 89 1013 1331200 2900
68729243 kefaa2 D Jan. 13, 2020, 7:12 p.m. OK GNU C++17 TESTS 89 1497 819200 2900
68729097 kefaa2 D Jan. 13, 2020, 7:09 p.m. OK GNU C++17 TESTS 89 1669 819200 2900
68728792 kefaa2 D Jan. 13, 2020, 7:01 p.m. OK GNU C++17 TESTS 89 2168 819200 2900
51120000 Shayan.P D March 10, 2019, 8:47 a.m. OK GNU C++17 TESTS 89 2246 512000 2900
45247868 antontrygubO_o D Nov. 3, 2018, 2:52 p.m. OK GNU C++17 TESTS 89 2542 1024000 2900
25936305 mmaxio D March 29, 2017, 11:13 p.m. OK Java 8 TESTS 89 2121 20684800 2900
25955953 AnatolyTolstobrov D March 30, 2017, 2:42 p.m. OK MS C# TESTS 89 920 14745600 2900
25955871 AnatolyTolstobrov D March 30, 2017, 2:39 p.m. OK MS C# TESTS 89 2137 14540800 2900
25976970 Yurik D March 31, 2017, 11:29 a.m. OK MS C++ TESTS 89 717 2662400 2900

remove filters

Back to search problems