Codeforces Round 814 (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
1719 Codeforces Round 814 (Div. 2) FINISHED False 7200 71162699 Aug. 16, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 13331 ) C Fighting Tournament PROGRAMMING binary search data structures implementation two pointers

B'Burenka is about to watch the most interesting sporting event of the year -- a fighting tournament organized by her friend Tonya. n athletes participate in the tournament, numbered from 1 to n . Burenka determined the strength of the i -th athlete as an integer a_i , where 1 <= q a_i <= q n . All the strength values are different, that is, the array a is a permutation of length n . We know that in a fight, if a_i > a_j , then the i -th participant always wins the j -th. The tournament goes like this: initially, all n athletes line up in ascending order of their ids, and then there are infinitely many fighting rounds. In each round there is exactly one fight: the first two people in line come out and fight. The winner goes back to the front of the line, and the loser goes to the back. Burenka decided to ask Tonya q questions. In each question, Burenka asks how many victories the i -th participant gets in the first k rounds of the competition for some given numbers i and k . Tonya is not very good at analytics, so he asks you to help him answer all the questions. The first line contains one integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. Description of the test cases follows. The first line of each test case contains two integers n and q ( 2 <= q n <= q 10^5 , 1 <= q q <= q 10^5 ) -- the number of tournament participants and the number of questions. The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= q a_i <= q n ) -- the array a , which is a permutation. The next q lines of a test case contain questions. Each line contains two integers i and k ( 1 <= q i <= q n , 1 <= q k <= q 10^9 ) -- the number of the participant and the number of rounds. It is guaranteed that the sum of n and the sum of q over all test cases do not exceed $$'...

Tutorials

Codeforces Round #814 (Div. 1, Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
168641119 CLown1331 C Aug. 17, 2022, 2:33 a.m. OK C# 10 TESTS 23 561 19046400
168609475 ruban C Aug. 16, 2022, 5:58 p.m. OK Delphi TESTS 19 93 35328000
168636907 ssilrrr_LUOGU C Aug. 17, 2022, 1:26 a.m. OK GNU C++14 TESTS 23 46 13107200
168642904 eiwofnofierig C Aug. 17, 2022, 3:02 a.m. OK GNU C++14 TESTS 23 62 1536000
168625682 Babbar_606 C Aug. 16, 2022, 8:55 p.m. OK GNU C++14 TESTS 23 62 1536000
168636700 1528344561 C Aug. 17, 2022, 1:22 a.m. OK GNU C++14 TESTS 23 62 2969600
168598317 vasudev1642002 C Aug. 16, 2022, 4:31 p.m. OK GNU C++14 TESTS 19 77 1228800
168651764 TimmyL C Aug. 17, 2022, 5:16 a.m. OK GNU C++14 TESTS 23 77 2764800
168595970 Ice_teapoy C Aug. 16, 2022, 4:27 p.m. OK GNU C++14 TESTS 19 77 2867200
168648224 wenruxiaogou C Aug. 17, 2022, 4:25 a.m. OK GNU C++14 TESTS 23 77 26112000
168647259 happycrazzy C Aug. 17, 2022, 4:10 a.m. OK GNU C++14 TESTS 23 78 819200
168634855 pzjNB C Aug. 17, 2022, 12:41 a.m. OK GNU C++14 TESTS 23 78 819200
168598886 deities C Aug. 16, 2022, 4:31 p.m. OK GNU C++17 TESTS 19 46 819200
168653878 ultranoob_coder C Aug. 17, 2022, 5:44 a.m. OK GNU C++17 TESTS 23 77 819200
168605231 Turkhuuu C Aug. 16, 2022, 5:36 p.m. OK GNU C++17 TESTS 19 77 1228800
168644061 wuliaodea C Aug. 17, 2022, 3:19 a.m. OK GNU C++17 TESTS 23 77 1331200
168610703 andrei_boaca C Aug. 16, 2022, 6:07 p.m. OK GNU C++17 TESTS 19 77 2867200
168629424 NWm C Aug. 16, 2022, 10:07 p.m. OK GNU C++17 TESTS 23 77 3174400
168637868 sumanthbittu C Aug. 17, 2022, 1:44 a.m. OK GNU C++17 TESTS 23 77 3481600
168611634 patou C Aug. 16, 2022, 6:13 p.m. OK GNU C++17 TESTS 21 77 3788800
168641575 SevenIncense C Aug. 17, 2022, 2:41 a.m. OK GNU C++17 TESTS 23 77 4198400
168639010 chennanjun C Aug. 17, 2022, 2:04 a.m. OK GNU C++17 TESTS 23 77 4710400
168652391 OTTFF C Aug. 17, 2022, 5:25 a.m. OK GNU C++17 (64) TESTS 23 46 1228800
168638303 xiece666 C Aug. 17, 2022, 1:52 a.m. OK GNU C++17 (64) TESTS 23 46 1843200
168639062 lolilolikon C Aug. 17, 2022, 2:05 a.m. OK GNU C++17 (64) TESTS 23 46 12083200
168642069 margo820 C Aug. 17, 2022, 2:49 a.m. OK GNU C++17 (64) TESTS 23 61 1228800
168609535 Mac.Rose C Aug. 16, 2022, 5:59 p.m. OK GNU C++17 (64) TESTS 19 61 1638400
168642019 ggcoder C Aug. 17, 2022, 2:48 a.m. OK GNU C++17 (64) TESTS 23 62 819200
168642551 xhgua C Aug. 17, 2022, 2:57 a.m. OK GNU C++17 (64) TESTS 23 62 1228800
168642239 xhgua C Aug. 17, 2022, 2:51 a.m. OK GNU C++17 (64) TESTS 23 62 1228800
168641623 chiruno233 C Aug. 17, 2022, 2:42 a.m. OK GNU C++17 (64) TESTS 23 62 1228800
168635010 Fang1 C Aug. 17, 2022, 12:45 a.m. OK GNU C++17 (64) TESTS 23 62 1228800
168649009 Esraa_A_Gaber C Aug. 17, 2022, 4:37 a.m. OK GNU C++20 (64) TESTS 23 46 819200
168642245 A_king C Aug. 17, 2022, 2:52 a.m. OK GNU C++20 (64) TESTS 23 46 819200
168637970 Daluca C Aug. 17, 2022, 1:46 a.m. OK GNU C++20 (64) TESTS 23 46 819200
168636486 downpour C Aug. 17, 2022, 1:17 a.m. OK GNU C++20 (64) TESTS 23 46 819200
168633862 Hanonymous C Aug. 17, 2022, 12:15 a.m. OK GNU C++20 (64) TESTS 23 46 819200
168626682 noomaK C Aug. 16, 2022, 9:12 p.m. OK GNU C++20 (64) TESTS 23 46 819200
168626659 noomaK C Aug. 16, 2022, 9:12 p.m. OK GNU C++20 (64) TESTS 23 46 819200
168612269 ldyllic C Aug. 16, 2022, 6:18 p.m. OK GNU C++20 (64) TESTS 21 46 819200
168599316 new_red C Aug. 16, 2022, 4:32 p.m. OK GNU C++20 (64) TESTS 19 46 819200
168595729 kshitijbajaj2020565 C Aug. 16, 2022, 4:26 p.m. OK GNU C++20 (64) TESTS 19 46 819200
168612705 Cromel C Aug. 16, 2022, 6:22 p.m. OK Go TESTS 21 343 3379200
168615952 VicG C Aug. 16, 2022, 6:50 p.m. OK Java 11 TESTS 22 234 0
168605126 x21svage C Aug. 16, 2022, 5:36 p.m. OK Java 11 TESTS 19 280 0
168640676 aditya2024 C Aug. 17, 2022, 2:26 a.m. OK Java 11 TESTS 23 280 1433600
168608470 gurkaran_s C Aug. 16, 2022, 5:52 p.m. OK Java 11 TESTS 19 280 2355200
168609983 SAMAD_ C Aug. 16, 2022, 6:02 p.m. OK Java 11 TESTS 19 311 3481600
168608396 IanISam C Aug. 16, 2022, 5:52 p.m. OK Java 11 TESTS 19 327 1024000
168621124 gauravbajaj C Aug. 16, 2022, 7:49 p.m. OK Java 11 TESTS 22 327 15155200
168597515 himanshu19468 C Aug. 16, 2022, 4:29 p.m. OK Java 11 TESTS 19 358 9216000
168608653 tanish_1131 C Aug. 16, 2022, 5:53 p.m. OK Java 11 TESTS 19 685 2662400
168637692 pushkar.lonkar21 C Aug. 17, 2022, 1:41 a.m. OK Java 11 TESTS 23 811 102400
168606108 Eslam_Ahmed C Aug. 16, 2022, 5:40 p.m. OK Java 17 TESTS 19 342 716800
168600680 harshaltaory1111 C Aug. 16, 2022, 4:34 p.m. OK Java 17 TESTS 19 1746 819200
168650062 ND_ C Aug. 17, 2022, 4:53 a.m. OK Java 8 TESTS 23 124 0
168595581 madhav2800 C Aug. 16, 2022, 4:26 p.m. OK Java 8 TESTS 19 155 0
168630784 Washoum C Aug. 16, 2022, 10:39 p.m. OK Java 8 TESTS 23 171 0
168615409 gagan_6730 C Aug. 16, 2022, 6:45 p.m. OK Java 8 TESTS 22 171 0
168609343 Mohamed_A7med C Aug. 16, 2022, 5:58 p.m. OK Java 8 TESTS 19 171 0
168606278 Eslam_Ahmed C Aug. 16, 2022, 5:41 p.m. OK Java 8 TESTS 19 171 0
168631531 BhargavModha C Aug. 16, 2022, 11:02 p.m. OK Java 8 TESTS 23 187 0
168654273 yashpandey73 C Aug. 17, 2022, 5:49 a.m. OK Java 8 TESTS 23 187 7372800
168627845 ahmedTarek28 C Aug. 16, 2022, 9:34 p.m. OK Java 8 TESTS 23 202 5120000
168627749 ahmedTarek28 C Aug. 16, 2022, 9:32 p.m. OK Java 8 TESTS 23 218 6553600
168596976 Ayushcoder C Aug. 16, 2022, 4:28 p.m. OK MS C++ 2017 TESTS 19 296 2457600
168608610 KKastaneda C Aug. 16, 2022, 5:53 p.m. OK MS C++ 2017 TESTS 19 623 409600
168614265 k4Jl1Zp0pbl C Aug. 16, 2022, 6:35 p.m. OK MS C++ 2017 TESTS 22 638 2457600
168641666 Agateth C Aug. 17, 2022, 2:42 a.m. OK MS C++ 2017 TESTS 23 670 819200
168597701 Fish_L C Aug. 16, 2022, 4:30 p.m. OK MS C++ 2017 TESTS 19 826 5017600
168599014 jithomp C Aug. 16, 2022, 4:32 p.m. OK MS C++ 2017 TESTS 19 1435 409600
168631848 XYShaoKang C Aug. 16, 2022, 11:19 p.m. OK Node.js TESTS 23 389 35225600
168605426 1_2_3_4_5_9 C Aug. 16, 2022, 5:37 p.m. OK PyPy 2 TESTS 19 233 22937600
168605643 aayush_chhabra C Aug. 16, 2022, 5:38 p.m. OK PyPy 3 TESTS 19 326 16384000
168597871 wizardrabbit C Aug. 16, 2022, 4:30 p.m. OK PyPy 3 TESTS 19 389 10444800
168614204 brainphuck C Aug. 16, 2022, 6:34 p.m. OK PyPy 3 TESTS 22 405 16998400
168618849 grawlixes C Aug. 16, 2022, 7:21 p.m. OK PyPy 3 TESTS 22 561 24371200
168599671 abineth C Aug. 16, 2022, 4:32 p.m. OK PyPy 3 TESTS 19 639 33996800
168601213 MohamedHamed123 C Aug. 16, 2022, 4:34 p.m. OK PyPy 3 TESTS 19 779 11161600
168626173 Su_123 C Aug. 16, 2022, 9:03 p.m. OK PyPy 3 TESTS 23 1591 14336000
168608056 DaniilNemtsev C Aug. 16, 2022, 5:50 p.m. OK PyPy 3 TESTS 19 1622 12083200
168606298 pxhdg C Aug. 16, 2022, 5:41 p.m. OK PyPy 3-64 TESTS 19 140 19148800
168634919 Lhohelhohehmm C Aug. 17, 2022, 12:43 a.m. OK PyPy 3-64 TESTS 23 218 13516800
168609089 rafle C Aug. 16, 2022, 5:56 p.m. OK PyPy 3-64 TESTS 19 218 21504000
168635044 Lhohelhohehmm C Aug. 17, 2022, 12:45 a.m. OK PyPy 3-64 TESTS 23 218 24883200
168598794 nsharc4 C Aug. 16, 2022, 4:31 p.m. OK PyPy 3-64 TESTS 19 233 14233600
168618794 Pandeyjiii8250 C Aug. 16, 2022, 7:21 p.m. OK PyPy 3-64 TESTS 22 233 16588800
168652844 zhenfisher C Aug. 17, 2022, 5:31 a.m. OK PyPy 3-64 TESTS 23 248 17612800
168613841 juLeena C Aug. 16, 2022, 6:31 p.m. OK PyPy 3-64 TESTS 21 249 16384000
168635064 Lhohelhohehmm C Aug. 17, 2022, 12:46 a.m. OK PyPy 3-64 TESTS 23 249 27852800
168635086 Lhohelhohehmm C Aug. 17, 2022, 12:47 a.m. OK PyPy 3-64 TESTS 23 249 27955200
168644746 Jvaeyhcd C Aug. 17, 2022, 3:30 a.m. OK Python 3 TESTS 23 452 7782400
168642298 NS3081992 C Aug. 17, 2022, 2:53 a.m. OK Python 3 TESTS 23 452 9216000
168614813 abhijeetgupto1 C Aug. 16, 2022, 6:40 p.m. OK Python 3 TESTS 22 514 24473600
168597040 b20190 C Aug. 16, 2022, 4:29 p.m. OK Python 3 TESTS 19 795 29696000
168600635 Lcz C Aug. 16, 2022, 4:34 p.m. OK Python 3 TESTS 19 982 5632000
168610967 3_SWORD_STYLE C Aug. 16, 2022, 6:09 p.m. OK Python 3 TESTS 19 1013 7168000
168614687 ssarwarbd C Aug. 16, 2022, 6:38 p.m. OK Python 3 TESTS 22 1014 7065600
168626087 Su_123 C Aug. 16, 2022, 9:02 p.m. OK Python 3 TESTS 23 1028 10137600
168626715 samiksha_09 C Aug. 16, 2022, 9:13 p.m. OK Python 3 TESTS 23 1045 13107200
168653546 rishav__01 C Aug. 17, 2022, 5:40 a.m. OK Python 3 TESTS 23 1076 7065600
168627936 Hyrulia C Aug. 16, 2022, 9:35 p.m. OK Rust 2021 TESTS 23 31 24064000
168617680 Hyrulia C Aug. 16, 2022, 7:08 p.m. OK Rust 2021 TESTS 22 764 12288000

remove filters

Back to search problems