Codeforces Round 301 (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
540 Codeforces Round 301 (Div. 2) FINISHED False 7200 307114223 April 30, 2015, 4:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2172 ) E Infinite Inversions PROGRAMMING binary search data structures implementation sortings trees 2400

B'There is an infinite sequence consisting of all positive integers in the increasing order: p xe2 x80 x89= xe2 x80 x89{1, xe2 x80 x892, xe2 x80 x893, xe2 x80 x89...}. We performed n swap operations with this sequence. A swap(a, xe2 x80 x89b) is an operation of swapping the elements of the sequence on positions a and b. Your task is to find the number of inversions in the resulting sequence, i.e. the number of such index pairs (i, xe2 x80 x89j), that i xe2 x80 x89< xe2 x80 x89j and pi xe2 x80 x89> xe2 x80 x89pj. The first line contains a single integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105) -- the number of swap operations applied to the sequence. Each of the next n lines contains two integers ai and bi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai, xe2 x80 x89bi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109, ai xe2 x80 x89 xe2 x89 xa0 xe2 x80 x89bi) -- the arguments of the swap operation. Print a single integer -- the number of inversions in the resulting sequence. In the first sample the sequence is being modified as follows: . It has 4 inversions formed by index pairs (1, xe2 x80 x894), (2, xe2 x80 x893), (2, xe2 x80 x894) and (3, xe2 x80 x894).'...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
14806585 SilverDH E Dec. 14, 2015, 6:06 p.m. OK FPC TESTS 70 93 3993600 2400
40986686 ReaLNero1 E July 30, 2018, 8:41 p.m. OK GNU C++ TESTS 70 62 3993600 2400
37981735 luogu_bot1 E May 6, 2018, 11:33 p.m. OK GNU C++ TESTS 70 62 14745600 2400
36259416 bhaag_milkha E March 13, 2018, 7:19 p.m. OK GNU C++ TESTS 70 77 6860800 2400
12738317 axp E Aug. 29, 2015, 4:28 a.m. OK GNU C++ TESTS 70 78 3174400 2400
20923869 cyand1317 E Sept. 26, 2016, 11:25 a.m. OK GNU C++ TESTS 70 78 4812800 2400
13904423 130705009 E Oct. 27, 2015, 7:31 p.m. OK GNU C++ TESTS 70 78 5427200 2400
18044311 SoiMae E May 23, 2016, 1:32 p.m. OK GNU C++ TESTS 70 78 5939200 2400
12397910 syc1999 E Aug. 7, 2015, 6:48 a.m. OK GNU C++ TESTS 70 93 3788800 2400
13602916 kieuquocdat123 E Oct. 14, 2015, 7:07 a.m. OK GNU C++ TESTS 70 93 3993600 2400
12113973 sdad120 E July 19, 2015, 7:30 a.m. OK GNU C++ TESTS 70 93 4812800 2400
61238960 rainboy E Sept. 24, 2019, 7:08 p.m. OK GNU C11 TESTS 70 93 7270400 2400
42137271 vjudge5 E Aug. 27, 2018, 1:26 a.m. OK GNU C++11 TESTS 70 62 7987200 2400
42137374 Ithea_Myse_Valgulious E Aug. 27, 2018, 1:32 a.m. OK GNU C++11 TESTS 70 62 7987200 2400
23515923 newgate E Jan. 3, 2017, 12:09 p.m. OK GNU C++11 TESTS 70 77 5939200 2400
11978436 HaRiSK E July 9, 2015, 12:11 a.m. OK GNU C++11 TESTS 70 78 3993600 2400
12297732 wiwitrifai E Aug. 1, 2015, 1:29 a.m. OK GNU C++11 TESTS 70 78 5324800 2400
52633463 Rand_By_Rand E April 12, 2019, 8:34 a.m. OK GNU C++11 TESTS 70 78 14028800 2400
57741610 wxl6666 E July 25, 2019, 11:37 a.m. OK GNU C++11 TESTS 70 78 14028800 2400
69229807 liuweih E Jan. 21, 2020, 9:01 a.m. OK GNU C++11 TESTS 70 93 5632000 2400
32951274 aquablitz11 E Dec. 5, 2017, 2:45 p.m. OK GNU C++11 TESTS 70 93 6041600 2400
12838225 lych123 E Sept. 4, 2015, 8:12 a.m. OK GNU C++11 TESTS 70 93 6144000 2400
29329680 vipghn4 E Aug. 10, 2017, 3:09 p.m. OK GNU C++14 TESTS 70 93 5939200 2400
44062429 kimmypracha E Oct. 10, 2018, 6:54 a.m. OK GNU C++14 TESTS 70 108 7168000 2400
43362044 BelowLuminous E Sept. 24, 2018, 9:49 a.m. OK GNU C++14 TESTS 70 109 4300800 2400
58411117 vjudge1 E Aug. 7, 2019, 1:43 a.m. OK GNU C++14 TESTS 70 109 8806400 2400
36993000 killuwa E April 5, 2018, 9:17 a.m. OK GNU C++14 TESTS 70 109 18124800 2400
28389500 baarcaa11111 E July 9, 2017, 2:55 p.m. OK GNU C++14 TESTS 70 109 21094400 2400
24278897 jcg E Jan. 30, 2017, 10:49 p.m. OK GNU C++14 TESTS 70 124 7577600 2400
48926266 JioFell E Jan. 25, 2019, 10:37 a.m. OK GNU C++14 TESTS 70 124 9625600 2400
41623812 -Emma194 E Aug. 15, 2018, 1:16 p.m. OK GNU C++14 TESTS 70 124 15257600 2400
24278887 jcg E Jan. 30, 2017, 10:48 p.m. OK GNU C++14 TESTS 70 139 7577600 2400
50881584 1804010714 E March 6, 2019, 9:08 a.m. OK GNU C++17 TESTS 70 93 7270400 2400
58425708 vjudge4 E Aug. 7, 2019, 9:36 a.m. OK GNU C++17 TESTS 70 93 16896000 2400
50882533 1804010714 E March 6, 2019, 9:33 a.m. OK GNU C++17 TESTS 70 108 7270400 2400
50882758 1804010714 E March 6, 2019, 9:40 a.m. OK GNU C++17 TESTS 70 108 7270400 2400
50909494 vjudge5 E March 6, 2019, 11:53 p.m. OK GNU C++17 TESTS 70 108 32051200 2400
45205281 YJH143 E Nov. 2, 2018, 12:23 p.m. OK GNU C++17 TESTS 70 109 3993600 2400
49945231 vjudge5 E Feb. 15, 2019, 11:43 a.m. OK GNU C++17 TESTS 70 109 3993600 2400
50653315 ArshiaDadras E March 1, 2019, 6:30 p.m. OK GNU C++17 TESTS 70 109 4812800 2400
58419318 vjudge1 E Aug. 7, 2019, 6:59 a.m. OK GNU C++17 TESTS 70 109 5632000 2400
51471782 vjudge1 E March 19, 2019, 6:58 a.m. OK GNU C++17 TESTS 70 109 7168000 2400
11540479 Yury_Bandarchuk E June 12, 2015, 6:49 a.m. OK Java 8 TESTS 70 234 0 2400
68104265 saurabhs1206 E Jan. 3, 2020, 6:03 a.m. OK Java 8 TESTS 70 467 17305600 2400
61238473 Dukkha E Sept. 24, 2019, 6:58 p.m. OK Java 8 TESTS 70 514 4096000 2400
27330316 RP_9 E May 25, 2017, 6:14 a.m. OK Java 8 TESTS 70 514 16076800 2400
62443232 Vishal_dhanani E Oct. 12, 2019, 8:40 p.m. OK Java 8 TESTS 70 560 16384000 2400
12535249 marcose18 E Aug. 14, 2015, 7 p.m. OK Java 8 TESTS 70 623 44339200 2400
12535295 marcose18 E Aug. 14, 2015, 7:06 p.m. OK Java 8 TESTS 70 639 44339200 2400
29158068 Omar_Morsi E Aug. 3, 2017, 2:42 p.m. OK Java 8 TESTS 70 748 75264000 2400
59964677 satya26 E Sept. 3, 2019, 7:45 p.m. OK Java 8 TESTS 70 780 66764800 2400
47721459 vjvjain0 E Dec. 30, 2018, 11:32 a.m. OK Java 8 TESTS 70 795 38604800 2400
28721867 ShowStopper728 E July 20, 2017, 10:39 a.m. OK MS C# TESTS 70 420 61235200 2400
52556729 vjudge1 E April 10, 2019, 8:10 a.m. OK MS C++ TESTS 70 78 14028800 2400
50820751 vjudge1 E March 5, 2019, 1:26 p.m. OK MS C++ TESTS 70 93 5632000 2400
50822167 vjudge2 E March 5, 2019, 1:59 p.m. OK MS C++ TESTS 70 93 12800000 2400
58936260 vjudge5 E Aug. 17, 2019, 4:25 a.m. OK MS C++ TESTS 70 93 15257600 2400
61360108 vjudge1 E Sept. 27, 2019, 11:52 a.m. OK MS C++ TESTS 70 93 16793600 2400
61361368 vjudge1 E Sept. 27, 2019, 12:16 p.m. OK MS C++ TESTS 70 93 16896000 2400
58410792 vjudge5 E Aug. 7, 2019, 1:31 a.m. OK MS C++ TESTS 70 93 18022400 2400
61348873 vjudge2 E Sept. 27, 2019, 6:54 a.m. OK MS C++ TESTS 70 93 28876800 2400
58473817 vjudge4 E Aug. 9, 2019, 2:04 a.m. OK MS C++ TESTS 70 108 7270400 2400
50882987 vjudge4 E March 6, 2019, 9:47 a.m. OK MS C++ TESTS 70 109 4812800 2400
58413466 vjudge4 E Aug. 7, 2019, 3:08 a.m. OK MS C++ 2017 TESTS 70 436 36044800 2400
68467937 mitribunskiy E Jan. 9, 2020, 10 p.m. OK PyPy 3 TESTS 70 686 37888000 2400

remove filters

Back to search problems