Codeforces Round 783 (Div. 1)

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
1667 Codeforces Round 783 (Div. 1) FINISHED False 7200 81444299 April 19, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1669 ) C Half Queen Cover PROGRAMMING constructive algorithms math 2400

B'You are given a board with n rows and n columns, numbered from 1 to n . The intersection of the a -th row and b -th column is denoted by (a, b) . A half-queen attacks cells in the same row, same column, and on one diagonal. More formally, a half-queen on (a, b) attacks the cell (c, d) if a=c or b=d or a-b=c-d . Construct an optimal solution. The first line contains a single integer n ( 1 <= n <= 10^5 ) -- the size of the board. In the first line print a single integer k -- the minimum number of half-queens. In each of the next k lines print two integers a_i , b_i ( 1 <= a_i, b_i <= n ) -- the position of the i -th half-queen. If there are multiple solutions, print any. Example 1 : one half-queen is enough. Note: a half-queen on (1, 1) attacks (1, 1) . Example 2 : one half-queen is enough too. (1, 2) or (2, 1) would be wrong solutions, because a half-queen on (1, 2) does not attack the cell (2, 1) and vice versa. (2, 2) is also a valid solution. Example 3 : it is impossible to cover the board with one half queen. There are multiple solutions for 2 half-queens; you can print any of them. '...

Tutorials

Codeforces Round #783 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
154112605 hos.lyric C April 19, 2022, 3:46 p.m. OK D TESTS 26 46 4198400 2400
154125206 Gassa C April 19, 2022, 4:23 p.m. OK D TESTS 26 46 4198400 2400
154135132 Gassa C April 19, 2022, 6:10 p.m. OK D TESTS 26 46 13926400 2400
154216164 dean.menezes C April 20, 2022, 4:42 p.m. OK GNU C11 TESTS 26 31 0 2400
154383622 rainboy C April 21, 2022, 3:45 p.m. OK GNU C11 TESTS 26 296 0 2400
154127065 chro4896 C April 19, 2022, 4:28 p.m. OK GNU C11 TESTS 26 312 0 2400
154489201 cicuvc C April 22, 2022, 11:12 a.m. OK GNU C11 TESTS 26 312 1740800 2400
154167895 realFZzzz C April 20, 2022, 5:37 a.m. OK GNU C++14 TESTS 26 15 0 2400
154161067 HpSuda C April 20, 2022, 3:34 a.m. OK GNU C++14 TESTS 26 15 0 2400
154157116 Celtic C April 20, 2022, 2:10 a.m. OK GNU C++14 TESTS 26 15 0 2400
154795814 bkifhr6 C April 23, 2022, 11:28 p.m. OK GNU C++14 TESTS 26 15 0 2400
154648879 displace C April 23, 2022, 11:09 a.m. OK GNU C++14 TESTS 26 15 0 2400
154284515 xuanxuan001 C April 21, 2022, 2:06 p.m. OK GNU C++14 TESTS 26 15 0 2400
154283978 psc233 C April 21, 2022, 1:59 p.m. OK GNU C++14 TESTS 26 15 0 2400
154274623 Hanriver C April 21, 2022, 12:23 p.m. OK GNU C++14 TESTS 26 15 0 2400
154250850 applese C April 21, 2022, 6:16 a.m. OK GNU C++14 TESTS 26 15 0 2400
154210491 i209M C April 20, 2022, 3:20 p.m. OK GNU C++14 TESTS 26 15 0 2400
154128128 NRolly C April 19, 2022, 4:31 p.m. OK GNU C++17 TESTS 26 15 0 2400
154126529 hxz12345 C April 19, 2022, 4:27 p.m. OK GNU C++17 TESTS 26 15 0 2400
154119677 _LeMur_ C April 19, 2022, 4:06 p.m. OK GNU C++17 TESTS 26 15 0 2400
154114582 jamessngg C April 19, 2022, 3:51 p.m. OK GNU C++17 TESTS 26 15 0 2400
154109152 Kongweijia C April 19, 2022, 3:38 p.m. OK GNU C++17 TESTS 26 15 0 2400
154128615 Naseem17 C April 19, 2022, 4:33 p.m. OK GNU C++17 TESTS 26 15 0 2400
154153730 google_it_2 C April 20, 2022, 12:36 a.m. OK GNU C++17 TESTS 26 15 0 2400
154167114 WinterLove C April 20, 2022, 5:23 a.m. OK GNU C++17 TESTS 26 15 0 2400
154195232 hoii C April 20, 2022, 12:14 p.m. OK GNU C++17 TESTS 26 15 1638400 2400
154223398 vkgainz C April 20, 2022, 6:37 p.m. OK GNU C++17 TESTS 26 15 1638400 2400
154278474 mattagar6 C April 21, 2022, 1:10 p.m. OK GNU C++17 (64) TESTS 26 15 0 2400
154243618 Knowledge_Pig C April 21, 2022, 3:25 a.m. OK GNU C++17 (64) TESTS 26 15 0 2400
154224797 EntitledMonkey C April 20, 2022, 7:04 p.m. OK GNU C++17 (64) TESTS 26 15 0 2400
154210331 user202729_ C April 20, 2022, 3:18 p.m. OK GNU C++17 (64) TESTS 26 15 0 2400
154194671 shinigami11 C April 20, 2022, 12:06 p.m. OK GNU C++17 (64) TESTS 26 15 0 2400
154190495 1127193030 C April 20, 2022, 11:15 a.m. OK GNU C++17 (64) TESTS 26 15 0 2400
154172433 tyin C April 20, 2022, 6:47 a.m. OK GNU C++17 (64) TESTS 26 15 0 2400
154499315 Richelieu C April 22, 2022, 12:56 p.m. OK GNU C++17 (64) TESTS 26 15 0 2400
154896969 mrsrz C April 25, 2022, 2 a.m. OK GNU C++17 (64) TESTS 26 15 0 2400
154480903 hankeke C April 22, 2022, 9:19 a.m. OK GNU C++17 (64) TESTS 26 15 0 2400
154179093 zimujun C April 20, 2022, 8:28 a.m. OK GNU C++20 (64) TESTS 26 15 0 2400
154654180 16204 C April 23, 2022, 12:09 p.m. OK GNU C++20 (64) TESTS 26 15 0 2400
154474796 bachbeo2007 C April 22, 2022, 7:58 a.m. OK GNU C++20 (64) TESTS 26 15 0 2400
154457188 hoke_t C April 22, 2022, 3:30 a.m. OK GNU C++20 (64) TESTS 26 15 0 2400
154281327 Solashiro C April 21, 2022, 1:42 p.m. OK GNU C++20 (64) TESTS 26 15 0 2400
154268149 socpite C April 21, 2022, 10:49 a.m. OK GNU C++20 (64) TESTS 26 15 0 2400
154248022 harsh__h C April 21, 2022, 5:13 a.m. OK GNU C++20 (64) TESTS 26 15 0 2400
154238374 xdO_o C April 21, 2022, 1:42 a.m. OK GNU C++20 (64) TESTS 26 15 0 2400
154210251 Ber C April 20, 2022, 3:17 p.m. OK GNU C++20 (64) TESTS 26 15 0 2400
154209052 HollwoQ_Pelw C April 20, 2022, 3:01 p.m. OK GNU C++20 (64) TESTS 26 15 0 2400
154187553 ben.solo C April 20, 2022, 10:34 a.m. OK Java 11 TESTS 26 639 0 2400
154111762 ika C April 19, 2022, 3:44 p.m. OK Java 8 TESTS 26 109 0 2400
154109131 SecondThread C April 19, 2022, 3:38 p.m. OK Java 8 TESTS 26 140 38400000 2400
154149503 Hakiobo C April 19, 2022, 10:19 p.m. OK Kotlin 1.4 TESTS 26 109 0 2400
154139648 Tlatoani C April 19, 2022, 7:04 p.m. OK Kotlin 1.4 TESTS 26 124 0 2400
154101541 Sparky_Master_WCH1226 C April 19, 2022, 3:21 p.m. OK Kotlin 1.4 TESTS 26 124 0 2400
154085272 darnley C April 19, 2022, 2:53 p.m. OK Kotlin 1.5 TESTS 26 218 0 2400
154649445 liJD C April 23, 2022, 11:15 a.m. OK MS C++ 2017 TESTS 26 77 0 2400
154754039 proVIDec C April 23, 2022, 4 p.m. OK MS C++ 2017 TESTS 26 78 0 2400
154164271 mban259 C April 20, 2022, 4:33 a.m. OK .NET Core C# TESTS 26 249 3379200 2400
154179156 ruimina C April 20, 2022, 8:29 a.m. OK PyPy 3 TESTS 26 124 8908800 2400
154116730 misorin C April 19, 2022, 3:57 p.m. OK PyPy 3 TESTS 26 170 10649600 2400
154849505 deca_gon C April 24, 2022, 12:22 p.m. OK PyPy 3 TESTS 26 187 9420800 2400
154256173 Meredov C April 21, 2022, 7:54 a.m. OK PyPy 3 TESTS 26 202 9420800 2400
154109934 whatshisbucket C April 19, 2022, 3:40 p.m. OK PyPy 3 TESTS 26 217 9318400 2400
154124785 taiga0629 C April 19, 2022, 4:21 p.m. OK PyPy 3 TESTS 26 296 11264000 2400
154165502 Teko7a C April 20, 2022, 4:55 a.m. OK PyPy 3-64 TESTS 26 171 11264000 2400
154139076 asdsasd C April 19, 2022, 6:57 p.m. OK PyPy 3-64 TESTS 26 202 13619200 2400
154170729 nicku123 C April 20, 2022, 6:21 a.m. OK PyPy 3-64 TESTS 26 218 11980800 2400
154120930 chinerist C April 19, 2022, 4:09 p.m. OK PyPy 3-64 TESTS 26 311 17510400 2400
154106160 sansen C April 19, 2022, 3:31 p.m. OK Rust 2021 TESTS 26 15 2150400 2400
154134734 qwerty787788 C April 19, 2022, 6:07 p.m. OK Rust 2021 TESTS 26 15 4198400 2400
154099219 Egor C April 19, 2022, 3:16 p.m. OK Rust 2021 TESTS 26 31 4198400 2400

remove filters

Back to search problems