Codeforces Round 198 (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
340 Codeforces Round 198 (Div. 2) FINISHED False 7200 353946599 Aug. 30, 2013, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4238 ) C Tourist Problem PROGRAMMING combinatorics implementation math 1700

B'Iahub is a big fan of tourists. He wants to become a tourist himself, so he planned a trip. There are n destinations on a straight road that Iahub wants to visit. Iahub starts the excursion from kilometer 0. The n destinations are described by a non-negative integers sequence a1, a2, ..., an. The number ak represents that the kth destination is at distance ak kilometers from the starting point. No two destinations are located in the same place. Iahub wants to visit each destination only once. Note that, crossing through a destination is not considered visiting, unless Iahub explicitly wants to visit it at that point. Also, after Iahub visits his last destination, he doesn 't come back to kilometer 0, as he stops his trip at the last destination. The distance between destination located at kilometer x and next destination, located at kilometer y, is |x xe2 x80 x89- xe2 x80 x89y| kilometers. We call a "route" an order of visiting the destinations. Iahub can visit destinations in any order he wants, as long as he visits all n destinations and he doesn 't visit a destination more than once. Iahub starts writing out on a paper all possible routes and for each of them, he notes the total distance he would walk. He 's interested in the average number of kilometers he would walk by choosing a route. As he got bored of writing out all the routes, he asks you to help him. The first line contains integer n (2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). Next line contains n distinct integers a1, a2, ..., an (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89107). Output two integers -- the numerator and denominator of a fraction which is equal to the wanted average number. The fraction must be irreducible. Consider 6 possible routes: The average travel distance is = = .'...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
4432396 BlackStar C Sept. 8, 2013, 1:48 p.m. OK Delphi TESTS 43 62 819200 1700
4432401 BlackStar C Sept. 8, 2013, 1:49 p.m. OK Delphi TESTS 43 62 819200 1700
4383015 Misha100896 C Aug. 30, 2013, 6:15 p.m. OK Delphi TESTS 43 62 819200 1700
4710781 AleksanderBalobanov C Oct. 8, 2013, 6:04 p.m. OK Delphi TESTS 43 92 2457600 1700
4709869 ruban C Oct. 8, 2013, 4:11 p.m. OK Delphi TESTS 43 92 5324800 1700
4377511 pal3 C Aug. 30, 2013, 4:29 p.m. OK FPC TESTS 43 62 409600 1700
5026460 llaugusty C Nov. 8, 2013, 3:19 a.m. OK FPC TESTS 43 62 1331200 1700
4381588 EG0R C Aug. 30, 2013, 5:23 p.m. OK FPC TESTS 43 62 10444800 1700
4381737 B.E.V. C Aug. 30, 2013, 5:25 p.m. OK FPC TESTS 43 62 10854400 1700
6940962 SanSiroWaltz C June 22, 2014, 7:26 a.m. OK FPC TESTS 43 92 409600 1700
6786164 giabao4498 C June 3, 2014, 8:55 a.m. OK FPC TESTS 43 92 409600 1700
12562181 VAVAvile C Aug. 16, 2015, 2:26 p.m. OK FPC TESTS 43 92 819200 1700
7059498 I_Love_Hanh_Trinh C July 10, 2014, 2:54 p.m. OK FPC TESTS 43 92 819200 1700
5411759 graceoflives C Dec. 11, 2013, 9:39 p.m. OK FPC TESTS 43 92 819200 1700
4381566 imyzard C Aug. 30, 2013, 5:23 p.m. OK FPC TESTS 43 92 819200 1700
4386297 alex_borisov C Aug. 31, 2013, 8:15 a.m. OK GNU C TESTS 43 62 409600 1700
4383577 xuehuww C Aug. 30, 2013, 6:55 p.m. OK GNU C TESTS 43 62 819200 1700
4402671 ikbal C Sept. 3, 2013, 6:39 p.m. OK GNU C TESTS 43 92 409600 1700
4386304 alex_borisov C Aug. 31, 2013, 8:16 a.m. OK GNU C TESTS 43 92 409600 1700
4381548 aabs08 C Aug. 30, 2013, 5:23 p.m. OK GNU C TESTS 43 92 409600 1700
4377407 tjandra C Aug. 30, 2013, 4:28 p.m. OK GNU C TESTS 43 92 409600 1700
4374767 picaso C Aug. 30, 2013, 4 p.m. OK GNU C TESTS 43 92 409600 1700
4374595 deepti C Aug. 30, 2013, 3:58 p.m. OK GNU C TESTS 43 92 409600 1700
6557628 vjudge5 C May 5, 2014, 2:28 p.m. OK GNU C TESTS 43 92 819200 1700
6557601 aa1jj54 C May 5, 2014, 2:26 p.m. OK GNU C TESTS 43 92 819200 1700
6940013 jdbermeol C June 21, 2014, 11:40 p.m. OK GNU C++ TESTS 43 30 409600 1700
4375809 angel_of_monkey C Aug. 30, 2013, 4:10 p.m. OK GNU C++ TESTS 43 30 409600 1700
4925867 liuaohanjsj C Oct. 28, 2013, 11:35 p.m. OK GNU C++ TESTS 43 31 409600 1700
4931734 pkwv C Oct. 30, 2013, 3:25 a.m. OK GNU C++ TESTS 43 46 1638400 1700
5920261 FunnyScientist C March 4, 2014, 9:06 a.m. OK GNU C++ TESTS 43 60 921600 1700
9512519 sdutacm2 C Jan. 23, 2015, 12:02 p.m. OK GNU C++ TESTS 43 62 204800 1700
30576926 vjudge3 C Sept. 21, 2017, 12:20 p.m. OK GNU C++ TESTS 43 62 409600 1700
30545336 vjudge3 C Sept. 20, 2017, 12:43 p.m. OK GNU C++ TESTS 43 62 409600 1700
19385721 The-Legend C July 24, 2016, 2:37 p.m. OK GNU C++ TESTS 43 62 409600 1700
19323866 The-Legend C July 22, 2016, 12:28 p.m. OK GNU C++ TESTS 43 62 409600 1700
9396825 BogdanFlorea C Jan. 10, 2015, 10:56 a.m. OK GNU C++0x TESTS 43 60 409600 1700
6588074 afrizal C May 11, 2014, 3:38 p.m. OK GNU C++0x TESTS 43 60 409600 1700
7674288 jianmodgqb C Sept. 3, 2014, 12:32 p.m. OK GNU C++0x TESTS 43 60 921600 1700
7015525 charany1 C July 5, 2014, 10:35 a.m. OK GNU C++0x TESTS 43 62 409600 1700
6334576 arthur.nascimento C April 12, 2014, 10:21 p.m. OK GNU C++0x TESTS 43 62 409600 1700
5406498 enrevol C Dec. 10, 2013, 10:31 p.m. OK GNU C++0x TESTS 43 62 409600 1700
4481115 yutaka1999 C Sept. 16, 2013, 3:12 a.m. OK GNU C++0x TESTS 43 62 409600 1700
4392853 cuiaoxiang C Sept. 1, 2013, 11:57 a.m. OK GNU C++0x TESTS 43 62 409600 1700
4384315 yellowtorch C Aug. 30, 2013, 9:05 p.m. OK GNU C++0x TESTS 43 62 409600 1700
4383127 a_coder C Aug. 30, 2013, 6:21 p.m. OK GNU C++0x TESTS 43 62 409600 1700
14176763 Infoshoc C Nov. 9, 2015, 8:02 p.m. OK GNU C++11 TESTS 43 62 204800 1700
66209300 Ahmad__ C Dec. 3, 2019, 5:44 a.m. OK GNU C++11 TESTS 43 62 409600 1700
22341010 wantToImprove C Nov. 20, 2016, 5:37 a.m. OK GNU C++11 TESTS 43 62 409600 1700
17269301 yasser.alaa.eldin C April 10, 2016, 6:09 p.m. OK GNU C++11 TESTS 43 62 409600 1700
17035084 ko_osaga C March 30, 2016, 1:50 p.m. OK GNU C++11 TESTS 43 62 409600 1700
16375575 madcannibal C Feb. 27, 2016, 8:04 a.m. OK GNU C++11 TESTS 43 62 409600 1700
11671232 ziad.mohamed C June 19, 2015, 4 p.m. OK GNU C++11 TESTS 43 62 409600 1700
10511415 vjudge4 C March 29, 2015, 5:57 a.m. OK GNU C++11 TESTS 43 62 409600 1700
10404088 FilipVesovic C March 22, 2015, 7:22 p.m. OK GNU C++11 TESTS 43 62 409600 1700
27366720 Mentholzzz C May 27, 2017, 3:54 a.m. OK GNU C++11 TESTS 43 62 614400 1700
51621802 Claustrophobic_Penguin C March 21, 2019, 2:45 p.m. OK GNU C++14 TESTS 43 62 409600 1700
49347154 ArthurDayne C Feb. 2, 2019, 6:16 a.m. OK GNU C++14 TESTS 43 62 614400 1700
31153244 parsamre C Oct. 8, 2017, 7:35 p.m. OK GNU C++14 TESTS 43 62 819200 1700
25558049 Mohinem C March 16, 2017, 6:48 p.m. OK GNU C++14 TESTS 43 62 2252800 1700
25875409 Givemetips C March 28, 2017, 1:57 p.m. OK GNU C++14 TESTS 43 62 2355200 1700
33631730 _Solenya_ C Dec. 25, 2017, 9:29 p.m. OK GNU C++14 TESTS 43 62 3072000 1700
28973827 ThePhenomenal C July 29, 2017, 3:57 p.m. OK GNU C++14 TESTS 43 62 3891200 1700
69035227 ankit_2305 C Jan. 18, 2020, 8:54 a.m. OK GNU C++14 TESTS 43 92 409600 1700
68590564 st.Djole C Jan. 11, 2020, 12:32 p.m. OK GNU C++14 TESTS 43 92 409600 1700
65272203 stefdasca C Nov. 17, 2019, 8:33 p.m. OK GNU C++14 TESTS 43 92 409600 1700
60505542 11th C Sept. 13, 2019, 9:15 p.m. OK GNU C++17 TESTS 43 92 409600 1700
60501925 bahaa C Sept. 13, 2019, 7:08 p.m. OK GNU C++17 TESTS 43 92 409600 1700
60451748 Abdelrahman_Elhawary C Sept. 12, 2019, 4:14 p.m. OK GNU C++17 TESTS 43 92 409600 1700
54732767 yuhta C May 28, 2019, 2:14 a.m. OK GNU C++17 TESTS 43 92 409600 1700
54662241 ruo C May 26, 2019, 11:23 a.m. OK GNU C++17 TESTS 43 92 409600 1700
41899227 mooskim C Aug. 20, 2018, 11:16 a.m. OK GNU C++17 TESTS 43 92 409600 1700
47607085 themechanicalcoder C Dec. 28, 2018, 6 a.m. OK GNU C++17 TESTS 43 92 614400 1700
67520150 person123 C Dec. 24, 2019, 12:09 p.m. OK GNU C++17 TESTS 43 92 819200 1700
65231542 mr_backlog C Nov. 17, 2019, 5:19 a.m. OK GNU C++17 TESTS 43 92 819200 1700
64769480 abhigyan10 C Nov. 12, 2019, 10 p.m. OK GNU C++17 TESTS 43 92 819200 1700
54690849 Phantasm C May 26, 2019, 5:21 p.m. OK Go TESTS 43 154 0 1700
13499131 behzad.nouri C Oct. 8, 2015, 6:28 p.m. OK Haskell TESTS 43 372 15872000 1700
19570710 vjudge5 C Aug. 2, 2016, 2:22 a.m. OK Haskell TESTS 43 404 17817600 1700
19570714 CyberZHG C Aug. 2, 2016, 2:23 a.m. OK Haskell TESTS 43 404 17817600 1700
13497991 behzad.nouri C Oct. 8, 2015, 5:18 p.m. OK Haskell TESTS 43 746 22220800 1700
4382492 autotaker C Aug. 30, 2013, 5:58 p.m. OK Haskell TESTS 43 998 7475200 1700
19570620 vjudge3 C Aug. 2, 2016, 2:12 a.m. OK Haskell TESTS 43 998 18022400 1700
4394816 soo C Sept. 1, 2013, 8:52 p.m. OK Java 6 TESTS 43 156 0 1700
4385554 nishchay2192 C Aug. 31, 2013, 5:11 a.m. OK Java 6 TESTS 43 186 0 1700
7357198 khoahoc1024 C Aug. 6, 2014, 3:36 a.m. OK Java 6 TESTS 43 216 307200 1700
4404573 llaki C Sept. 4, 2013, 9:50 a.m. OK Java 6 TESTS 43 218 102400 1700
4395873 N0D1R C Sept. 2, 2013, 7:20 a.m. OK Java 6 TESTS 43 218 102400 1700
4391577 alibaba C Sept. 1, 2013, 6:53 a.m. OK Java 6 TESTS 43 218 102400 1700
4383292 mkirsche C Aug. 30, 2013, 6:31 p.m. OK Java 6 TESTS 43 218 102400 1700
4378353 bli0042 C Aug. 30, 2013, 4:40 p.m. OK Java 6 TESTS 43 218 102400 1700
4376887 karan173 C Aug. 30, 2013, 4:22 p.m. OK Java 6 TESTS 43 248 0 1700
4384128 mahmoudhanafi C Aug. 30, 2013, 8:13 p.m. OK Java 6 TESTS 43 248 102400 1700
9794099 megaspazz C Feb. 11, 2015, 12:25 a.m. OK Java 7 TESTS 43 156 0 1700
5410815 0p9o8i C Dec. 11, 2013, 5:24 p.m. OK Java 7 TESTS 43 156 307200 1700
10146709 sultan.of.swing C March 4, 2015, 12:24 p.m. OK Java 7 TESTS 43 186 0 1700
4382397 laputawish C Aug. 30, 2013, 5:56 p.m. OK Java 7 TESTS 43 186 102400 1700
8848373 trunghieu11 C Nov. 25, 2014, 4:27 p.m. OK Java 7 TESTS 43 186 204800 1700
4384222 ykg2910 C Aug. 30, 2013, 8:40 p.m. OK Java 7 TESTS 43 186 204800 1700
4381510 JMS C Aug. 30, 2013, 5:23 p.m. OK Java 7 TESTS 43 186 204800 1700
6050203 Ziklon C March 16, 2014, 7:59 p.m. OK Java 7 TESTS 43 186 307200 1700
11098048 Sumeet.Varma C May 14, 2015, 12:14 p.m. OK Java 7 TESTS 43 216 0 1700
9496035 megaspazz C Jan. 21, 2015, 7:20 p.m. OK Java 7 TESTS 43 216 0 1700
54377690 mTvTm C May 19, 2019, 9:30 a.m. OK Java 8 TESTS 43 248 0 1700
51472141 tsumit023 C March 19, 2019, 7:12 a.m. OK Java 8 TESTS 43 248 0 1700
30820315 ronakvaghela45 C Sept. 29, 2017, 4:52 a.m. OK Java 8 TESTS 43 248 0 1700
10827350 poikniok C April 22, 2015, 6:22 p.m. OK Java 8 TESTS 43 248 28774400 1700
69195661 sakt_coder C Jan. 20, 2020, 2:50 p.m. OK Java 8 TESTS 43 278 0 1700
66249392 Oom C Dec. 3, 2019, 11:44 p.m. OK Java 8 TESTS 43 280 0 1700
63277704 eng_hardik C Oct. 24, 2019, 7:33 a.m. OK Java 8 TESTS 43 280 0 1700
50573618 Solo_Player. C Feb. 27, 2019, 4:47 p.m. OK Java 8 TESTS 43 280 0 1700
30655650 parth_15 C Sept. 24, 2017, 2:32 a.m. OK Java 8 TESTS 43 280 0 1700
27435717 kunalk C May 29, 2017, 8:20 p.m. OK Java 8 TESTS 43 280 0 1700
4404451 The_Shawshank C Sept. 4, 2013, 8:59 a.m. OK Mono C# TESTS 43 124 10240000 1700
15138574 og.kostya C Dec. 31, 2015, 3:29 p.m. OK MS C# TESTS 43 124 409600 1700
4380213 Guliash C Aug. 30, 2013, 5:06 p.m. OK MS C# TESTS 43 124 12288000 1700
4386878 Chubcheg C Aug. 31, 2013, 9:56 a.m. OK MS C# TESTS 43 156 9523200 1700
4383931 rubengt01 C Aug. 30, 2013, 7:40 p.m. OK MS C# TESTS 43 156 10444800 1700
4382186 luckyi C Aug. 30, 2013, 5:29 p.m. OK MS C++ TESTS 43 30 409600 1700
4434079 iso9001 C Sept. 9, 2013, 3:08 a.m. OK MS C++ TESTS 43 62 307200 1700
4385386 Carups C Aug. 31, 2013, 3:27 a.m. OK MS C++ TESTS 43 62 307200 1700
4547036 Ychn C Sept. 24, 2013, 6:33 a.m. OK MS C++ TESTS 43 62 307200 1700
46539738 vjudge4 C Dec. 3, 2018, 11:19 a.m. OK MS C++ TESTS 43 62 409600 1700
4379749 Trytrytry C Aug. 30, 2013, 4:59 p.m. OK MS C++ TESTS 43 62 409600 1700
4381158 hcbbt C Aug. 30, 2013, 5:18 p.m. OK MS C++ TESTS 43 62 614400 1700
4527207 20120125 C Sept. 21, 2013, 4:45 a.m. OK MS C++ TESTS 43 62 716800 1700
4385978 filo C Aug. 31, 2013, 7:15 a.m. OK MS C++ TESTS 43 62 716800 1700
4385657 Elun C Aug. 31, 2013, 6:03 a.m. OK MS C++ TESTS 43 62 716800 1700
55086458 kabeer27 C June 4, 2019, 12:45 p.m. OK PyPy 2 TESTS 43 404 13516800 1700
23887273 Yash_ C Jan. 16, 2017, 5:23 p.m. OK PyPy 2 TESTS 43 466 31948800 1700
11770597 LouisCK C June 26, 2015, 9:29 a.m. OK PyPy 2 TESTS 43 530 11878400 1700
68314126 vjudge2 C Jan. 6, 2020, 12:32 p.m. OK PyPy 3 TESTS 43 436 10444800 1700
68316349 vjudge4 C Jan. 6, 2020, 1:21 p.m. OK PyPy 3 TESTS 43 466 10752000 1700
59088511 Gaurav1 C Aug. 19, 2019, 11:56 a.m. OK PyPy 3 TESTS 43 496 10137600 1700
56173306 Mr.Inconsistent C June 27, 2019, 5:44 p.m. OK PyPy 3 TESTS 43 590 10240000 1700
4532777 user_123 C Sept. 21, 2013, 5:43 p.m. OK Python 2 TESTS 43 312 5632000 1700
4436655 rinigan C Sept. 9, 2013, 6:02 p.m. OK Python 2 TESTS 43 342 7270400 1700
7045885 yobobobo C July 8, 2014, 8:13 a.m. OK Python 2 TESTS 43 372 5939200 1700
4413205 tangyao0792 C Sept. 6, 2013, 5:23 a.m. OK Python 2 TESTS 43 374 5632000 1700
4413123 tangyao0792 maxiao C Sept. 6, 2013, 4:31 a.m. OK Python 2 TESTS 43 374 5632000 1700
4379004 DenXX C Aug. 30, 2013, 4:49 p.m. OK Python 2 TESTS 43 374 5632000 1700
4376579 jakab922 C Aug. 30, 2013, 4:18 p.m. OK Python 2 TESTS 43 374 5632000 1700
13743039 vvs C Oct. 19, 2015, 10:06 p.m. OK Python 2 TESTS 43 404 5427200 1700
4404419 jie414341055 C Sept. 4, 2013, 8:49 a.m. OK Python 2 TESTS 43 404 6963200 1700
4375895 peter.alexeev C Aug. 30, 2013, 4:11 p.m. OK Python 2 TESTS 43 436 5632000 1700
4382382 DanielChau C Aug. 30, 2013, 5:56 p.m. OK Python 3 TESTS 43 312 7270400 1700
4382886 DanielChau C Aug. 30, 2013, 6:11 p.m. OK Python 3 TESTS 43 342 7577600 1700
5350327 yugle7 C Dec. 4, 2013, 8:08 p.m. OK Python 3 TESTS 43 374 7577600 1700
4391846 mlaw0 C Sept. 1, 2013, 8:22 a.m. OK Python 3 TESTS 43 374 7577600 1700
4408229 fish_ball C Sept. 5, 2013, 7:58 a.m. OK Python 3 TESTS 43 404 7577600 1700
4380702 Toxic C Aug. 30, 2013, 5:13 p.m. OK Python 3 TESTS 43 404 8908800 1700
68314627 vjudge1 C Jan. 6, 2020, 12:43 p.m. OK Python 3 TESTS 43 434 7680000 1700
42135212 Mk_Python_v1 C Aug. 26, 2018, 10:52 p.m. OK Python 3 TESTS 43 436 7577600 1700
68340645 vjudge2 C Jan. 7, 2020, 3:15 a.m. OK Python 3 TESTS 43 466 7680000 1700
4387374 Jay_Chou C Aug. 31, 2013, 11:25 a.m. OK Python 3 TESTS 43 468 8908800 1700
4390706 Lebesgue C Sept. 1, 2013, 12:52 a.m. OK Scala TESTS 43 810 2867200 1700
4390704 Lebesgue C Sept. 1, 2013, 12:51 a.m. OK Scala TESTS 43 810 2867200 1700

remove filters

Back to search problems