Codeforces Round 831 (Div. 1 + 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
1740 Codeforces Round 831 (Div. 1 + Div. 2) FINISHED False 9900 70231762 Oct. 29, 2022, 9:10 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 8301 ) D Knowledge Cards PROGRAMMING constructive algorithms data structures greedy math 1500

B'Pak Chanek, a renowned scholar, invented a card puzzle using his knowledge. In the puzzle, you are given a board with n rows and m columns. Let (r, c) represent the cell in the r -th row and the c -th column. Initially, there are k cards stacked in cell (1, 1) . Each card has an integer from 1 to k written on it. More specifically, the i -th card from the top of the stack in cell (1, 1) has the number a_i written on it. It is known that no two cards have the same number written on them. In other words, the numbers written on the cards are a permutation of integers from 1 to k . All other cells are empty. You need to move the k cards to cell (n, m) to create another stack of cards. Let b_i be the number written on the i -th card from the top of the stack in cell (n, m) . You should create the stack in cell (n, m) in such a way so that b_i = i for all 1 <= q i <= q k . In one move, you can remove the top card from a cell and place it onto an adjacent cell (a cell that shares a common side). If the target cell already contains one or more cards, you place your card on the top of the stack. You must do each operation while satisfying the following restrictions: Given the values of n , m , k and the array a , determine if the puzzle is solvable. Each test contains multiple test cases. The first line contains an integer t ( 1 <= q t <= q 2 cdot 10^4 ) -- the number of test cases. The following lines contain the description of each test case. The first line of each test case contains three integers n , m , and k ( 3 <= q n, m <= q 10^6 , nm <= q 10^6 , 1 <= q k <= q 10^5 ) -- the size of the board and the number of cards. The second line of the test case contains k integers a_1, a_2, ldots, a_k -- the array a , representing the numbers written on the cards. T'...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
178389791 FatalityNT D Oct. 29, 2022, 11:38 a.m. OK C# 8 TESTS 32 373 15974400 1500
178418074 cyrus_msk D Oct. 29, 2022, 2:53 p.m. OK D TESTS 32 61 13721600 1500
178407248 Uanu D Oct. 29, 2022, 1:29 p.m. OK GNU C11 TESTS 32 31 1228800 1500
178466661 Tom66 D Oct. 30, 2022, 3:30 a.m. OK GNU C++14 TESTS 32 30 2048000 1500
178457302 TheRoot D Oct. 29, 2022, 10:01 p.m. OK GNU C++14 TESTS 32 46 102400 1500
178443033 SuperJ6 D Oct. 29, 2022, 6:37 p.m. OK GNU C++14 TESTS 32 46 409600 1500
178456322 vyshnavchayi D Oct. 29, 2022, 9:39 p.m. OK GNU C++14 TESTS 32 46 409600 1500
178390687 harinboy D Oct. 29, 2022, 11:41 a.m. OK GNU C++14 TESTS 32 46 512000 1500
178473954 AkaiLemon D Oct. 30, 2022, 5:52 a.m. OK GNU C++14 TESTS 32 46 512000 1500
178444532 kalavalarevanth D Oct. 29, 2022, 6:54 p.m. OK GNU C++14 TESTS 32 46 716800 1500
178444712 kalavalarevanth D Oct. 29, 2022, 6:57 p.m. OK GNU C++14 TESTS 32 46 716800 1500
178471678 drunkhigh D Oct. 30, 2022, 5:19 a.m. OK GNU C++14 TESTS 32 46 819200 1500
178471940 drunkhigh D Oct. 30, 2022, 5:23 a.m. OK GNU C++14 TESTS 32 46 819200 1500
178408093 _priyanshu_ D Oct. 29, 2022, 1:35 p.m. OK GNU C++17 TESTS 32 31 819200 1500
178398419 DeEbOo_HB D Oct. 29, 2022, 12:35 p.m. OK GNU C++17 TESTS 32 31 1228800 1500
178464993 acwing_meow D Oct. 30, 2022, 2:41 a.m. OK GNU C++17 TESTS 32 31 1536000 1500
178461483 epsilon_573 D Oct. 30, 2022, 12:32 a.m. OK GNU C++17 TESTS 32 31 1638400 1500
178406656 Baaaraa D Oct. 29, 2022, 1:24 p.m. OK GNU C++17 TESTS 32 31 1945600 1500
178421349 SajibKC_19 D Oct. 29, 2022, 3:23 p.m. OK GNU C++17 TESTS 32 31 3174400 1500
178461542 ArthurCJF D Oct. 30, 2022, 12:34 a.m. OK GNU C++17 TESTS 32 31 4198400 1500
178438690 anamikaaca0306 D Oct. 29, 2022, 5:53 p.m. OK GNU C++17 TESTS 32 31 11264000 1500
178388870 CodePhantom D Oct. 29, 2022, 11:35 a.m. OK GNU C++17 TESTS 32 46 102400 1500
178400398 acfmidinsw D Oct. 29, 2022, 12:41 p.m. OK GNU C++17 TESTS 32 46 102400 1500
178446629 Maheen654 D Oct. 29, 2022, 7:21 p.m. OK GNU C++17 (64) TESTS 32 31 409600 1500
178406009 QwQ_zlw D Oct. 29, 2022, 1:19 p.m. OK GNU C++17 (64) TESTS 32 31 409600 1500
178400639 ThiagoMM D Oct. 29, 2022, 12:42 p.m. OK GNU C++17 (64) TESTS 32 31 409600 1500
178392094 sg60 D Oct. 29, 2022, 11:46 a.m. OK GNU C++17 (64) TESTS 32 31 409600 1500
178455338 Awesome3.14 D Oct. 29, 2022, 9:17 p.m. OK GNU C++17 (64) TESTS 32 31 409600 1500
178411394 ddtd D Oct. 29, 2022, 1:59 p.m. OK GNU C++17 (64) TESTS 32 31 512000 1500
178416209 Hikari_wa_yutakadesu D Oct. 29, 2022, 2:37 p.m. OK GNU C++17 (64) TESTS 32 31 819200 1500
178391958 Mac.Rose D Oct. 29, 2022, 11:46 a.m. OK GNU C++17 (64) TESTS 32 31 819200 1500
178432514 strange14 D Oct. 29, 2022, 4:55 p.m. OK GNU C++17 (64) TESTS 32 31 819200 1500
178460727 enslaved D Oct. 29, 2022, 11:59 p.m. OK GNU C++17 (64) TESTS 32 31 1228800 1500
178444122 Dhruv_Singh_Negi D Oct. 29, 2022, 6:49 p.m. OK GNU C++20 (64) TESTS 32 31 409600 1500
178443993 Dhruv_Singh_Negi D Oct. 29, 2022, 6:48 p.m. OK GNU C++20 (64) TESTS 32 31 409600 1500
178442159 Basilhijaz D Oct. 29, 2022, 6:27 p.m. OK GNU C++20 (64) TESTS 32 31 409600 1500
178436757 A_G D Oct. 29, 2022, 5:35 p.m. OK GNU C++20 (64) TESTS 32 31 409600 1500
178446048 fishcathu. D Oct. 29, 2022, 7:14 p.m. OK GNU C++20 (64) TESTS 32 31 409600 1500
178424101 rutvik_1234 D Oct. 29, 2022, 3:47 p.m. OK GNU C++20 (64) TESTS 32 31 409600 1500
178412025 freakin23 D Oct. 29, 2022, 2:03 p.m. OK GNU C++20 (64) TESTS 32 31 409600 1500
178406548 Summer_Water D Oct. 29, 2022, 1:23 p.m. OK GNU C++20 (64) TESTS 32 31 409600 1500
178404488 17393068418 D Oct. 29, 2022, 1:07 p.m. OK GNU C++20 (64) TESTS 32 31 409600 1500
178425801 flying_doraemon D Oct. 29, 2022, 4:03 p.m. OK GNU C++20 (64) TESTS 32 31 409600 1500
178391832 arun07 D Oct. 29, 2022, 11:45 a.m. OK Go TESTS 32 77 1843200 1500
178441571 veerabhadra D Oct. 29, 2022, 6:21 p.m. OK Java 11 TESTS 32 187 0 1500
178434665 _mza D Oct. 29, 2022, 5:15 p.m. OK Java 11 TESTS 32 202 4096000 1500
178442873 sunaj D Oct. 29, 2022, 6:35 p.m. OK Java 11 TESTS 32 233 1331200 1500
178407584 kasiru_69 D Oct. 29, 2022, 1:31 p.m. OK Java 11 TESTS 32 280 1638400 1500
178398717 Vegeks D Oct. 29, 2022, 12:36 p.m. OK Java 11 TESTS 32 295 1945600 1500
178398354 kasiru_69 D Oct. 29, 2022, 12:34 p.m. OK Java 11 TESTS 32 327 1638400 1500
178390141 N_LogN D Oct. 29, 2022, 11:39 a.m. OK Java 11 TESTS 32 327 15052800 1500
178403304 serndipty_ D Oct. 29, 2022, 12:58 p.m. OK Java 17 TESTS 32 264 614400 1500
178471324 warks D Oct. 30, 2022, 5:14 a.m. OK Java 17 TESTS 32 264 1228800 1500
178441915 merlin_ D Oct. 29, 2022, 6:25 p.m. OK Java 17 TESTS 32 265 2252800 1500
178401790 ikillmyself D Oct. 29, 2022, 12:49 p.m. OK Java 8 TESTS 32 124 0 1500
178412400 Aabhas99 D Oct. 29, 2022, 2:06 p.m. OK Java 8 TESTS 32 139 1126400 1500
178425438 vaibhav_1710 D Oct. 29, 2022, 4 p.m. OK Java 8 TESTS 32 140 0 1500
178467451 youtsuha D Oct. 30, 2022, 3:50 a.m. OK Java 8 TESTS 32 155 0 1500
178408546 Virendra115 D Oct. 29, 2022, 1:38 p.m. OK Java 8 TESTS 32 171 0 1500
178402021 anshulchou_123 D Oct. 29, 2022, 12:50 p.m. OK Java 8 TESTS 32 171 0 1500
178394453 Yousef_Badr D Oct. 29, 2022, 11:53 a.m. OK Java 8 TESTS 32 233 0 1500
178427522 Ibrahimovic_The_Lion D Oct. 29, 2022, 4:18 p.m. OK Java 8 TESTS 32 248 0 1500
178427948 Terminators D Oct. 29, 2022, 4:22 p.m. OK Java 8 TESTS 32 374 0 1500
178398813 abhishek_pri D Oct. 29, 2022, 12:36 p.m. OK MS C++ 2017 TESTS 32 170 1843200 1500
178403977 Halcyflict D Oct. 29, 2022, 1:03 p.m. OK MS C++ 2017 TESTS 32 717 3174400 1500
178401884 TmleynCodes03 D Oct. 29, 2022, 12:49 p.m. OK PyPy 3 TESTS 32 577 11673600 1500
178415273 biglunchdude D Oct. 29, 2022, 2:29 p.m. OK PyPy 3-64 TESTS 32 139 15052800 1500
178393467 Venia D Oct. 29, 2022, 11:50 a.m. OK PyPy 3-64 TESTS 32 140 10444800 1500
178404251 D.V.Aravind D Oct. 29, 2022, 1:05 p.m. OK PyPy 3-64 TESTS 32 140 12083200 1500
178404526 raushnn D Oct. 29, 2022, 1:07 p.m. OK PyPy 3-64 TESTS 32 140 17715200 1500
178400560 redheadphone D Oct. 29, 2022, 12:41 p.m. OK PyPy 3-64 TESTS 32 140 21094400 1500
178437809 omar.gawdat D Oct. 29, 2022, 5:45 p.m. OK PyPy 3-64 TESTS 32 155 17920000 1500
178437591 omar.gawdat D Oct. 29, 2022, 5:43 p.m. OK PyPy 3-64 TESTS 32 155 18022400 1500
178389497 Aphrodite_wanna D Oct. 29, 2022, 11:37 a.m. OK PyPy 3-64 TESTS 32 155 19353600 1500
178400454 redheadphone D Oct. 29, 2022, 12:41 p.m. OK PyPy 3-64 TESTS 32 155 19763200 1500
178401988 DrMrogon D Oct. 29, 2022, 12:50 p.m. OK PyPy 3-64 TESTS 32 170 20275200 1500
178412904 abcsumit D Oct. 29, 2022, 2:10 p.m. OK Python 3 TESTS 32 155 8908800 1500
178409400 siddharthraj D Oct. 29, 2022, 1:44 p.m. OK Python 3 TESTS 32 156 7372800 1500
178451425 MohamedHamed123 D Oct. 29, 2022, 8:10 p.m. OK Python 3 TESTS 32 171 7680000 1500
178415788 meetsingh0202 D Oct. 29, 2022, 2:33 p.m. OK Python 3 TESTS 32 171 7782400 1500
178394020 sixthcore D Oct. 29, 2022, 11:51 a.m. OK Python 3 TESTS 32 202 7680000 1500
178400815 34z12000 D Oct. 29, 2022, 12:43 p.m. OK Python 3 TESTS 32 233 7270400 1500
178429328 Savelij D Oct. 29, 2022, 4:35 p.m. OK Python 3 TESTS 32 280 7270400 1500
178399078 meohenbk D Oct. 29, 2022, 12:37 p.m. OK Python 3 TESTS 32 295 7475200 1500
178398478 meohenbk D Oct. 29, 2022, 12:35 p.m. OK Python 3 TESTS 32 295 7577600 1500
178389381 dee2018 D Oct. 29, 2022, 11:36 a.m. OK Python 3 TESTS 32 296 7372800 1500
178425689 mmeluz D Oct. 29, 2022, 4:02 p.m. OK Rust 2021 TESTS 32 31 4608000 1500

remove filters

Back to search problems