Codeforces Round 340 (Div. 2)

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
617 Codeforces Round 340 (Div. 2) FINISHED False 7200 278259899 Jan. 23, 2016, 3:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4878 ) C Watering Flowers PROGRAMMING implementation 1600

B"A flowerbed has many flowers and two fountains. You can adjust the water pressure and set any values r1(r1 xe2 x80 x89 xe2 x89 xa5 xe2 x80 x890) and r2(r2 xe2 x80 x89 xe2 x89 xa5 xe2 x80 x890), giving the distances at which the water is spread from the first and second fountain respectively. You have to set such r1 and r2 that all the flowers are watered, that is, for each flower, the distance between the flower and the first fountain doesn't exceed r1, or the distance to the second fountain doesn't exceed r2. It's OK if some flowers are watered by both fountains. You need to decrease the amount of water you need, that is set such r1 and r2 that all the flowers are watered and the r12 xe2 x80 x89+ xe2 x80 x89r22 is minimum possible. Find this minimum value. The first line of the input contains integers n, x1, y1, x2, y2 (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x892000, xe2 x80 x89- xe2 x80 x89107 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89x1, xe2 x80 x89y1, xe2 x80 x89x2, xe2 x80 x89y2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89107) -- the number of flowers, the coordinates of the first and the second fountain. Next follow n lines. The i-th of these lines contains integers xi and yi ( xe2 x80 x89- xe2 x80 x89107 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89xi, xe2 x80 x89yi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89107) -- the coordinates of the i-th flower. It is guaranteed that all n xe2 x80 x89+ xe2 x80 x892 points in the input are distinct. Print the minimum possible value r12 xe2 x80 x89+ xe2 x80 x89r22. Note, that in this problem optimal answer is always integer. The first sample is (r12 xe2 x80 x89= xe2 x80 x895, r22 xe2 x80 x89= xe2 x80 x891): The second sample is (r12 xe2 x80 x89= xe2 x80 x891, r22 xe2 x80 x89= xe2 x80 x8932): "...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
69449766 stuzjk C Jan. 24, 2020, 5:35 a.m. OK FPC TESTS 31 31 16281600 1600
47846072 NewbieMisis C Jan. 2, 2019, 2:45 p.m. OK FPC TESTS 31 62 102400 1600
36273471 njuoj C March 14, 2018, 11:42 a.m. OK GNU C++ TESTS 31 15 1843200 1600
36303734 njuoj C March 15, 2018, 2:03 p.m. OK GNU C++ TESTS 31 15 2150400 1600
36274741 njuoj C March 14, 2018, 12:15 p.m. OK GNU C++ TESTS 31 15 2150400 1600
36273614 njuoj C March 14, 2018, 11:45 a.m. OK GNU C++ TESTS 31 15 2150400 1600
35668013 vjudge1 C Feb. 25, 2018, 4:43 a.m. OK GNU C++ TESTS 31 15 2150400 1600
34992131 spsmoj2 C Feb. 7, 2018, 8:04 a.m. OK GNU C++ TESTS 31 15 2150400 1600
35092664 vjudge4 C Feb. 9, 2018, 2:07 p.m. OK GNU C++ TESTS 31 15 2252800 1600
38583215 vjudge4 C May 24, 2018, 10:37 a.m. OK GNU C++ TESTS 31 30 0 1600
36290914 njuoj C March 15, 2018, 5:37 a.m. OK GNU C++ TESTS 31 30 2252800 1600
36278642 njuoj C March 14, 2018, 2:14 p.m. OK GNU C++ TESTS 31 30 2252800 1600
56986721 rainboy C July 13, 2019, 4:08 p.m. OK GNU C11 TESTS 31 31 0 1600
53717184 about C May 3, 2019, 7:38 p.m. OK GNU C11 TESTS 31 31 14643200 1600
35994131 MarioBassem C March 6, 2018, 2:03 p.m. OK GNU C++11 TESTS 31 15 2252800 1600
36494018 dusCC C March 22, 2018, 9 a.m. OK GNU C++11 TESTS 31 15 3891200 1600
35442644 muht C Feb. 18, 2018, 10:13 a.m. OK GNU C++11 TESTS 31 15 5324800 1600
38474463 wxh571001500 C May 21, 2018, 5:18 a.m. OK GNU C++11 TESTS 31 30 102400 1600
36350092 SardarKhan C March 17, 2018, 9:58 a.m. OK GNU C++11 TESTS 31 30 3891200 1600
48719732 vjudge1 C Jan. 22, 2019, 1 p.m. OK GNU C++11 TESTS 31 31 0 1600
48590671 vjudge2 C Jan. 20, 2019, 1:50 a.m. OK GNU C++11 TESTS 31 31 0 1600
48590665 bourbonandgin C Jan. 20, 2019, 1:49 a.m. OK GNU C++11 TESTS 31 31 0 1600
68716142 vjudge2 C Jan. 13, 2020, 2:31 p.m. OK GNU C++11 TESTS 31 31 0 1600
65325261 vjudge1 C Nov. 19, 2019, 12:08 a.m. OK GNU C++11 TESTS 31 31 0 1600
55413811 Bekh C June 10, 2019, 11:11 p.m. OK GNU C++14 TESTS 31 15 102400 1600
57879941 badassBitch C July 28, 2019, 7:19 a.m. OK GNU C++14 TESTS 31 15 102400 1600
35005211 MR_Freeman C Feb. 7, 2018, 4:36 p.m. OK GNU C++14 TESTS 31 15 1945600 1600
36316273 njuoj C March 16, 2018, 4:23 a.m. OK GNU C++14 TESTS 31 15 3379200 1600
36896685 king_tsar C April 3, 2018, 8:37 a.m. OK GNU C++14 TESTS 31 15 3481600 1600
37884372 rawatds C May 4, 2018, 1:39 p.m. OK GNU C++14 TESTS 31 15 3481600 1600
48072951 cuom1999 C Jan. 8, 2019, 3:07 a.m. OK GNU C++14 TESTS 31 30 102400 1600
41532990 f4ded4k C Aug. 12, 2018, 3:40 p.m. OK GNU C++14 TESTS 31 30 204800 1600
41533065 f4ded4k C Aug. 12, 2018, 3:43 p.m. OK GNU C++14 TESTS 31 30 204800 1600
36304959 thebes C March 15, 2018, 2:45 p.m. OK GNU C++14 TESTS 31 30 1945600 1600
52343482 lonely_wind_ C April 5, 2019, 11:35 a.m. OK GNU C++17 TESTS 31 15 0 1600
52349018 vjudge1 C April 5, 2019, 1:49 p.m. OK GNU C++17 TESTS 31 15 0 1600
48662265 vjudge4 C Jan. 21, 2019, 6:30 a.m. OK GNU C++17 TESTS 31 15 307200 1600
48440165 vjudge4 C Jan. 16, 2019, 2:19 a.m. OK GNU C++17 TESTS 31 15 307200 1600
35659052 mima01 C Feb. 24, 2018, 7:40 p.m. OK GNU C++17 TESTS 31 15 1945600 1600
35743067 Qumeric C Feb. 26, 2018, 7:15 p.m. OK GNU C++17 TESTS 31 15 2048000 1600
57137863 vjudge4 C July 16, 2019, 9:37 a.m. OK GNU C++17 TESTS 31 30 0 1600
52349044 vjudge3 C April 5, 2019, 1:49 p.m. OK GNU C++17 TESTS 31 30 0 1600
59901169 Kartikeya_Singh03 C Sept. 2, 2019, 1:44 p.m. OK GNU C++17 TESTS 31 30 102400 1600
64352779 _lucifer_ C Nov. 6, 2019, 9:03 a.m. OK GNU C++17 TESTS 31 30 102400 1600
58550807 MohamedK C Aug. 10, 2019, 7:44 p.m. OK Java 8 TESTS 31 124 0 1600
54961464 TheSawan C June 2, 2019, 4:02 a.m. OK Java 8 TESTS 31 140 0 1600
35055452 radwasherif3 C Feb. 8, 2018, 11:14 a.m. OK Java 8 TESTS 31 140 20684800 1600
38121351 xiaowuc1 C May 11, 2018, 6:26 p.m. OK Java 8 TESTS 31 140 20787200 1600
58464203 YahiaSherif C Aug. 8, 2019, 6:23 p.m. OK Java 8 TESTS 31 155 0 1600
58386368 YahiaSherif C Aug. 6, 2019, 12:06 p.m. OK Java 8 TESTS 31 155 0 1600
39670420 YasmineMaheeb C June 26, 2018, 8:50 a.m. OK Java 8 TESTS 31 155 0 1600
39956714 Tarun C July 4, 2018, 1:24 p.m. OK Java 8 TESTS 31 156 0 1600
39673881 PolaMawaad C June 26, 2018, 11:23 a.m. OK Java 8 TESTS 31 156 0 1600
45892781 formalist C Nov. 17, 2018, 7:42 p.m. OK Java 8 TESTS 31 171 0 1600
43177302 vjudge2 C Sept. 21, 2018, 11:59 a.m. OK MS C++ TESTS 31 15 409600 1600
48567045 vjudge4 C Jan. 19, 2019, 10:07 a.m. OK MS C++ TESTS 31 31 0 1600
48445395 vjudge3 C Jan. 16, 2019, 7:10 a.m. OK MS C++ TESTS 31 31 0 1600
48476836 vjudge1 C Jan. 17, 2019, 3:19 a.m. OK MS C++ TESTS 31 31 102400 1600
48451178 vjudge2 C Jan. 16, 2019, 10:31 a.m. OK MS C++ TESTS 31 31 102400 1600
48446156 vjudge5 C Jan. 16, 2019, 7:36 a.m. OK MS C++ TESTS 31 31 102400 1600
48417986 vjudge5 C Jan. 15, 2019, 11:33 a.m. OK MS C++ TESTS 31 31 102400 1600
48697650 vjudge3 C Jan. 22, 2019, 12:14 a.m. OK MS C++ TESTS 31 31 204800 1600
44620833 FrankCai C Oct. 21, 2018, 6:14 a.m. OK MS C++ TESTS 31 31 307200 1600
44620826 vjudge1 C Oct. 21, 2018, 6:14 a.m. OK MS C++ TESTS 31 31 307200 1600
68715898 lcjWA C Jan. 13, 2020, 2:26 p.m. OK MS C++ 2017 TESTS 31 31 307200 1600
66134989 Mohamed_Ayman C Dec. 1, 2019, 11:52 a.m. OK PyPy 3 TESTS 31 249 4198400 1600
35895921 ______u______ C March 3, 2018, 4:57 p.m. OK Python 3 TESTS 31 77 5632000 1600
35887993 ______h______ C March 3, 2018, 2:13 p.m. OK Python 3 TESTS 31 77 5632000 1600
35887554 ______k______ C March 3, 2018, 2:06 p.m. OK Python 3 TESTS 31 77 5632000 1600
35886614 ______i______ C March 3, 2018, 1:50 p.m. OK Python 3 TESTS 31 77 5632000 1600
35884715 ______M______ C March 3, 2018, 1:15 p.m. OK Python 3 TESTS 31 77 5632000 1600
36146248 petiteteaparty C March 10, 2018, 9:59 a.m. OK Python 3 TESTS 31 93 6451200 1600
36901211 Incognito C April 3, 2018, 11:49 a.m. OK Python 3 TESTS 31 93 7065600 1600
36901773 Incognito C April 3, 2018, 12:10 p.m. OK Python 3 TESTS 31 109 7065600 1600
69286122 tushartyagi8750 C Jan. 22, 2020, 8:15 a.m. OK Python 3 TESTS 31 124 614400 1600
42136227 Mk_Python_v1 C Aug. 27, 2018, 12:16 a.m. OK Python 3 TESTS 31 139 102400 1600

remove filters

Back to search problems