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 |
---|---|---|---|---|---|---|
1860 | Educational Codeforces Round 153 (Rated for Div. 2) | FINISHED | False | 7200 | 44897063 | Aug. 17, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 13798 ) | C | Game on Permutation | PROGRAMMING | data structures games greedy |
B"Alice and Bob are playing a game. They have a permutation p of size n (a permutation of size n is an array of size n where each element from 1 to n occurs exactly once). They also have a chip, which can be placed on any element of the permutation. Alice and Bob make alternating moves: Alice makes the first move, then Bob makes the second move, then Alice makes the third move, and so on. During the first move, Alice chooses any element of the permutation and places the chip on that element. During each of the next moves, the current player has to move the chip to any element that is simultaneously to the left and strictly less than the current element (i. xe2 x80 x89e. if the chip is on the i -th element, it can be moved to the j -th element if j < i and p_j < p_i ). If a player cannot make a move (it is impossible to move the chip according to the rules of the game), that player wins the game. Let's say that the i -th element of the permutation is lucky if the following condition holds: You have to calculate the number of lucky elements in the permutation. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first line of each test case contains a single integer n ( 1 <= n <= 3 cdot 10^5 ) xe2 x80 x93 the number of elements in the permutation. The second line contains n integers p_1, p_2, ... , p_n ( 1 <= p_i <= n ). All p_i are distinct. The sum of n over all test cases doesn't exceed 3 cdot 10^5 . For each test case, print a single integer -- the number of lucky elements in the permutation. In the first test case of the example, the 3 -rd element of the permutation is lucky. In the second test case of the example, there are no lucky elements. In the third test case of the example, the 2 -nd element of the permutation is lucky. In the fourth test case of the example, the 3 -rd and the "... |
Educational Codeforces Round 153 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
219357318 | Exbilar | C | Aug. 17, 2023, 5:48 p.m. | OK | Clang++17 Diagnostics | TESTS | 8 | 389 | 20582400 | ||
219375569 | NenadDapic | C | Aug. 17, 2023, 9:06 p.m. | OK | FPC | TESTS | 8 | 62 | 102400 | ||
219343903 | hscpy | C | Aug. 17, 2023, 4:34 p.m. | OK | GNU C11 | TESTS | 8 | 62 | 1228800 | ||
219354028 | kuguadawang | C | Aug. 17, 2023, 5:21 p.m. | OK | GNU C++14 | TESTS | 8 | 62 | 0 | ||
219396506 | Moses_chan | C | Aug. 18, 2023, 4:17 a.m. | OK | GNU C++14 | TESTS | 8 | 62 | 1228800 | ||
219390636 | Noname_min | C | Aug. 18, 2023, 2:50 a.m. | OK | GNU C++14 | TESTS | 8 | 62 | 1228800 | ||
219352010 | coder_pulkit_s | C | Aug. 17, 2023, 5:08 p.m. | OK | GNU C++14 | TESTS | 8 | 62 | 3584000 | ||
219395346 | Youzhencai | C | Aug. 18, 2023, 3:59 a.m. | OK | GNU C++14 | TESTS | 8 | 77 | 1228800 | ||
219391371 | karansrivastava | C | Aug. 18, 2023, 3:01 a.m. | OK | GNU C++14 | TESTS | 8 | 77 | 1228800 | ||
219342800 | AndyLiuYS | C | Aug. 17, 2023, 4:33 p.m. | OK | GNU C++14 | TESTS | 8 | 77 | 1228800 | ||
219404810 | koonxx | C | Aug. 18, 2023, 6:02 a.m. | OK | GNU C++14 | TESTS | 8 | 77 | 1228800 | ||
219364883 | Mr.Toot | C | Aug. 17, 2023, 6:59 p.m. | OK | GNU C++14 | TESTS | 8 | 77 | 2048000 | ||
219388681 | 2021404292 | C | Aug. 18, 2023, 2:16 a.m. | OK | GNU C++14 | TESTS | 8 | 77 | 2457600 | ||
219377261 | PaNNiiiiC | C | Aug. 17, 2023, 9:40 p.m. | OK | GNU C++17 | TESTS | 8 | 62 | 1228800 | ||
219377097 | Parv_A | C | Aug. 17, 2023, 9:36 p.m. | OK | GNU C++17 | TESTS | 8 | 62 | 1228800 | ||
219350384 | debosmita1919 | C | Aug. 17, 2023, 4:59 p.m. | OK | GNU C++17 | TESTS | 8 | 62 | 1228800 | ||
219383472 | theNewSon | C | Aug. 18, 2023, 12:36 a.m. | OK | GNU C++17 | TESTS | 8 | 62 | 1228800 | ||
219401016 | aditya4905 | C | Aug. 18, 2023, 5:17 a.m. | OK | GNU C++17 | TESTS | 8 | 62 | 2457600 | ||
219362103 | Hhl8924 | C | Aug. 17, 2023, 6:29 p.m. | OK | GNU C++17 | TESTS | 8 | 77 | 0 | ||
219361170 | reverb25 | C | Aug. 17, 2023, 6:21 p.m. | OK | GNU C++17 | TESTS | 8 | 77 | 0 | ||
219355812 | srivs22 | C | Aug. 17, 2023, 5:35 p.m. | OK | GNU C++17 | TESTS | 8 | 77 | 0 | ||
219377716 | CutSandstone | C | Aug. 17, 2023, 9:51 p.m. | OK | GNU C++17 | TESTS | 8 | 77 | 0 | ||
219394798 | youthPaul | C | Aug. 18, 2023, 3:52 a.m. | OK | GNU C++17 | TESTS | 8 | 77 | 1228800 | ||
219387994 | M_Rana | C | Aug. 18, 2023, 2:04 a.m. | OK | GNU C++17 (64) | TESTS | 8 | 46 | 0 | ||
219386150 | qstbcd | C | Aug. 18, 2023, 1:32 a.m. | OK | GNU C++17 (64) | TESTS | 8 | 46 | 0 | ||
219395289 | FLOWPOWER | C | Aug. 18, 2023, 3:58 a.m. | OK | GNU C++17 (64) | TESTS | 8 | 46 | 1228800 | ||
219398606 | BlackGuy42 | C | Aug. 18, 2023, 4:46 a.m. | OK | GNU C++17 (64) | TESTS | 8 | 46 | 1228800 | ||
219377564 | Manjeet_Pathak | C | Aug. 17, 2023, 9:46 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 46 | 1228800 | ||
219376644 | vedantkulkarni2april | C | Aug. 17, 2023, 9:26 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 46 | 1228800 | ||
219348426 | Invinciblepheasantking | C | Aug. 17, 2023, 4:49 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 46 | 1228800 | ||
219346857 | Taki_Tachibana | C | Aug. 17, 2023, 4:42 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 46 | 1228800 | ||
219342914 | Sharath_TN | C | Aug. 17, 2023, 4:33 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 46 | 1228800 | ||
219402216 | nileshmishra080 | C | Aug. 18, 2023, 5:32 a.m. | OK | GNU C++17 (64) | TESTS | 8 | 46 | 2355200 | ||
219355992 | sword060 | C | Aug. 17, 2023, 5:37 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 15 | 3174400 | ||
219356553 | sword060 | C | Aug. 17, 2023, 5:41 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 15 | 3174400 | ||
219355725 | XueHua0.1 | C | Aug. 17, 2023, 5:35 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 31 | 0 | ||
219367506 | iamneerajhari | C | Aug. 17, 2023, 7:28 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 31 | 0 | ||
219356428 | miminguci | C | Aug. 17, 2023, 5:40 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 31 | 0 | ||
219369063 | _lucasdlo | C | Aug. 17, 2023, 7:47 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 31 | 0 | ||
219389523 | 1eonscount | C | Aug. 18, 2023, 2:31 a.m. | OK | GNU C++20 (64) | TESTS | 8 | 31 | 0 | ||
219349008 | Mortelman | C | Aug. 17, 2023, 4:51 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 31 | 307200 | ||
219349422 | Mortelman | C | Aug. 17, 2023, 4:54 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 31 | 307200 | ||
219404727 | jjjfr | C | Aug. 18, 2023, 6:01 a.m. | OK | GNU C++20 (64) | TESTS | 8 | 31 | 1228800 | ||
219396218 | drdilyor | C | Aug. 18, 2023, 4:13 a.m. | OK | Haskell | TESTS | 8 | 748 | 90316800 | ||
219350139 | Vikas_Ahlawat | C | Aug. 17, 2023, 4:57 p.m. | OK | Java 11 | TESTS | 8 | 187 | 0 | ||
219371091 | themadknight45 | C | Aug. 17, 2023, 8:16 p.m. | OK | Java 11 | TESTS | 8 | 202 | 0 | ||
219393725 | Priyanshupbh072 | C | Aug. 18, 2023, 3:35 a.m. | OK | Java 11 | TESTS | 8 | 233 | 0 | ||
219402649 | f20201214 | C | Aug. 18, 2023, 5:37 a.m. | OK | Java 11 | TESTS | 8 | 249 | 0 | ||
219366847 | kribri | C | Aug. 17, 2023, 7:21 p.m. | OK | Java 11 | TESTS | 8 | 249 | 0 | ||
219349046 | Panther369 | C | Aug. 17, 2023, 4:52 p.m. | OK | Java 11 | TESTS | 8 | 249 | 3788800 | ||
219347061 | codebot007 | C | Aug. 17, 2023, 4:43 p.m. | OK | Java 11 | TESTS | 8 | 514 | 0 | ||
219351816 | man-ray | C | Aug. 17, 2023, 5:07 p.m. | OK | Java 11 | TESTS | 8 | 530 | 0 | ||
219349831 | jiangqiao | C | Aug. 17, 2023, 4:56 p.m. | OK | Java 17 | TESTS | 8 | 202 | 614400 | ||
219348248 | Utsav82 | C | Aug. 17, 2023, 4:48 p.m. | OK | Java 17 | TESTS | 8 | 218 | 614400 | ||
219366255 | dzhi | C | Aug. 17, 2023, 7:15 p.m. | OK | Java 17 | TESTS | 8 | 249 | 102400 | ||
219383685 | wizardleen | C | Aug. 18, 2023, 12:42 a.m. | OK | Java 17 | TESTS | 8 | 249 | 9113600 | ||
219365661 | daksh_02 | C | Aug. 17, 2023, 7:08 p.m. | OK | Java 17 | TESTS | 8 | 265 | 614400 | ||
219360695 | dinosparton_013 | C | Aug. 17, 2023, 6:17 p.m. | OK | Java 17 | TESTS | 8 | 280 | 5222400 | ||
219349470 | ahmed.elbakly | C | Aug. 17, 2023, 4:54 p.m. | OK | Java 17 | TESTS | 8 | 405 | 23142400 | ||
219364053 | BlizGale | C | Aug. 17, 2023, 6:50 p.m. | OK | Java 17 | TESTS | 8 | 576 | 716800 | ||
219372764 | prathamtyagii | C | Aug. 17, 2023, 8:42 p.m. | OK | Java 17 | TESTS | 8 | 608 | 27136000 | ||
219347451 | kk2525 | C | Aug. 17, 2023, 4:44 p.m. | OK | Java 17 | TESTS | 8 | 716 | 44851200 | ||
219396608 | Sumitsingh7 | C | Aug. 18, 2023, 4:18 a.m. | OK | Java 8 | TESTS | 8 | 202 | 2764800 | ||
219364767 | vatsal_04 | C | Aug. 17, 2023, 6:58 p.m. | OK | Java 8 | TESTS | 8 | 311 | 24678400 | ||
219348552 | Sanat04 | C | Aug. 17, 2023, 4:49 p.m. | OK | Java 8 | TESTS | 8 | 421 | 0 | ||
219346056 | kirsh_kkm | C | Aug. 17, 2023, 4:39 p.m. | OK | Java 8 | TESTS | 8 | 514 | 4505600 | ||
219387809 | faresbadr316 | C | Aug. 18, 2023, 2:01 a.m. | OK | Java 8 | TESTS | 8 | 530 | 41881600 | ||
219348340 | Ahmad_Hoseiny | C | Aug. 17, 2023, 4:48 p.m. | OK | Java 8 | TESTS | 8 | 576 | 28876800 | ||
219347942 | My_Tmp_Account | C | Aug. 17, 2023, 4:47 p.m. | OK | Java 8 | TESTS | 8 | 576 | 28876800 | ||
219383567 | faresbadr316 | C | Aug. 18, 2023, 12:38 a.m. | OK | Java 8 | TESTS | 8 | 842 | 41881600 | ||
219342915 | priyaroy3370 | C | Aug. 17, 2023, 4:33 p.m. | OK | Java 8 | TESTS | 8 | 1309 | 192307200 | ||
219359252 | Abdalrhmank | C | Aug. 17, 2023, 6:04 p.m. | OK | MS C++ 2017 | TESTS | 8 | 265 | 10137600 | ||
219366583 | grente | C | Aug. 17, 2023, 7:18 p.m. | OK | PyPy 3 | TESTS | 8 | 280 | 21196800 | ||
219348706 | KamillaRa | C | Aug. 17, 2023, 4:50 p.m. | OK | PyPy 3 | TESTS | 8 | 280 | 22118400 | ||
219352610 | lol_py | C | Aug. 17, 2023, 5:12 p.m. | OK | PyPy 3 | TESTS | 8 | 389 | 22528000 | ||
219362705 | Imeon | C | Aug. 17, 2023, 6:35 p.m. | OK | PyPy 3 | TESTS | 8 | 1840 | 28876800 | ||
219362671 | Imeon | C | Aug. 17, 2023, 6:35 p.m. | OK | PyPy 3 | TESTS | 8 | 1950 | 27545600 | ||
219401025 | Youarenotgood | C | Aug. 18, 2023, 5:17 a.m. | OK | PyPy 3-64 | TESTS | 8 | 109 | 24883200 | ||
219354335 | gardengnome | C | Aug. 17, 2023, 5:23 p.m. | OK | PyPy 3-64 | TESTS | 8 | 124 | 30720000 | ||
219359163 | RobinFromTheHood | C | Aug. 17, 2023, 6:03 p.m. | OK | PyPy 3-64 | TESTS | 8 | 124 | 30924800 | ||
219361774 | cupcake123 | C | Aug. 17, 2023, 6:26 p.m. | OK | PyPy 3-64 | TESTS | 8 | 124 | 34713600 | ||
219403405 | bkdn23.thuonguyenvan | C | Aug. 18, 2023, 5:45 a.m. | OK | PyPy 3-64 | TESTS | 8 | 124 | 35840000 | ||
219403112 | tnv2004 | C | Aug. 18, 2023, 5:42 a.m. | OK | PyPy 3-64 | TESTS | 8 | 124 | 35840000 | ||
219380666 | namandamani3112 | C | Aug. 17, 2023, 11:11 p.m. | OK | PyPy 3-64 | TESTS | 8 | 124 | 35840000 | ||
219355175 | yuki_keshiki | C | Aug. 17, 2023, 5:30 p.m. | OK | PyPy 3-64 | TESTS | 8 | 124 | 35840000 | ||
219387041 | mikeac | C | Aug. 18, 2023, 1:48 a.m. | OK | PyPy 3-64 | TESTS | 8 | 124 | 36147200 | ||
219357054 | Soultaker | C | Aug. 17, 2023, 5:45 p.m. | OK | PyPy 3-64 | TESTS | 8 | 139 | 34816000 | ||
219388879 | alexpods | C | Aug. 18, 2023, 2:21 a.m. | OK | Python 3 | TESTS | 8 | 140 | 40038400 | ||
219388277 | alexpods | C | Aug. 18, 2023, 2:09 a.m. | OK | Python 3 | TESTS | 8 | 171 | 37580800 | ||
219404367 | Sahithi_banala | C | Aug. 18, 2023, 5:57 a.m. | OK | Python 3 | TESTS | 8 | 171 | 40038400 | ||
219372721 | tanishq2507 | C | Aug. 17, 2023, 8:41 p.m. | OK | Python 3 | TESTS | 8 | 187 | 39833600 | ||
219396499 | Black_Killer | C | Aug. 18, 2023, 4:17 a.m. | OK | Python 3 | TESTS | 8 | 187 | 40038400 | ||
219388060 | Black_Killer | C | Aug. 18, 2023, 2:06 a.m. | OK | Python 3 | TESTS | 8 | 187 | 40038400 | ||
219367737 | mamun_cseian | C | Aug. 17, 2023, 7:31 p.m. | OK | Python 3 | TESTS | 8 | 202 | 37580800 | ||
219348968 | Yorik123 | C | Aug. 17, 2023, 4:51 p.m. | OK | Python 3 | TESTS | 8 | 202 | 40038400 | ||
219347864 | gauva_sauce | C | Aug. 17, 2023, 4:46 p.m. | OK | Python 3 | TESTS | 8 | 233 | 40038400 | ||
219354556 | kinglykang | C | Aug. 17, 2023, 5:25 p.m. | OK | Python 3 | TESTS | 8 | 249 | 40038400 | ||
219384884 | ilyshana | C | Aug. 18, 2023, 1:09 a.m. | OK | Rust 2021 | TESTS | 8 | 31 | 11059200 | ||
219349613 | Sarievo | C | Aug. 17, 2023, 4:55 p.m. | OK | Rust 2021 | TESTS | 8 | 46 | 9216000 | ||
219403018 | kiddoos | C | Aug. 18, 2023, 5:41 a.m. | OK | Rust 2021 | TESTS | 8 | 61 | 7884800 |
Back to search problems