Codeforces Round #Pi (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
567 Codeforces Round #Pi (Div. 2) FINISHED False 9000 293032799 Aug. 5, 2015, 4 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 9515 ) C Geometric Progression PROGRAMMING binary search data structures dp 1700

B"Polycarp loves geometric progressions very much. Since he was only three years old, he loves only the progressions of length three. He also has a favorite integer k and a sequence a, consisting of n integers. He wants to know how many subsequences of length three can be selected from a, so that they form a geometric progression with common ratio k. A subsequence of length three is a combination of three such indexes i1, xe2 x80 x89i2, xe2 x80 x89i3, that 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i1 xe2 x80 x89< xe2 x80 x89i2 xe2 x80 x89< xe2 x80 x89i3 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n. That is, a subsequence of length three are such groups of three elements that are not necessarily consecutive in the sequence, but their indexes are strictly increasing. A geometric progression with common ratio k is a sequence of numbers of the form b xc2 xb7k0, xe2 x80 x89b xc2 xb7k1, xe2 x80 x89..., xe2 x80 x89b xc2 xb7kr xe2 x80 x89- xe2 x80 x891. Polycarp is only three years old, so he can not calculate this number himself. Help him to do it. The first line of the input contains two integers, n and k (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x892 xc2 xb7105), showing how many numbers Polycarp's sequence has and his favorite number. The second line contains n integers a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an ( xe2 x80 x89- xe2 x80 x89109 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109) -- elements of the sequence. Output a single number -- the number of ways to choose a subsequence of length three, such that it forms a geometric progression with a common ratio k. In the first sample test the answer is four, as any of the two 1s can be chosen as the first element, the second element can be any of the 2s, and the third element of the subsequence must be equal to 4."...

Tutorials

Editorial Codeforces Round #Pi

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
40503869 cpy C July 18, 2018, 7:32 a.m. OK D TESTS 81 155 11673600 1700
24399588 fluffyowl C Feb. 3, 2017, 1:55 a.m. OK D TESTS 81 202 39014400 1700
12584187 dr.ikros C Aug. 18, 2015, 5:31 a.m. OK D TESTS 81 405 41062400 1700
40509880 cpy C July 18, 2018, 10:29 a.m. OK D TESTS 81 577 36659200 1700
40509849 cpy C July 18, 2018, 10:27 a.m. OK D TESTS 81 639 22630400 1700
12435122 kenichi_9xpro C Aug. 10, 2015, 9:14 a.m. OK FPC TESTS 81 77 5632000 1700
12434448 Diamond_D_Capricornus C Aug. 10, 2015, 8:18 a.m. OK FPC TESTS 81 78 4812800 1700
12434485 panda96 C Aug. 10, 2015, 8:20 a.m. OK FPC TESTS 81 93 7987200 1700
12491379 jiangyx C Aug. 13, 2015, 12:06 p.m. OK FPC TESTS 81 93 20070400 1700
12589075 CSTRP C Aug. 18, 2015, 1:20 p.m. OK FPC TESTS 81 124 17817600 1700
17365238 andreumat C April 17, 2016, 2:09 p.m. OK FPC TESTS 81 124 45260800 1700
22336094 tieuchanlong C Nov. 19, 2016, 7:26 p.m. OK FPC TESTS 81 186 11264000 1700
12628657 Kleaschev_Maksim C Aug. 21, 2015, 1:16 p.m. OK FPC TESTS 81 187 16076800 1700
13542244 Valerich C Oct. 11, 2015, 7:35 a.m. OK FPC TESTS 81 249 132300800 1700
12485797 NoSoul C Aug. 13, 2015, 1:38 a.m. OK GNU C TESTS 81 124 1638400 1700
12480054 NoSoul C Aug. 12, 2015, 1:20 p.m. OK GNU C TESTS 81 124 1638400 1700
12614546 kwakwa C Aug. 20, 2015, 10:54 a.m. OK GNU C TESTS 81 140 3993600 1700
30054238 crazy_kankuro C Sept. 4, 2017, 1:40 p.m. OK GNU C TESTS 81 156 3993600 1700
16140870 Vyess C Feb. 18, 2016, 12:08 p.m. OK GNU C++ TESTS 81 46 49664000 1700
12626588 Artmem C Aug. 21, 2015, 10:52 a.m. OK GNU C++ TESTS 81 62 10035200 1700
13114652 ZLR C Sept. 20, 2015, 1:10 p.m. OK GNU C++ TESTS 81 62 47308800 1700
12676780 AKJ88 C Aug. 23, 2015, 7:06 p.m. OK GNU C++ TESTS 81 78 1638400 1700
12702870 vjudge3 C Aug. 26, 2015, 2:52 a.m. OK GNU C++ TESTS 81 78 4812800 1700
12474354 vjudge5 C Aug. 12, 2015, 6:01 a.m. OK GNU C++ TESTS 81 93 2457600 1700
19457487 kxj C July 28, 2016, 8:34 a.m. OK GNU C++ TESTS 81 93 6451200 1700
12463338 ssxiaohao C Aug. 11, 2015, 8:18 a.m. OK GNU C++ TESTS 81 93 6451200 1700
13413853 vjudge4 C Oct. 5, 2015, 10:31 a.m. OK GNU C++ TESTS 81 93 7987200 1700
32622836 BorisBelozerov C Nov. 24, 2017, 1:48 p.m. OK GNU C++ TESTS 81 93 14848000 1700
57246526 rainboy C July 17, 2019, 7:41 p.m. OK GNU C11 TESTS 81 218 7270400 1700
40986316 ReaLNero1 C July 30, 2018, 8:29 p.m. OK GNU C++11 TESTS 81 46 49766400 1700
32715121 sozib_hossain C Nov. 27, 2017, 12:52 p.m. OK GNU C++11 TESTS 81 46 51814400 1700
12438544 krijgertje C Aug. 10, 2015, 12:37 p.m. OK GNU C++11 TESTS 81 62 1638400 1700
12607168 Lee_vincent C Aug. 19, 2015, 5:30 p.m. OK GNU C++11 TESTS 81 62 9318400 1700
12607156 vjudge4 C Aug. 19, 2015, 5:29 p.m. OK GNU C++11 TESTS 81 62 9318400 1700
12607146 vjudge3 C Aug. 19, 2015, 5:29 p.m. OK GNU C++11 TESTS 81 62 9318400 1700
12607182 vjudge5 C Aug. 19, 2015, 5:31 p.m. OK GNU C++11 TESTS 81 62 9318400 1700
12607036 vjudge5 C Aug. 19, 2015, 5:22 p.m. OK GNU C++11 TESTS 81 62 9318400 1700
12607014 vjudge3 C Aug. 19, 2015, 5:20 p.m. OK GNU C++11 TESTS 81 62 9318400 1700
12607119 vjudge3 C Aug. 19, 2015, 5:27 p.m. OK GNU C++11 TESTS 81 62 9318400 1700
47829380 ArshiaDadras C Jan. 2, 2019, 5:07 a.m. OK GNU C++14 TESTS 81 78 13516800 1700
50276626 puyu_liao C Feb. 21, 2019, 10:26 a.m. OK GNU C++14 TESTS 81 93 15155200 1700
59417743 lakshay_nasa C Aug. 24, 2019, 7:09 p.m. OK GNU C++14 TESTS 81 109 16179200 1700
38542748 Lvitsa C May 22, 2018, 5:20 p.m. OK GNU C++14 TESTS 81 124 4812800 1700
27582086 Light C June 5, 2017, 11:50 a.m. OK GNU C++14 TESTS 81 124 11468800 1700
26946662 hairybaalsac C May 7, 2017, 8:51 p.m. OK GNU C++14 TESTS 81 124 14233600 1700
50276287 puyu_liao C Feb. 21, 2019, 10:11 a.m. OK GNU C++14 TESTS 81 124 14233600 1700
49768026 gaurav6225 C Feb. 11, 2019, 12:32 p.m. OK GNU C++14 TESTS 81 124 15257600 1700
34994766 Kazim C Feb. 7, 2018, 10:07 a.m. OK GNU C++14 TESTS 81 124 15462400 1700
32715107 sozib_hossain C Nov. 27, 2017, 12:51 p.m. OK GNU C++14 TESTS 81 124 51609600 1700
56842164 thantrongtri3 C July 11, 2019, 12:01 p.m. OK GNU C++17 TESTS 81 78 2457600 1700
65625428 ruo C Nov. 24, 2019, 7:49 a.m. OK GNU C++17 TESTS 81 93 14028800 1700
53933195 jdh C May 9, 2019, 7:44 p.m. OK GNU C++17 TESTS 81 108 14028800 1700
38822996 madhur4127 C June 1, 2018, 8:58 a.m. OK GNU C++17 TESTS 81 108 14745600 1700
55059873 eThAnE C June 3, 2019, 9:28 p.m. OK GNU C++17 TESTS 81 109 15667200 1700
57112980 balle C July 15, 2019, 6:22 p.m. OK GNU C++17 TESTS 81 109 16896000 1700
55112095 mixalchik545 C June 5, 2019, 6:50 a.m. OK GNU C++17 TESTS 81 124 3174400 1700
51413291 vjudge1 C March 17, 2019, 12:57 p.m. OK GNU C++17 TESTS 81 124 10649600 1700
60443469 newvar C Sept. 12, 2019, 1:20 p.m. OK GNU C++17 TESTS 81 124 12390400 1700
57151472 MuhammadAl-Halaby C July 16, 2019, 2:58 p.m. OK GNU C++17 TESTS 81 124 12390400 1700
62571456 synapse C Oct. 14, 2019, 2:37 p.m. OK Go TESTS 81 186 8908800 1700
62571120 synapse C Oct. 14, 2019, 2:32 p.m. OK Go TESTS 81 187 9318400 1700
20665926 hloya_ygrt C Sept. 16, 2016, 5:50 p.m. OK Go TESTS 81 217 21094400 1700
15432557 behzad.nouri C Jan. 18, 2016, 8:32 p.m. OK Haskell TESTS 81 670 51712000 1700
15432576 behzad.nouri C Jan. 18, 2016, 8:35 p.m. OK Haskell TESTS 81 702 49561600 1700
69384402 ashanksingh1997 C Jan. 22, 2020, 9:15 p.m. OK Java 11 TESTS 81 670 20787200 1700
64201371 DATVN C Nov. 4, 2019, 11:34 a.m. OK Java 11 TESTS 81 857 29286400 1700
12849460 suigingin C Sept. 5, 2015, 7:35 a.m. OK Java 7 TESTS 81 202 13926400 1700
12988187 curly C Sept. 13, 2015, 5:15 p.m. OK Java 7 TESTS 81 218 15052800 1700
15725655 sabbir044 C Feb. 1, 2016, 6:23 a.m. OK Java 7 TESTS 81 233 15155200 1700
12561378 suigingin C Aug. 16, 2015, 1:22 p.m. OK Java 7 TESTS 81 234 14438400 1700
12561631 suigingin C Aug. 16, 2015, 1:43 p.m. OK Java 7 TESTS 81 249 14438400 1700
18351052 Zinef C June 10, 2016, 2:33 a.m. OK Java 7 TESTS 81 249 54681600 1700
12967245 Zalat C Sept. 12, 2015, 2:34 a.m. OK Java 7 TESTS 81 264 12492800 1700
12830764 Hartha C Sept. 3, 2015, 3:37 p.m. OK Java 7 TESTS 81 280 3379200 1700
12476091 maitony C Aug. 12, 2015, 8:32 a.m. OK Java 7 TESTS 81 311 25907200 1700
18175001 frktry C May 31, 2016, 9:39 p.m. OK Java 7 TESTS 81 343 60108800 1700
12471902 uagaponec C Aug. 11, 2015, 10:43 p.m. OK Java 8 TESTS 81 186 11673600 1700
12439827 hama-du C Aug. 10, 2015, 2:21 p.m. OK Java 8 TESTS 81 202 11468800 1700
31796912 coderbond007 C Oct. 27, 2017, 1:27 p.m. OK Java 8 TESTS 81 218 0 1700
31796962 coderbond007 C Oct. 27, 2017, 1:29 p.m. OK Java 8 TESTS 81 233 12697600 1700
55296115 abhi2601 C June 8, 2019, 9:56 a.m. OK Java 8 TESTS 81 233 13721600 1700
12520640 haris C Aug. 14, 2015, 1:25 a.m. OK Java 8 TESTS 81 234 14848000 1700
15934693 I_Need_Alex_R_Coleman C Feb. 10, 2016, 3:28 p.m. OK Java 8 TESTS 81 249 13312000 1700
23275708 kunalk C Dec. 24, 2016, 4:33 p.m. OK Java 8 TESTS 81 249 40652800 1700
12603709 Sumeet.Varma C Aug. 19, 2015, 1:25 p.m. OK Java 8 TESTS 81 264 1638400 1700
51674312 ivplay C March 22, 2019, 9:40 a.m. OK Java 8 TESTS 81 264 27750400 1700
51079344 nemars C March 9, 2019, 10:39 a.m. OK Mono C# TESTS 81 248 50995200 1700
12830205 sqc1999 C Sept. 3, 2015, 3 p.m. OK MS C# TESTS 81 155 48230400 1700
12438850 navymn C Aug. 10, 2015, 1 p.m. OK MS C# TESTS 81 186 50995200 1700
27887217 Sorryforpartyrocking C June 18, 2017, 3:25 p.m. OK MS C# TESTS 81 187 45465600 1700
33287134 m1_k3 C Dec. 16, 2017, 11:29 a.m. OK MS C# TESTS 81 202 43827200 1700
17925575 zazak C May 15, 2016, 10:50 p.m. OK MS C# TESTS 81 202 49561600 1700
15431470 NirShalmon C Jan. 18, 2016, 6:34 p.m. OK MS C# TESTS 81 233 36556800 1700
20966121 Chubcheg C Sept. 28, 2016, 11:45 a.m. OK MS C# TESTS 81 233 38297600 1700
12474697 ReaverSe C Aug. 12, 2015, 6:28 a.m. OK MS C++ TESTS 81 78 2355200 1700
12607296 Lee_vincent C Aug. 19, 2015, 5:41 p.m. OK MS C++ TESTS 81 108 10240000 1700
12607303 vjudge4 C Aug. 19, 2015, 5:42 p.m. OK MS C++ TESTS 81 109 10240000 1700
64363636 vjudge1 C Nov. 6, 2019, 12:25 p.m. OK MS C++ TESTS 81 124 16896000 1700
64363631 vjudge3 C Nov. 6, 2019, 12:25 p.m. OK MS C++ TESTS 81 124 16896000 1700
12560808 redoak C Aug. 16, 2015, 12:38 p.m. OK MS C++ TESTS 81 202 11264000 1700
45331904 vjudge3 C Nov. 5, 2018, 3:38 p.m. OK MS C++ TESTS 81 233 13004800 1700
14646465 vjudge5 C Dec. 4, 2015, 11:17 a.m. OK MS C++ TESTS 81 234 12083200 1700
33920005 ys1468362286 C Jan. 5, 2018, 10:46 a.m. OK MS C++ TESTS 81 234 21401600 1700
13213213 594cp C Sept. 25, 2015, 5:09 a.m. OK MS C++ TESTS 81 234 26521600 1700
64367211 vjudge1 C Nov. 6, 2019, 1:20 p.m. OK MS C++ 2017 TESTS 81 171 13721600 1700
64363549 TBlackRose C Nov. 6, 2019, 12:24 p.m. OK MS C++ 2017 TESTS 81 171 14131200 1700
65526011 Phil0 C Nov. 22, 2019, 10:25 a.m. OK MS C++ 2017 TESTS 81 234 11776000 1700
69595917 vjudge2 C Jan. 27, 2020, 4:43 a.m. OK MS C++ 2017 TESTS 81 264 16076800 1700
60186983 CtrlAlt C Sept. 6, 2019, 7:02 p.m. OK MS C++ 2017 TESTS 81 295 15872000 1700
67462058 parampamparam C Dec. 23, 2019, 9:34 a.m. OK MS C++ 2017 TESTS 81 374 16076800 1700
51140203 Extraordinary_ C March 10, 2019, 6:44 p.m. OK MS C++ 2017 TESTS 81 389 18432000 1700
69469160 SomeTh1n6 C Jan. 24, 2020, 1:57 p.m. OK MS C++ 2017 TESTS 81 405 16076800 1700
68010164 vjudge1 C Dec. 31, 2019, 3:19 p.m. OK MS C++ 2017 TESTS 81 452 12390400 1700
67766526 yuanyuan2048 C Dec. 28, 2019, 4:17 a.m. OK MS C++ 2017 TESTS 81 452 20992000 1700
34171093 gabe C Jan. 14, 2018, 9:18 a.m. OK Perl TESTS 81 935 61440000 1700
13861825 nealzane C Oct. 25, 2015, 9:11 p.m. OK PyPy 2 TESTS 81 171 15564800 1700
16187799 zetilovn C Feb. 18, 2016, 9:51 p.m. OK PyPy 2 TESTS 81 187 19865600 1700
55610318 anshuman16423 C June 16, 2019, 5:16 a.m. OK PyPy 2 TESTS 81 202 18227200 1700
32025107 inishchith. C Nov. 3, 2017, 5:04 p.m. OK PyPy 2 TESTS 81 202 27443200 1700
28822072 sambit25 C July 24, 2017, 10:41 a.m. OK PyPy 2 TESTS 81 218 55705600 1700
13357008 kfx C Oct. 3, 2015, 10:10 a.m. OK PyPy 2 TESTS 81 233 24166400 1700
45382620 YESMAths C Nov. 6, 2018, 3:43 p.m. OK PyPy 2 TESTS 81 249 20172800 1700
42351741 Onesh0t C Sept. 2, 2018, 5:53 a.m. OK PyPy 2 TESTS 81 295 22528000 1700
23022569 dsharma080 C Dec. 16, 2016, 5:33 a.m. OK PyPy 2 TESTS 81 311 39321600 1700
32023185 shmabulock C Nov. 3, 2017, 4:50 p.m. OK PyPy 2 TESTS 81 576 75673600 1700
60698733 adivannik C Sept. 16, 2019, 9:32 p.m. OK PyPy 3 TESTS 81 373 21504000 1700
68139177 kartikgiri92 C Jan. 3, 2020, 8:46 p.m. OK PyPy 3 TESTS 81 374 25804800 1700
64189484 rishus23 C Nov. 4, 2019, 7:03 a.m. OK PyPy 3 TESTS 81 389 25395200 1700
61288671 MotaSanyal C Sept. 25, 2019, 7:33 p.m. OK PyPy 3 TESTS 81 389 29696000 1700
35893775 _____k_____ C March 3, 2018, 4:07 p.m. OK PyPy 3 TESTS 81 452 59084800 1700
35888547 ______n______ C March 3, 2018, 2:25 p.m. OK PyPy 3 TESTS 81 452 59084800 1700
35887033 _____i_____ C March 3, 2018, 1:57 p.m. OK PyPy 3 TESTS 81 452 59084800 1700
35883262 ______h______ C March 3, 2018, 12:50 p.m. OK PyPy 3 TESTS 81 452 59084800 1700
35882896 ______k______ C March 3, 2018, 12:45 p.m. OK PyPy 3 TESTS 81 452 59084800 1700
35875318 ______i______ C March 3, 2018, 8:14 a.m. OK PyPy 3 TESTS 81 452 59084800 1700
14410257 trunghieu11 C Nov. 22, 2015, 7:31 a.m. OK Python 2 TESTS 81 327 19353600 1700
12441180 universe- C Aug. 10, 2015, 4:15 p.m. OK Python 2 TESTS 81 420 21401600 1700
33906763 n0mad C Jan. 4, 2018, 4:07 p.m. OK Python 2 TESTS 81 420 23859200 1700
34072047 upcomingnewton C Jan. 10, 2018, 3:22 p.m. OK Python 2 TESTS 81 421 26828800 1700
14931301 xiaowuc1 C Dec. 22, 2015, 10:15 p.m. OK Python 2 TESTS 81 452 21913600 1700
26525163 bigobigo C April 20, 2017, 7:27 p.m. OK Python 2 TESTS 81 467 28876800 1700
12622665 allanyin C Aug. 21, 2015, 4:05 a.m. OK Python 2 TESTS 81 498 19353600 1700
13785705 Behrooz_Binary C Oct. 22, 2015, 6:32 a.m. OK Python 2 TESTS 81 499 27648000 1700
12714412 edu C Aug. 27, 2015, 2:16 a.m. OK Python 2 TESTS 81 514 20787200 1700
13785444 cz6317 C Oct. 22, 2015, 6:12 a.m. OK Python 2 TESTS 81 514 27750400 1700
54544855 Aidos C May 24, 2019, 5:29 a.m. OK Python 3 TESTS 81 420 29900800 1700
55325557 shivammishra C June 9, 2019, 7:49 a.m. OK Python 3 TESTS 81 452 22528000 1700
68417701 FlyingBag65 C Jan. 8, 2020, 7:45 p.m. OK Python 3 TESTS 81 483 20889600 1700
12569667 Vasiliy_48 C Aug. 17, 2015, 3:47 a.m. OK Python 3 TESTS 81 498 21811200 1700
50996665 honeysingh C March 8, 2019, 4:18 a.m. OK Python 3 TESTS 81 498 23449600 1700
48682122 varun_raj C Jan. 21, 2019, 1:44 p.m. OK Python 3 TESTS 81 498 23654400 1700
64108470 Zombie358 C Nov. 2, 2019, 5:39 p.m. OK Python 3 TESTS 81 499 22425600 1700
12577660 dartlenin C Aug. 17, 2015, 4:12 p.m. OK Python 3 TESTS 81 514 24576000 1700
12773407 katikin C Aug. 30, 2015, 9:13 a.m. OK Python 3 TESTS 81 529 23142400 1700
37683803 DevilJin C April 28, 2018, 11:29 a.m. OK Python 3 TESTS 81 529 29696000 1700
65318037 tuna_salad C Nov. 18, 2019, 6:19 p.m. OK Rust TESTS 81 78 17100800 1700
12629068 mysterion C Aug. 21, 2015, 1:50 p.m. OK Scala TESTS 81 623 24985600 1700
12477369 eglur C Aug. 12, 2015, 9:49 a.m. OK Scala TESTS 81 810 36044800 1700

remove filters

Back to search problems