Nebius Welcome Round (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
1804 Nebius Welcome Round (Div. 1 + Div. 2) FINISHED False 7200 53191499 March 12, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 190 ) H Code Lock PROGRAMMING bitmasks dp

B"Lara has a safe that is locked with a circle-shaped code lock that consists of a rotating arrow, a static circumference around the arrow, an input screen, and an input button. The circumference of the lock is split into k equal sections numbered from 1 to k in clockwise order. Arrow always points to one of the sections. Each section is marked with one of the first k letters of the English alphabet. No two sections are marked with the same letter. Due to the lock limitations, the safe's password is a string of length n that consists of first k letters of the English alphabet only. Lara enters the password by rotating the lock's arrow and pressing the input button. Initially, the lock's arrow points to section 1 and the input screen is empty. In one second she can do one of the following actions. Lara has recently found out that the safe can be re-programmed. She can take the first k letters of the English alphabet and assign them to the sectors in any order she likes. Now she wants to re-arrange the letters in a way that will minimize the number of seconds it takes her to input the password. Compute this minimum number of seconds and the number of ways to assign letters, for which this minimum number of seconds is achieved. Two ways to assign letters to sectors are considered to be distinct if there exists at least one sector i that is assigned different letters. The first line of the input contains two integers k and n ( 2 <= q k <= q 16 , 2 <= q n <= q 100 ,000 ) -- the number of sectors on the lock's circumference and the length of Lara's password, respectively. The second line of the input contains a string of length n that consists of the first k lowercase letters of the English alphabet only. This string is the password. On the first line print minimum possible number of seconds it can take Lara to enter the password and open the safe if she assigns letters to se"...

Tutorials

Nebius Welcome Round Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
197183782 2100031767cse H March 13, 2023, 4:47 a.m. OK GNU C11 TESTS 81 5178 5939200
197175804 hima_varshini7 H March 13, 2023, 2:31 a.m. OK GNU C11 TESTS 81 5178 5939200
197175886 sai_neeraj H March 13, 2023, 2:33 a.m. OK GNU C11 TESTS 81 5178 5939200
197185806 NAVYA_30710 H March 13, 2023, 5:15 a.m. OK GNU C++17 (64) TESTS 81 5881 5836800
197147245 dipakgupta007 H March 12, 2023, 6:43 p.m. OK GNU C++17 (64) TESTS 81 6427 6144000
197140882 abhiratra510 H March 12, 2023, 6:01 p.m. OK GNU C++20 (64) TESTS 81 5912 6144000
197133699 jiangly H March 12, 2023, 5:23 p.m. OK GNU C++20 (64) TESTS 81 6021 6144000
197149462 Swistakk H March 12, 2023, 7:02 p.m. OK GNU C++20 (64) TESTS 81 6099 5734400

remove filters

Back to search problems