Codeforces Round 786 (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
1674 Codeforces Round 786 (Div. 3) FINISHED False 7200 85677863 May 2, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5163 ) F Desktop Rearrangement PROGRAMMING data structures greedy implementation

B"Your friend Ivan asked you to help him rearrange his desktop. The desktop can be represented as a rectangle matrix of size n x m consisting of characters '.' (empty cell of the desktop) and '*' (an icon). The desktop is called good if all its icons are occupying some prefix of full columns and, possibly, the prefix of the next column (and there are no icons outside this figure). In other words, some amount of first columns will be filled with icons and, possibly, some amount of first cells of the next (after the last full column) column will be also filled with icons (and all the icons on the desktop belong to this figure). This is pretty much the same as the real life icons arrangement. In one move, you can take one icon and move it to any empty cell in the desktop. Ivan loves to add some icons to his desktop and remove them from it, so he is asking you to answer q queries: what is the minimum number of moves required to make the desktop good after adding/removing one icon? Note that queries are permanent and change the state of the desktop. The first line of the input contains three integers n , m and q ( 1 <= n, m <= 1000; 1 <= q <= 2 cdot 10^5 ) -- the number of rows in the desktop, the number of columns in the desktop and the number of queries, respectively. The next n lines contain the description of the desktop. The i -th of them contains m characters '.' and '*' -- the description of the i -th row of the desktop. The next q lines describe queries. The i -th of them contains two integers x_i and y_i ( 1 <= x_i <= n; 1 <= y_i <= m ) -- the position of the cell which changes its state (if this cell contained the icon before, then this icon is removed, otherwise an icon appears in this cell). Print q integers. The i -th of them should be the minimum number of moves required to make the desktop good after applying the first i queries. "...

Tutorials

102482

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
155765291 Sempr F May 3, 2022, 1:17 p.m. OK GNU C11 TESTS 45 873 1024000
155765705 Sempr F May 3, 2022, 1:22 p.m. OK GNU C11 TESTS 45 904 1024000
155761619 Sempr F May 3, 2022, 12:37 p.m. OK GNU C11 TESTS 45 904 5120000
155769488 Sempr F May 3, 2022, 1:30 p.m. OK GNU C11 TESTS 45 919 1024000
155772762 fatherof0416 F May 3, 2022, 2:10 p.m. OK GNU C11 TESTS 45 1045 1024000
155803141 lixp F May 4, 2022, 12:46 a.m. OK GNU C++14 TESTS 45 124 1024000
155763043 acwing_zyy F May 3, 2022, 12:53 p.m. OK GNU C++14 TESTS 45 124 1024000
155795138 liympanda F May 3, 2022, 8:08 p.m. OK GNU C++14 TESTS 45 124 1228800
155764811 kalavalarevanth F May 3, 2022, 1:12 p.m. OK GNU C++14 TESTS 45 124 1433600
155784107 empaktus F May 3, 2022, 4:42 p.m. OK GNU C++14 TESTS 45 124 1740800
155812967 Mohammad.Nour F May 4, 2022, 5:11 a.m. OK GNU C++14 TESTS 45 124 2048000
155780170 artifexbm F May 3, 2022, 3:48 p.m. OK GNU C++14 TESTS 45 124 2048000
155769881 Max_s_xaM F May 3, 2022, 1:35 p.m. OK GNU C++14 TESTS 45 124 2048000
155788446 Akash268 F May 3, 2022, 5:53 p.m. OK GNU C++14 TESTS 45 124 2969600
155733306 Lcyanstars F May 3, 2022, 7:22 a.m. OK GNU C++14 TESTS 45 139 1126400
155769928 Sempr F May 3, 2022, 1:35 p.m. OK GNU C++17 TESTS 45 109 1024000
155756998 niqiqi F May 3, 2022, 11:47 a.m. OK GNU C++17 TESTS 45 124 1024000
155783008 PineapplesOnPizza F May 3, 2022, 4:27 p.m. OK GNU C++17 TESTS 45 124 1024000
155757079 varshiniaadi F May 3, 2022, 11:47 a.m. OK GNU C++17 TESTS 45 124 1024000
155806008 HeeJaYaa F May 4, 2022, 2:19 a.m. OK GNU C++17 TESTS 45 124 1228800
155782255 Ebiswas7516 F May 3, 2022, 4:16 p.m. OK GNU C++17 TESTS 45 124 1331200
155776160 inferno_7 F May 3, 2022, 2:54 p.m. OK GNU C++17 TESTS 45 124 1433600
155776570 Karliver F May 3, 2022, 2:59 p.m. OK GNU C++17 TESTS 45 124 1433600
155785000 F__ F May 3, 2022, 4:56 p.m. OK GNU C++17 TESTS 45 124 1945600
155806589 avwl017 F May 4, 2022, 2:34 a.m. OK GNU C++17 TESTS 45 124 2048000
155775124 gqf123 F May 3, 2022, 2:40 p.m. OK GNU C++17 (64) TESTS 45 108 1024000
155739338 Wang_Yuan F May 3, 2022, 8:37 a.m. OK GNU C++17 (64) TESTS 45 108 4096000
155760968 tacoslav F May 3, 2022, 12:29 p.m. OK GNU C++17 (64) TESTS 45 108 5017600
155740952 llc5pg F May 3, 2022, 8:54 a.m. OK GNU C++17 (64) TESTS 45 109 1126400
155793315 pd_codes F May 3, 2022, 7:22 p.m. OK GNU C++17 (64) TESTS 45 109 1126400
155799588 Muhammed_Ahmed F May 3, 2022, 10:19 p.m. OK GNU C++17 (64) TESTS 45 109 1126400
155740559 Dijkstra_attack F May 3, 2022, 8:50 a.m. OK GNU C++17 (64) TESTS 45 109 1945600
155729352 mikko_mikust F May 3, 2022, 6:33 a.m. OK GNU C++17 (64) TESTS 45 109 3072000
155787282 mbdbr F May 3, 2022, 5:34 p.m. OK GNU C++17 (64) TESTS 45 109 4096000
155744153 _Pioneer F May 3, 2022, 9:27 a.m. OK GNU C++17 (64) TESTS 45 109 4505600
155733637 nor F May 3, 2022, 7:26 a.m. OK GNU C++20 (64) TESTS 45 46 8294400
155733915 nor F May 3, 2022, 7:29 a.m. OK GNU C++20 (64) TESTS 45 62 8294400
155726170 Patricky F May 3, 2022, 5:41 a.m. OK GNU C++20 (64) TESTS 45 77 102400
155748927 Tawes F May 3, 2022, 10:21 a.m. OK GNU C++20 (64) TESTS 45 77 1331200
155787326 Masum_Billa_19 F May 3, 2022, 5:35 p.m. OK GNU C++20 (64) TESTS 45 78 1126400
155724700 Swirl F May 3, 2022, 5:20 a.m. OK GNU C++20 (64) TESTS 45 78 1126400
155787284 miguel-merheb F May 3, 2022, 5:34 p.m. OK GNU C++20 (64) TESTS 45 78 1331200
155803709 wink. F May 4, 2022, 1:07 a.m. OK GNU C++20 (64) TESTS 45 78 2355200
155732694 nor F May 3, 2022, 7:14 a.m. OK GNU C++20 (64) TESTS 45 78 6451200
155807099 sgly33 F May 4, 2022, 2:47 a.m. OK GNU C++20 (64) TESTS 45 92 5222400
155772292 koqo F May 3, 2022, 2:04 p.m. OK Go TESTS 45 265 5324800
155778957 Sempr F May 3, 2022, 3:31 p.m. OK Go TESTS 45 670 1945600
155778725 Sempr F May 3, 2022, 3:29 p.m. OK Go TESTS 45 686 4403200
155779067 Sempr F May 3, 2022, 3:33 p.m. OK Go TESTS 45 716 1945600
155791908 gaju321 F May 3, 2022, 6:53 p.m. OK Java 11 TESTS 45 405 5017600
155776547 sf14t F May 3, 2022, 2:59 p.m. OK Java 11 TESTS 45 467 27545600
155755679 yunfeng F May 3, 2022, 11:33 a.m. OK Java 11 TESTS 45 1403 0
155731972 MatthewRaker F May 3, 2022, 7:05 a.m. OK Java 11 TESTS 45 1591 87961600
155765547 govindrajput F May 3, 2022, 1:20 p.m. OK Java 8 TESTS 45 935 3993600
155788204 bennasser F May 3, 2022, 5:50 p.m. OK Java 8 TESTS 45 1840 0
155740382 CrashMaster F May 3, 2022, 8:48 a.m. OK MS C++ 2017 TESTS 45 499 1331200
155737066 chrisfcoder F May 3, 2022, 8:10 a.m. OK .NET Core C# TESTS 45 1340 21094400
155772139 lemiao12 F May 3, 2022, 2:02 p.m. OK PyPy 3 TESTS 45 467 26316800
155734107 random__person F May 3, 2022, 7:32 a.m. OK PyPy 3 TESTS 45 561 31948800
155728249 ambs_ F May 3, 2022, 6:19 a.m. OK PyPy 3 TESTS 45 1263 41062400
155789511 shehebe F May 3, 2022, 6:10 p.m. OK PyPy 3 TESTS 45 1886 31129600
155788953 shehebe F May 3, 2022, 6:01 p.m. OK PyPy 3 TESTS 45 1981 35532800
155745195 carpenter_bee F May 3, 2022, 9:38 a.m. OK PyPy 3 TESTS 45 2526 53145600
155740373 zzczzc004 F May 3, 2022, 8:48 a.m. OK PyPy 3-64 TESTS 45 498 32153600
155781987 dcclyde F May 3, 2022, 4:12 p.m. OK PyPy 3-64 TESTS 45 560 56627200
155738441 zzczzc004 F May 3, 2022, 8:26 a.m. OK PyPy 3-64 TESTS 45 577 33894400
155796574 dcclyde F May 3, 2022, 8:46 p.m. OK PyPy 3-64 TESTS 45 592 56627200
155734515 Aksnov F May 3, 2022, 7:38 a.m. OK PyPy 3-64 TESTS 45 608 88985600
155728192 wolfram_ F May 3, 2022, 6:18 a.m. OK PyPy 3-64 TESTS 45 639 27545600
155738129 zzczzc004 F May 3, 2022, 8:23 a.m. OK PyPy 3-64 TESTS 45 951 29081600
155792211 skp_r F May 3, 2022, 6:58 p.m. OK PyPy 3-64 TESTS 45 1029 114995200
155744974 _Frust F May 3, 2022, 9:36 a.m. OK PyPy 3-64 TESTS 45 1263 161177600
155744723 _Frust F May 3, 2022, 9:33 a.m. OK PyPy 3-64 TESTS 45 1294 161177600
155789492 shehebe F May 3, 2022, 6:09 p.m. OK Python 3 TESTS 45 904 18841600
155737924 zzczzc004 F May 3, 2022, 8:20 a.m. OK Python 3 TESTS 45 1591 6041600
155745360 carpenter_bee F May 3, 2022, 9:40 a.m. OK Python 3 TESTS 45 2339 5836800
155784112 crazyboyani9117 F May 3, 2022, 4:42 p.m. OK Python 3 TESTS 45 2604 10444800
155736864 zzczzc004 F May 3, 2022, 8:08 a.m. OK Python 3 TESTS 45 2776 5734400

remove filters

Back to search problems