Educational Codeforces Round 145 (Rated for 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
1809 Educational Codeforces Round 145 (Rated for Div. 2) FINISHED False 7200 57684263 March 23, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 24220 ) A Garland PROGRAMMING implementation

B'You have a garland consisting of 4 colored light bulbs, the color of the i -th light bulb is s_i . Initially, all the light bulbs are turned off. Your task is to turn all the light bulbs on. You can perform the following operation any number of times: select a light bulb and switch its state (turn it on if it was off, and turn it off if it was on). The only restriction on the above operation is that you can apply the operation to a light bulb only if the previous operation was applied to a light bulb of a different color (the first operation can be applied to any light bulb). Calculate the minimum number of operations to turn all the light bulbs on, or report that this is impossible. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The single line of each test case contains s -- a sequence of 4 characters, where each character is a decimal digit. The i -th character denotes the color of the i -th light bulb. For each test case, print one integer -- the minimum number of operations to turn all the light bulbs on. If it is impossible to turn all the bulbs on, print -1. In the first example, all the colors are different, so you can just turn all the bulbs on in 4 operations. In the second example, it is impossible to turn all the bulbs on, because after you switch one light bulb, it is impossible to turn the others on. In the third example, you can proceed as follows: turn the first light bulb on, turn the third light bulb on, turn the fourth light bulb on, turn the third light bulb off, turn the second light bulb on, turn the third light bulb on. '...

Tutorials

114300

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
198875724 nksammirPL A March 23, 2023, 11:44 p.m. OK C# 10 TESTS 2 46 3276800
198873167 bluemegane A March 23, 2023, 10:55 p.m. OK C# 8 TESTS 2 93 512000
198871736 AkashGaneriwal A March 23, 2023, 10:32 p.m. OK Clang++20 Diagnostics TESTS 2 93 0
198842958 Akbhai77 A March 23, 2023, 5:50 p.m. OK Clang++20 Diagnostics TESTS 2 93 0
198867036 madhumaddini A March 23, 2023, 9:32 p.m. OK Clang++20 Diagnostics TESTS 2 265 3174400
198885482 y_kx_b A March 24, 2023, 3:07 a.m. OK GNU C++14 TESTS 2 0 0
198883990 Dghemy A March 24, 2023, 2:36 a.m. OK GNU C++14 TESTS 2 0 0
198879828 hmanh2007 A March 24, 2023, 1:06 a.m. OK GNU C++14 TESTS 2 0 0
198878578 xhx114514 A March 24, 2023, 12:41 a.m. OK GNU C++14 TESTS 2 0 0
198877726 Moutaz_Debbaneh A March 24, 2023, 12:24 a.m. OK GNU C++14 TESTS 2 0 0
198877139 chinvuho A March 24, 2023, 12:13 a.m. OK GNU C++14 TESTS 2 0 0
198876978 Aria_Math A March 24, 2023, 12:10 a.m. OK GNU C++14 TESTS 2 0 0
198876883 Xanadu13 A March 24, 2023, 12:08 a.m. OK GNU C++14 TESTS 2 0 0
198876773 MCCF A March 24, 2023, 12:06 a.m. OK GNU C++14 TESTS 2 0 0
198875199 SergiiGolovko A March 23, 2023, 11:35 p.m. OK GNU C++14 TESTS 2 0 0
198897137 cfbvcxzbcvb566 A March 24, 2023, 5:58 a.m. OK GNU C++17 TESTS 2 0 0
198896844 abcpony A March 24, 2023, 5:55 a.m. OK GNU C++17 TESTS 2 0 0
198896750 0x37. A March 24, 2023, 5:53 a.m. OK GNU C++17 TESTS 2 0 0
198893421 freakin23 A March 24, 2023, 5:13 a.m. OK GNU C++17 TESTS 2 0 0
198888379 lqbao07dona A March 24, 2023, 4:01 a.m. OK GNU C++17 TESTS 2 0 0
198886803 JUBHAI A March 24, 2023, 3:31 a.m. OK GNU C++17 TESTS 2 0 0
198885874 __InnocentStranger__ A March 24, 2023, 3:15 a.m. OK GNU C++17 TESTS 2 0 0
198883692 sprathamk A March 24, 2023, 2:29 a.m. OK GNU C++17 TESTS 2 0 0
198883498 SaiKai_Lk A March 24, 2023, 2:24 a.m. OK GNU C++17 TESTS 2 0 0
198882837 pretodf A March 24, 2023, 2:10 a.m. OK GNU C++17 TESTS 2 0 0
198891777 muzizhou A March 24, 2023, 4:53 a.m. OK GNU C++17 (64) TESTS 2 0 0
198890502 Holdout A March 24, 2023, 4:36 a.m. OK GNU C++17 (64) TESTS 2 0 0
198884103 jz796 A March 24, 2023, 2:38 a.m. OK GNU C++17 (64) TESTS 2 0 0
198883349 zhoujiu A March 24, 2023, 2:21 a.m. OK GNU C++17 (64) TESTS 2 0 0
198880451 Aurora0915 A March 24, 2023, 1:18 a.m. OK GNU C++17 (64) TESTS 2 0 0
198880422 zacharychao A March 24, 2023, 1:17 a.m. OK GNU C++17 (64) TESTS 2 0 0
198880162 PurpleCrayon A March 24, 2023, 1:12 a.m. OK GNU C++17 (64) TESTS 2 0 0
198876692 gabmei A March 24, 2023, 12:04 a.m. OK GNU C++17 (64) TESTS 2 0 0
198869600 Krzychuo A March 23, 2023, 10:02 p.m. OK GNU C++17 (64) TESTS 2 0 0
198866405 julianferres A March 23, 2023, 9:26 p.m. OK GNU C++17 (64) TESTS 2 0 0

remove filters

Back to search problems