Codeforces Round 762 (Div. 3)

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
1619 Codeforces Round 762 (Div. 3) FINISHED False 8100 97255463 Dec. 20, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1188 ) H Permutation and Queries PROGRAMMING brute force data structures

B'You are given a permutation p of n elements. A permutation of n elements is an array of length n containing each integer from 1 to n exactly once. For example, [1, 2, 3] and [4, 3, 5, 1, 2] are permutations, but [1, 2, 4] and [4, 3, 2, 1, 2] are not permutations. You should perform q queries. There are two types of queries: The first line contains two integers n and q ( 1 <= n, q <= 10^5 ). The second line contains n integers p_1, p_2, ... , p_n . Each of the next q lines contains three integers. The first integer is t ( 1 <= t <= 2 ) -- type of query. If t = 1 , then the next two integers are x and y ( 1 <= x, y <= n ; x ne y ) -- first-type query. If t = 2 , then the next two integers are i and k ( 1 <= i, k <= n ) -- second-type query. It is guaranteed that there is at least one second-type query. For every second-type query, print one integer in a new line -- answer to this query. In the first example p = {5, 3, 4, 2, 1 } . The first query is to print p_3 . The answer is 4 . The second query is to print p_{p_1} . The answer is 1 . The third query is to swap p_1 and p_3 . Now p = {4, 3, 5, 2, 1 } . The fourth query is to print p_{p_1} . The answer is 2 . '...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
140217495 Graliczz H Dec. 22, 2021, 3:27 a.m. OK GNU C++14 TESTS 62 685 1228800
140123454 GennadyTran H Dec. 21, 2021, 3:24 a.m. OK GNU C++14 TESTS 62 748 1228800
140135010 vccaiji H Dec. 21, 2021, 7 a.m. OK GNU C++14 TESTS 62 748 1331200
140123355 GennadyTran H Dec. 21, 2021, 3:21 a.m. OK GNU C++14 TESTS 62 779 1228800
140123433 GennadyTran H Dec. 21, 2021, 3:23 a.m. OK GNU C++14 TESTS 62 795 1228800
140123415 GennadyTran H Dec. 21, 2021, 3:22 a.m. OK GNU C++14 TESTS 62 795 1228800
140134846 vccaiji H Dec. 21, 2021, 6:58 a.m. OK GNU C++14 TESTS 62 811 1331200
140136324 WaAccept H Dec. 21, 2021, 7:17 a.m. OK GNU C++14 TESTS 62 842 12083200
140123405 GennadyTran H Dec. 21, 2021, 3:22 a.m. OK GNU C++14 TESTS 62 873 1228800
140136459 WaAccept H Dec. 21, 2021, 7:18 a.m. OK GNU C++14 TESTS 62 888 12083200
140190803 Ji_Kuai H Dec. 21, 2021, 5:13 p.m. OK GNU C++17 TESTS 62 295 2867200
140188479 Ji_Kuai H Dec. 21, 2021, 4:50 p.m. OK GNU C++17 TESTS 62 311 2867200
140190700 Ji_Kuai H Dec. 21, 2021, 5:12 p.m. OK GNU C++17 TESTS 62 312 2867200
140124999 Zayin H Dec. 21, 2021, 4:02 a.m. OK GNU C++17 TESTS 62 514 17100800
140117320 wifiiii H Dec. 20, 2021, 11:38 p.m. OK GNU C++17 TESTS 62 670 1228800
140117404 wifiiii H Dec. 20, 2021, 11:42 p.m. OK GNU C++17 TESTS 62 670 1638400
140117346 wifiiii H Dec. 20, 2021, 11:39 p.m. OK GNU C++17 TESTS 62 748 1228800
140148288 is1813r H Dec. 21, 2021, 9:33 a.m. OK GNU C++17 TESTS 62 826 1228800
140147919 Cinque H Dec. 21, 2021, 9:29 a.m. OK GNU C++17 TESTS 62 826 1228800
140117329 wifiiii H Dec. 20, 2021, 11:39 p.m. OK GNU C++17 TESTS 62 919 1228800
140123860 SevenDawns H Dec. 21, 2021, 3:34 a.m. OK GNU C++17 (64) TESTS 62 218 2764800
140212605 brunomont H Dec. 22, 2021, 12:51 a.m. OK GNU C++17 (64) TESTS 62 296 6451200
140166226 EZiganshin H Dec. 21, 2021, 1:08 p.m. OK GNU C++17 (64) TESTS 62 326 13926400
140123437 blackbird137 H Dec. 21, 2021, 3:23 a.m. OK GNU C++17 (64) TESTS 62 763 1228800
140175007 Blondie H Dec. 21, 2021, 2:36 p.m. OK GNU C++17 (64) TESTS 62 889 1228800
140200870 Blondie H Dec. 21, 2021, 7:15 p.m. OK GNU C++17 (64) TESTS 62 935 1228800
140108617 Siberian H Dec. 20, 2021, 7:42 p.m. OK GNU C++17 (64) TESTS 62 950 1331200
140108611 Siberian H Dec. 20, 2021, 7:42 p.m. OK GNU C++17 (64) TESTS 62 951 1331200
140108645 Siberian H Dec. 20, 2021, 7:42 p.m. OK GNU C++17 (64) TESTS 62 966 1331200
140205442 utkarsh05 H Dec. 21, 2021, 8:40 p.m. OK GNU C++17 (64) TESTS 62 997 1638400
140112957 .__. H Dec. 20, 2021, 9:08 p.m. OK GNU C++20 (64) TESTS 62 218 2457600
140190931 Ji_Kuai H Dec. 21, 2021, 5:14 p.m. OK GNU C++20 (64) TESTS 62 233 2867200
140190640 Ji_Kuai H Dec. 21, 2021, 5:11 p.m. OK GNU C++20 (64) TESTS 62 234 2867200
140190582 Ji_Kuai H Dec. 21, 2021, 5:11 p.m. OK GNU C++20 (64) TESTS 62 234 2867200
140124038 SevenDawns H Dec. 21, 2021, 3:40 a.m. OK GNU C++20 (64) TESTS 62 265 2764800
140150039 Bugman H Dec. 21, 2021, 9:54 a.m. OK GNU C++20 (64) TESTS 62 265 10854400
140118135 gvihvo H Dec. 21, 2021, 12:14 a.m. OK GNU C++20 (64) TESTS 62 374 4096000
140117455 atablash H Dec. 20, 2021, 11:44 p.m. OK GNU C++20 (64) TESTS 62 451 5120000
140116940 atablash H Dec. 20, 2021, 11:19 p.m. OK GNU C++20 (64) TESTS 62 467 7372800
140196207 ItayOtto H Dec. 21, 2021, 6:11 p.m. OK GNU C++20 (64) TESTS 62 624 1228800
140223389 OLOGY H Dec. 22, 2021, 5:31 a.m. OK PyPy 2 TESTS 62 1793 18636800
140150390 OLOGY H Dec. 21, 2021, 9:59 a.m. OK PyPy 2 TESTS 62 3728 43417600
140160592 OLOGY H Dec. 21, 2021, 12:02 p.m. OK PyPy 2 TESTS 62 3915 43827200
140111529 pajenegod H Dec. 20, 2021, 8:37 p.m. OK PyPy 3 TESTS 62 2371 34304000
140220812 coolstreaming H Dec. 22, 2021, 4:44 a.m. OK PyPy 3-64 TESTS 62 1747 13414400
140220363 coolstreaming H Dec. 22, 2021, 4:34 a.m. OK PyPy 3-64 TESTS 62 1747 13516800
140111509 pajenegod H Dec. 20, 2021, 8:37 p.m. OK PyPy 3-64 TESTS 62 3119 44339200
140140161 alexwice H Dec. 21, 2021, 8:02 a.m. OK PyPy 3-64 TESTS 62 3229 13926400

remove filters

Back to search problems