Educational Codeforces Round 35 (Rated for 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
911 Educational Codeforces Round 35 (Rated for Div. 2) FINISHED False 7200 222710063 Dec. 28, 2017, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4657 ) D Inversion Counting PROGRAMMING brute force math 1700

B'A permutation of size n is an array of size n such that each integer from 1 to n occurs exactly once in this array. An inversion in a permutation p is a pair of indices (i, xe2 x80 x89j) such that i xe2 x80 x89> xe2 x80 x89j and ai xe2 x80 x89< xe2 x80 x89aj. For example, a permutation [4, xe2 x80 x891, xe2 x80 x893, xe2 x80 x892] contains 4 inversions: (2, xe2 x80 x891), (3, xe2 x80 x891), (4, xe2 x80 x891), (4, xe2 x80 x893). You are given a permutation a of size n and m queries to it. Each query is represented by two indices l and r denoting that you have to reverse the segment [l, xe2 x80 x89r] of the permutation. For example, if a xe2 x80 x89= xe2 x80 x89[1, xe2 x80 x892, xe2 x80 x893, xe2 x80 x894] and a query l xe2 x80 x89= xe2 x80 x892, r xe2 x80 x89= xe2 x80 x894 is applied, then the resulting permutation is [1, xe2 x80 x894, xe2 x80 x893, xe2 x80 x892]. After each query you have to determine whether the number of inversions is odd or even. The first line contains one integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891500) -- the size of the permutation. The second line contains n integers a1, a2, ..., an (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) -- the elements of the permutation. These integers are pairwise distinct. The third line contains one integer m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x892 xc2 xb7105) -- the number of queries to process. Then m lines follow, i-th line containing two integers li, ri (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89li xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ri xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) denoting that i-th query is to reverse a segment [li, xe2 x80 x89ri] of the permutation. All queries are performed one after another. Print m lines. i-th of them must be equal to odd if the number of inversions in the permutation after i-th query is odd, and even otherwise. The first example: The second example: '...

Tutorials

T

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
33799347 nanae1914 D Dec. 30, 2017, 2:49 a.m. OK D TESTS 23 186 7168000 1700
33740921 ruban D Dec. 28, 2017, 4:43 p.m. OK Delphi TESTS 23 62 22528000 1700
33760560 Choppa D Dec. 29, 2017, 1:17 p.m. OK FPC TESTS 23 420 1638400 1700
33752639 Potassium D Dec. 29, 2017, 6:42 a.m. OK FPC TESTS 23 436 1638400 1700
35083404 dambosin D Feb. 9, 2018, 8:46 a.m. OK FPC TESTS 23 467 1638400 1700
58476948 luogu_bot1 D Aug. 9, 2019, 3:34 a.m. OK FPC TESTS 23 638 0 1700
58477558 luogu_bot4 D Aug. 9, 2019, 3:49 a.m. OK FPC TESTS 23 639 409600 1700
34188452 vjudge3 D Jan. 15, 2018, 4:13 a.m. OK GNU C TESTS 23 78 1843200 1700
34188431 vjudge2 D Jan. 15, 2018, 4:11 a.m. OK GNU C TESTS 23 78 1843200 1700
34165293 vjudge4 D Jan. 14, 2018, 2:46 a.m. OK GNU C TESTS 23 78 1843200 1700
33888995 kumar99 D Jan. 3, 2018, 4:36 p.m. OK GNU C TESTS 23 78 1843200 1700
33801588 gaelim D Dec. 30, 2017, 5:43 a.m. OK GNU C TESTS 23 78 1843200 1700
35332675 anirudhbansal D Feb. 16, 2018, 9:50 a.m. OK GNU C TESTS 23 78 2048000 1700
34645789 skavor D Jan. 28, 2018, 11:55 p.m. OK GNU C TESTS 23 93 1843200 1700
34256738 vjudge3 D Jan. 17, 2018, 4:14 p.m. OK GNU C TESTS 23 93 1843200 1700
33742607 ziyi D Dec. 28, 2017, 5:47 p.m. OK GNU C TESTS 23 93 1843200 1700
33732628 physics0523 D Dec. 28, 2017, 3:22 p.m. OK GNU C TESTS 23 93 3993600 1700
34507615 Scut82 D Jan. 24, 2018, 7:34 a.m. OK GNU C++ TESTS 23 31 2048000 1700
34412831 HenryPigLi D Jan. 21, 2018, 12:03 p.m. OK GNU C++ TESTS 23 31 2048000 1700
34434727 vjudge3 D Jan. 22, 2018, 6:25 a.m. OK GNU C++ TESTS 23 31 3072000 1700
33995090 vjudge2 D Jan. 8, 2018, 12:02 a.m. OK GNU C++ TESTS 23 31 3481600 1700
33846099 skylee D Jan. 1, 2018, 11:43 a.m. OK GNU C++ TESTS 23 46 1843200 1700
34509394 Scut82 D Jan. 24, 2018, 8:27 a.m. OK GNU C++ TESTS 23 46 2048000 1700
34508246 Scut82 D Jan. 24, 2018, 7:52 a.m. OK GNU C++ TESTS 23 46 2048000 1700
34508081 Scut82 D Jan. 24, 2018, 7:47 a.m. OK GNU C++ TESTS 23 46 2048000 1700
34507986 Scut82 D Jan. 24, 2018, 7:44 a.m. OK GNU C++ TESTS 23 46 2048000 1700
33995601 vjudge1 D Jan. 8, 2018, 1:35 a.m. OK GNU C++ TESTS 23 46 2048000 1700
35525223 xiao-xiao D Feb. 20, 2018, 3:04 p.m. OK GNU C11 TESTS 23 77 1843200 1700
52755841 Noble_Mushtak D April 14, 2019, 4:50 p.m. OK GNU C11 TESTS 23 93 0 1700
33731278 CtrlCV D Dec. 28, 2017, 3:13 p.m. OK GNU C11 TESTS 23 93 1843200 1700
33763674 codemart786 D Dec. 29, 2017, 3:39 p.m. OK GNU C11 TESTS 23 93 1843200 1700
52464563 rainboy D April 7, 2019, 2:56 p.m. OK GNU C11 TESTS 23 670 0 1700
50041876 luogu_bot5 D Feb. 17, 2019, 2:40 a.m. OK GNU C11 TESTS 23 686 102400 1700
34253274 vjudge5 D Jan. 17, 2018, 1:44 p.m. OK GNU C11 TESTS 23 826 1843200 1700
34286415 madalin D Jan. 18, 2018, 9:03 p.m. OK GNU C11 TESTS 23 826 1843200 1700
34177843 vjudge5 D Jan. 14, 2018, 2:43 p.m. OK GNU C11 TESTS 23 841 1843200 1700
34632929 Learn_C D Jan. 28, 2018, 12:40 p.m. OK GNU C11 TESTS 23 841 1843200 1700
43826893 vjudge2 D Oct. 5, 2018, 12:16 p.m. OK GNU C++11 TESTS 23 31 1126400 1700
34262708 k3nz0 D Jan. 17, 2018, 11:01 p.m. OK GNU C++11 TESTS 23 31 2048000 1700
33733276 eddy1021 D Dec. 28, 2017, 3:26 p.m. OK GNU C++11 TESTS 23 31 2048000 1700
63779067 Enderturtle D Oct. 30, 2019, 10:29 a.m. OK GNU C++11 TESTS 23 46 0 1700
63763203 Eric_Aslan D Oct. 30, 2019, 5:04 a.m. OK GNU C++11 TESTS 23 46 0 1700
61693760 saitoasuka D Oct. 2, 2019, 6:25 a.m. OK GNU C++11 TESTS 23 46 0 1700
57785000 luogu_bot4 D July 26, 2019, 7:26 a.m. OK GNU C++11 TESTS 23 46 0 1700
58975484 wyy2004 D Aug. 18, 2019, 12:12 a.m. OK GNU C++11 TESTS 23 46 0 1700
55938772 sunny_fei D June 22, 2019, 3:22 p.m. OK GNU C++11 TESTS 23 46 0 1700
49909636 luogu_bot5 D Feb. 14, 2019, 1:35 p.m. OK GNU C++11 TESTS 23 46 0 1700
34220002 _AjReme_ D Jan. 16, 2018, 11:33 a.m. OK GNU C++14 TESTS 23 31 1945600 1700
33736611 BFF D Dec. 28, 2017, 3:49 p.m. OK GNU C++14 TESTS 23 31 1945600 1700
49695095 blinkshot D Feb. 10, 2019, 1:21 p.m. OK GNU C++14 TESTS 23 46 2150400 1700
33801185 Barceloner D Dec. 30, 2017, 5:20 a.m. OK GNU C++14 TESTS 23 62 10956800 1700
33732663 lwqqq D Dec. 28, 2017, 3:22 p.m. OK GNU C++14 TESTS 23 77 1945600 1700
33838174 spatarel D Dec. 31, 2017, 8:13 p.m. OK GNU C++14 TESTS 23 78 1843200 1700
33739946 d_OwO_b D Dec. 28, 2017, 4:18 p.m. OK GNU C++14 TESTS 23 78 1843200 1700
34799536 zuzhiang D Feb. 1, 2018, 11:03 a.m. OK GNU C++14 TESTS 23 78 1843200 1700
33919170 machadianurag1996 D Jan. 5, 2018, 9:49 a.m. OK GNU C++14 TESTS 23 78 1843200 1700
35179835 dotorya D Feb. 12, 2018, 1:53 p.m. OK GNU C++14 TESTS 23 78 1945600 1700
41247975 QuincyTan D Aug. 5, 2018, 2:16 p.m. OK GNU C++17 TESTS 23 78 0 1700
67491495 LilMeyer D Dec. 23, 2019, 7:39 p.m. OK GNU C++17 TESTS 23 93 0 1700
69500522 Acceptedumbrella D Jan. 25, 2020, 6:23 a.m. OK GNU C++17 TESTS 23 93 0 1700
54467724 vjudge4 D May 22, 2019, 2:06 a.m. OK GNU C++17 TESTS 23 93 0 1700
56811282 themechanicalcoder D July 10, 2019, 4:17 p.m. OK GNU C++17 TESTS 23 93 0 1700
61913485 toysheeyeyraku D Oct. 5, 2019, 11:30 a.m. OK GNU C++17 TESTS 23 93 0 1700
41247941 QuincyTan D Aug. 5, 2018, 2:15 p.m. OK GNU C++17 TESTS 23 93 0 1700
58844625 _S_i_v_ D Aug. 15, 2019, 4:28 a.m. OK GNU C++17 TESTS 23 93 409600 1700
52475379 MetB D April 7, 2019, 10:07 p.m. OK GNU C++17 TESTS 23 93 819200 1700
38120234 dendi239 D May 11, 2018, 5:22 p.m. OK GNU C++17 TESTS 23 93 3481600 1700
33883779 togatoga D Jan. 3, 2018, 11:40 a.m. OK Go TESTS 23 623 27545600 1700
33870480 filo D Jan. 2, 2018, 5:02 p.m. OK Go TESTS 23 842 27443200 1700
33840786 faultrit D Jan. 1, 2018, 1:52 a.m. OK Haskell TESTS 23 1497 54272000 1700
33741202 Kelang D Dec. 28, 2017, 4:53 p.m. OK Haskell TESTS 23 1543 53350400 1700
34079198 noob__coder D Jan. 11, 2018, 12:59 a.m. OK Java 8 TESTS 23 155 20684800 1700
33741160 spandey128 D Dec. 28, 2017, 4:51 p.m. OK Java 8 TESTS 23 155 20684800 1700
33731788 xodiac D Dec. 28, 2017, 3:17 p.m. OK Java 8 TESTS 23 155 20684800 1700
33753353 Maulik_Patel D Dec. 29, 2017, 7:23 a.m. OK Java 8 TESTS 23 155 20889600 1700
33743177 hulk_man D Dec. 28, 2017, 6:14 p.m. OK Java 8 TESTS 23 155 20889600 1700
33753144 umang._.panchal D Dec. 29, 2017, 7:12 a.m. OK Java 8 TESTS 23 156 20684800 1700
33748121 K_B_C_S D Dec. 29, 2017, 1:23 a.m. OK Java 8 TESTS 23 156 20684800 1700
33757356 RP_9 D Dec. 29, 2017, 10:49 a.m. OK Java 8 TESTS 23 156 20889600 1700
61740220 StayAwayFromBitches D Oct. 2, 2019, 7:52 p.m. OK Java 8 TESTS 23 171 0 1700
49531072 poiuytrewq D Feb. 6, 2019, 1:50 p.m. OK Java 8 TESTS 23 171 0 1700
39808812 gabe D June 30, 2018, 10:35 p.m. OK JavaScript TESTS 23 1122 3993600 1700
33816373 og.kostya D Dec. 30, 2017, 5:36 p.m. OK MS C# TESTS 23 62 12185600 1700
33804349 Nignucial D Dec. 30, 2017, 8:27 a.m. OK MS C# TESTS 23 218 37785600 1700
33995686 vjudge2 D Jan. 8, 2018, 1:51 a.m. OK MS C++ TESTS 23 78 2048000 1700
33733841 G.B. D Dec. 28, 2017, 3:30 p.m. OK MS C++ TESTS 23 78 2048000 1700
43827566 vjudge3 D Oct. 5, 2018, 12:33 p.m. OK MS C++ TESTS 23 92 307200 1700
60481313 vjudge1 D Sept. 13, 2019, 10:36 a.m. OK MS C++ TESTS 23 93 0 1700
38589512 scorpiowf D May 24, 2018, 2:27 p.m. OK MS C++ TESTS 23 93 0 1700
35586432 vjudge3 D Feb. 23, 2018, 1:24 a.m. OK MS C++ TESTS 23 93 2048000 1700
35151233 RCG D Feb. 11, 2018, 11:25 a.m. OK MS C++ TESTS 23 93 2048000 1700
33864981 vjudge5 D Jan. 2, 2018, 1:52 p.m. OK MS C++ TESTS 23 93 2048000 1700
33734476 math957963 D Dec. 28, 2017, 3:34 p.m. OK MS C++ TESTS 23 93 2048000 1700
35959726 vjudge2 D March 5, 2018, 8:46 a.m. OK MS C++ TESTS 23 93 2150400 1700
63724504 wh2005 D Oct. 29, 2019, 12:19 p.m. OK MS C++ 2017 TESTS 23 140 0 1700
63624004 EDawn D Oct. 28, 2019, 2:04 a.m. OK MS C++ 2017 TESTS 23 140 0 1700
33734795 Jonic D Dec. 28, 2017, 3:37 p.m. OK PascalABC.NET TESTS 23 1950 19968000 1700
34126488 n3chto D Jan. 13, 2018, 12:10 p.m. OK PyPy 2 TESTS 23 233 40755200 1700
60479928 vjudge1 D Sept. 13, 2019, 9:55 a.m. OK PyPy 2 TESTS 23 280 7577600 1700
34126474 n3chto D Jan. 13, 2018, 12:10 p.m. OK PyPy 2 TESTS 23 280 41164800 1700
34064024 arpantarkas D Jan. 10, 2018, 7:34 a.m. OK PyPy 2 TESTS 23 1777 29900800 1700
34123079 n3chto D Jan. 13, 2018, 9:11 a.m. OK PyPy 2 TESTS 23 1809 25395200 1700
69880697 codershuvo D Jan. 31, 2020, 6:14 a.m. OK PyPy 3 TESTS 23 561 10854400 1700
33852472 DASmirnov D Jan. 1, 2018, 5:57 p.m. OK PyPy 3 TESTS 23 577 30822400 1700
33754476 Rostd D Dec. 29, 2017, 8:18 a.m. OK PyPy 3 TESTS 23 623 30412800 1700
33754489 Rostd D Dec. 29, 2017, 8:19 a.m. OK PyPy 3 TESTS 23 655 30822400 1700
33740341 madn D Dec. 28, 2017, 4:27 p.m. OK PyPy 3 TESTS 23 717 30310400 1700
34122942 n3chto D Jan. 13, 2018, 9:04 a.m. OK PyPy 3 TESTS 23 795 29696000 1700
34402481 agh D Jan. 21, 2018, 6:23 a.m. OK PyPy 3 TESTS 23 826 30105600 1700
61895255 ashok123 D Oct. 5, 2019, 7:03 a.m. OK PyPy 3 TESTS 23 1668 12083200 1700
60481042 vjudge5 D Sept. 13, 2019, 10:28 a.m. OK PyPy 3 TESTS 23 1684 11571200 1700
33737115 kjnh10 D Dec. 28, 2017, 3:53 p.m. OK PyPy 3 TESTS 23 1746 59699200 1700
33761055 scorpion D Dec. 29, 2017, 1:39 p.m. OK Python 2 TESTS 23 655 8089600 1700
33746386 pavankatta D Dec. 28, 2017, 9:43 p.m. OK Python 2 TESTS 23 717 8089600 1700
33740187 Kelang D Dec. 28, 2017, 4:23 p.m. OK Python 2 TESTS 23 795 4710400 1700
33887127 sivasatvik D Jan. 3, 2018, 2:46 p.m. OK Python 2 TESTS 23 811 8192000 1700
33738985 abolfazl_sh D Dec. 28, 2017, 4:04 p.m. OK Python 2 TESTS 23 857 11366400 1700
45380536 GemFire D Nov. 6, 2018, 2:31 p.m. OK Python 2 TESTS 23 904 0 1700
39257207 Ali_Pi D June 15, 2018, 4:37 a.m. OK Python 2 TESTS 23 935 3481600 1700
33910839 proton0001 D Jan. 4, 2018, 7:57 p.m. OK Python 2 TESTS 23 935 7987200 1700
33896432 xlk D Jan. 4, 2018, 5:18 a.m. OK Python 2 TESTS 23 935 7987200 1700
33747007 pavankatta D Dec. 28, 2017, 10:46 p.m. OK Python 2 TESTS 23 936 8192000 1700
33838235 dcordb D Dec. 31, 2017, 8:20 p.m. OK Python 3 TESTS 23 701 15769600 1700
33822072 atryapa D Dec. 30, 2017, 10:35 p.m. OK Python 3 TESTS 23 763 10649600 1700
33995739 iehn D Jan. 8, 2018, 2 a.m. OK Python 3 TESTS 23 780 28876800 1700
33853989 Incognito D Jan. 1, 2018, 7:43 p.m. OK Python 3 TESTS 23 951 10649600 1700
33853979 Incognito D Jan. 1, 2018, 7:42 p.m. OK Python 3 TESTS 23 1014 10649600 1700
33761925 karpik D Dec. 29, 2017, 2:17 p.m. OK Python 3 TESTS 23 1060 10649600 1700
33858196 kunal23 D Jan. 2, 2018, 5:30 a.m. OK Python 3 TESTS 23 1091 10649600 1700
33858194 kunal23 D Jan. 2, 2018, 5:29 a.m. OK Python 3 TESTS 23 1107 10649600 1700
33731265 sergovoy D Dec. 28, 2017, 3:13 p.m. OK Python 3 TESTS 23 1153 10649600 1700
34402453 agh D Jan. 21, 2018, 6:22 a.m. OK Python 3 TESTS 23 1185 5939200 1700
33733217 hatoo D Dec. 28, 2017, 3:26 p.m. OK Rust TESTS 23 1091 3072000 1700
33733377 dandersonw D Dec. 28, 2017, 3:27 p.m. OK Scala TESTS 23 841 40652800 1700

remove filters

Back to search problems