Codeforces Beta Round 30 (Codeforces format)

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
30 Codeforces Beta Round 30 (Codeforces format) FINISHED False 7200 490978780 Sept. 24, 2010, 3 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 493 ) D King's Problem? PROGRAMMING geometry greedy 2600

Every true king during his life must conquer the world, hold the Codeforces world finals, win pink panda in the shooting gallery and travel all over his kingdom. King Copa has already done the first three things. Now he just needs to travel all over the kingdom. The kingdom is an infinite plane with Cartesian coordinate system on it. Every city is a point on this plane. There are n cities in the kingdom at points with coordinates (x1, 0), (x2, 0), ..., (xn, 0), and there is one city at point (xn + 1, yn + 1). King starts his journey in the city number k. Your task is to find such route for the king, which visits all cities (in any order) and has minimum possible length. It is allowed to visit a city twice. The king can end his journey in any city. Between any pair of cities there is a direct road with length equal to the distance between the corresponding points. No two cities may be located at the same point. The first line contains two integers n and k (1 ≤ n ≤ 105, 1 ≤ k ≤ n + 1) -- amount of cities and index of the starting city. The second line contains n + 1 numbers xi. The third line contains yn + 1. All coordinates are integers and do not exceed 106 by absolute value. No two cities coincide. Output the minimum possible length of the journey. Your answer must have relative or absolute error less than 10 - 6.

Tutorials

Codeforces Beta Round #30. Разбор C

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
970711 zanoes D Dec. 21, 2011, 3:05 p.m. OK FPC TESTS 132 90 2662400 2600
970706 zanoes D Dec. 21, 2011, 3:03 p.m. OK FPC TESTS 132 90 2662400 2600
459562 Sereja D May 19, 2011, 4:13 p.m. OK FPC TESTS 132 90 5427200 2600
2414485 luogan D Oct. 22, 2012, 11:34 p.m. OK FPC TESTS 132 93 819200 2600
9509137 ljz D Jan. 23, 2015, 7:55 a.m. OK FPC TESTS 132 124 1740800 2600
3427705 vlad107 D March 31, 2013, 2:16 p.m. OK FPC TESTS 132 140 3993600 2600
3705305 zscc D May 12, 2013, 8:10 a.m. OK FPC TESTS 132 187 3174400 2600
10647957 ez_cjb D April 10, 2015, 12:04 p.m. OK FPC TESTS 132 312 3174400 2600
2875357 shyoshyohw1 D Jan. 5, 2013, 2:54 p.m. OK GNU C++ TESTS 132 46 409600 2600
2868562 littlefriend D Jan. 3, 2013, 8:16 a.m. OK GNU C++ TESTS 132 46 1228800 2600
41005240 ReaLNero1 D July 31, 2018, 9:18 a.m. OK GNU C++ TESTS 132 62 204800 2600
14004322 kasumi_utako D Nov. 1, 2015, 9:28 a.m. OK GNU C++ TESTS 132 62 409600 2600
5380068 equation314 D Dec. 8, 2013, 5:37 a.m. OK GNU C++ TESTS 132 62 409600 2600
5380062 equation314 D Dec. 8, 2013, 5:36 a.m. OK GNU C++ TESTS 132 62 409600 2600
5358251 ycdfwzy D Dec. 6, 2013, 4:43 a.m. OK GNU C++ TESTS 132 62 409600 2600
3724172 suyufeng D May 15, 2013, 3:40 p.m. OK GNU C++ TESTS 132 62 409600 2600
3233912 noh4h_ss D March 3, 2013, 10:46 a.m. OK GNU C++ TESTS 132 62 409600 2600
2824204 BenZ D Dec. 25, 2012, 3:26 a.m. OK GNU C++ TESTS 132 62 409600 2600
2796429 llj_bash D Dec. 20, 2012, 12:46 a.m. OK GNU C++0x TESTS 132 62 409600 2600
2803667 apia D Dec. 21, 2012, 12:16 p.m. OK GNU C++0x TESTS 132 78 409600 2600
8101513 zshi D Oct. 6, 2014, 4:48 a.m. OK GNU C++0x TESTS 132 92 2355200 2600
6725495 FancyCoder D May 28, 2014, 7:39 a.m. OK GNU C++0x TESTS 132 92 16179200 2600
2674961 Archon.JK D Nov. 28, 2012, 9:51 p.m. OK GNU C++0x TESTS 132 93 819200 2600
9473506 zeyuanxy D Jan. 19, 2015, 8:55 a.m. OK GNU C++0x TESTS 132 154 204800 2600
2747245 dc. D Dec. 10, 2012, 12:30 p.m. OK GNU C++0x TESTS 132 734 1228800 2600
3910030 lemur D June 17, 2013, 1:51 p.m. OK GNU C++0x TESTS 132 859 921600 2600
16507335 isdkfj D March 4, 2016, 2:01 a.m. OK GNU C++11 TESTS 132 62 819200 2600
33863864 FlappyFish D Jan. 2, 2018, 12:43 p.m. OK GNU C++11 TESTS 132 62 2457600 2600
26099466 NThanhSon D April 3, 2017, 12:36 p.m. OK GNU C++11 TESTS 132 62 4096000 2600
41990854 PinkEx D Aug. 23, 2018, 8:45 a.m. OK GNU C++11 TESTS 132 92 409600 2600
14246793 munaiyi D Nov. 14, 2015, 1:42 a.m. OK GNU C++11 TESTS 132 92 819200 2600
27584597 jkz D June 5, 2017, 2:11 p.m. OK GNU C++11 TESTS 132 92 2048000 2600
19882725 Favorite D Aug. 15, 2016, 7:53 a.m. OK GNU C++11 TESTS 132 92 2355200 2600
33227841 hawkomg D Dec. 14, 2017, 1:16 a.m. OK GNU C++11 TESTS 132 92 2457600 2600
21319632 xiqiao D Oct. 9, 2016, 1:32 p.m. OK GNU C++11 TESTS 132 92 2457600 2600
17121419 freebsdx D April 2, 2016, 2:09 a.m. OK GNU C++11 TESTS 132 92 2867200 2600
35749766 Emma194 D Feb. 27, 2018, 2:41 a.m. OK GNU C++14 TESTS 132 92 2457600 2600
43431325 JU_RUO D Sept. 26, 2018, 1:32 a.m. OK GNU C++14 TESTS 132 122 409600 2600
30777841 vjudge4 D Sept. 27, 2017, 1:15 p.m. OK GNU C++14 TESTS 132 124 1228800 2600
48561375 Mandir_Wahi_Banayenge D Jan. 19, 2019, 7:30 a.m. OK GNU C++14 TESTS 132 124 2048000 2600
23375303 Ali.Pi D Dec. 28, 2016, 10:20 a.m. OK GNU C++14 TESTS 132 124 2662400 2600
23177882 mhxc D Dec. 20, 2016, 1:39 p.m. OK GNU C++14 TESTS 132 124 3891200 2600
21981839 yhy D Nov. 2, 2016, 4:31 a.m. OK GNU C++14 TESTS 132 156 409600 2600
24423150 SakurakoujiRuna D Feb. 4, 2017, 1:58 a.m. OK GNU C++14 TESTS 132 156 5120000 2600
34187976 Cyanic D Jan. 15, 2018, 3:24 a.m. OK GNU C++14 TESTS 132 186 2662400 2600
34187961 Cyanic D Jan. 15, 2018, 3:23 a.m. OK GNU C++14 TESTS 132 186 2662400 2600
39228919 kenimo D June 14, 2018, 12:57 a.m. OK GNU C++17 TESTS 132 124 409600 2600
60516294 MinecraftFuns D Sept. 14, 2019, 6:44 a.m. OK GNU C++17 TESTS 132 124 512000 2600
61783290 yuma_ D Oct. 3, 2019, 1:48 p.m. OK GNU C++17 TESTS 132 124 3379200 2600
62463025 hjk1030 D Oct. 13, 2019, 8:56 a.m. OK GNU C++17 TESTS 132 186 819200 2600
41955065 xuanquang1999 D Aug. 22, 2018, 5:54 a.m. OK GNU C++17 TESTS 132 342 819200 2600
40187088 Hamakaze D July 11, 2018, 2:42 a.m. OK GNU C++17 TESTS 132 1216 1024000 2600
40186848 Hamakaze D July 11, 2018, 2:29 a.m. OK GNU C++17 TESTS 132 1246 1024000 2600
130769 alexey.enkov D Sept. 24, 2010, 4:54 p.m. OK Java 6 TESTS 132 230 42905600 2600
130206 uwi D Sept. 24, 2010, 4:27 p.m. OK Java 6 TESTS 132 330 42905600 2600
129956 Egor D Sept. 24, 2010, 4:16 p.m. OK Java 6 TESTS 132 420 42905600 2600
132366 Thekid D Oct. 5, 2010, 3:45 a.m. OK Java 6 TESTS 132 440 43315200 2600
4787832 atubo D Oct. 15, 2013, 7:08 a.m. OK Java 6 TESTS 132 560 204800 2600
277396 RAVEman D Feb. 8, 2011, 6:45 p.m. OK Java 6 TESTS 132 1030 43417600 2600
16190604 mkirsche D Feb. 19, 2016, 2:31 a.m. OK Java 7 TESTS 132 310 0 2600
23667107 og.kostya D Jan. 9, 2017, 4:37 p.m. OK MS C# TESTS 132 186 13619200 2600
18644094 azukun D June 22, 2016, 9:43 a.m. OK MS C# TESTS 132 248 14336000 2600
132181 Alireza D Sept. 28, 2010, 10:24 a.m. OK MS C++ TESTS 132 80 2867200 2600
131707 Orfest D Sept. 25, 2010, 9:44 a.m. OK MS C++ TESTS 132 110 1843200 2600
132237 shou D Sept. 28, 2010, 4:29 p.m. OK MS C++ TESTS 132 110 5324800 2600
131794 Gerald D Sept. 25, 2010, 10:08 p.m. OK MS C++ TESTS 132 110 6144000 2600
132637 xhae D Nov. 4, 2010, 5:59 a.m. OK MS C++ TESTS 132 160 2969600 2600
132109 Borisp D Sept. 27, 2010, 9:19 p.m. OK MS C++ TESTS 132 160 4198400 2600
132040 t__nt D Sept. 27, 2010, 2:46 p.m. OK MS C++ TESTS 132 170 1740800 2600
1896446 Timur_Sitdikov D July 13, 2012, 6:12 a.m. OK MS C++ TESTS 132 170 3072000 2600
131387 slavik D Sept. 24, 2010, 7:44 p.m. OK MS C++ TESTS 132 190 9318400 2600
11911935 RoKi D July 3, 2015, 2:06 p.m. OK MS C++ TESTS 132 248 1638400 2600

remove filters

Back to search problems