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 |
|---|---|---|---|---|---|---|
| 2068 | European Championship 2025 - Online Mirror (Unrated, ICPC Rules, Teams Preferred) | FINISHED | False | 18000 | 35493923 | March 2, 2025, 10:35 a.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 265 ) | D | Morse Code | PROGRAMMING | dp greedy sortings trees |
Morse code is a classical way to communicate over long distances, but there are some drawbacks that increase the transmission time of long messages. In Morse code, each character in the alphabet is assigned a sequence of dots and dashes such that no sequence is a prefix of another . To transmit a string of characters, the sequences corresponding to each character are sent in order. A dash takes twice as long to transmit as a dot. Your alphabet has (n) characters, where the (i)-th character appears with frequency (f_i) in your language. Your task is to design a Morse code encoding scheme, assigning a sequence of dots and dashes to each character, that minimizes the expected transmission time for a single character. In other words, you want to minimize (f_1t_1 + f_2t_2 + \cdots + f_nt_n), where (t_i) is the time required to transmit the sequence of dots and dashes assigned to the (i)-th character. The first line contains an integer (n) ((2\le n\le 200)) — the number of characters in the alphabet. The second line contains (n) real numbers (f_1), (f_2), (\ldots), (f_n) ((0 < f_i < 1)) — (f_i) is the frequency of the (i)-th character. All values (f_1), (f_2), (\ldots), (f_n) are given with exactly four digits after the decimal point. The sum of all frequencies is exactly 1. Print (n) lines, each containing one string consisting of dots (.) and dashes (-). The (i)-th line corresponds to the sequence of dots and dashes that you assign to the (i)-th character. If there are multiple valid assignments with the minimum possible expected transmission time, any of them is considered correct. In the first sample , the alphabet contains three letters, say (a), (b), and (c), with respective frequencies (0.3), (0.6), and (0.1). In the optimal assignment, we assign (a) to '(-.)', (b) to '(.)', and $$$ |
| 140239 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 308651055 | SmileyCraft Reinier | D | March 2, 2025, 12:32 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 93 | 66867200 | ||
| 308658165 | potato167 Nachia Rubikun | D | March 2, 2025, 1:23 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 202 | 207155200 | ||
| 308717162 | Mescherez | D | March 2, 2025, 10:01 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 281 | 398131200 | ||
| 308717244 | Mescherez | D | March 2, 2025, 10:02 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 296 | 398131200 | ||
| 308717153 | Mescherez | D | March 2, 2025, 10:01 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 436 | 564019200 | ||
| 308717944 | Mescherez | D | March 2, 2025, 10:14 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 577 | 573235200 | ||
| 308714176 | Mescherez | D | March 2, 2025, 9:21 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 843 | 1061785600 | ||
| 308717134 | Mescherez | D | March 2, 2025, 10 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 875 | 1061785600 | ||
| 308699687 | ay1357 | D | March 2, 2025, 7 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 906 | 781004800 | ||
| 308724458 | Sparkle_Twilight | D | March 3, 2025, 12:14 a.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 921 | 909926400 | ||
| 308663913 | molamola. gamegame | D | March 2, 2025, 2:03 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 92 | 103628800 | ||
| 308664522 | tourist | D | March 2, 2025, 2:08 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 139 | 135987200 | ||
| 308654493 | Xun_Xiaoyao crazy_sea dXqwq | D | March 2, 2025, 12:58 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 358 | 209612800 | ||
| 308712365 | toma_ariciu | D | March 2, 2025, 9:01 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 781 | 1061888000 | ||
| 308713794 | toma_ariciu | D | March 2, 2025, 9:17 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 811 | 1061888000 | ||
| 308680927 | umbrella-leaf | D | March 2, 2025, 4:01 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 953 | 1035878400 | ||
| 308672653 | ComPhyPark Mingyu331 gs20036 | D | March 2, 2025, 3:11 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 1686 | 1041510400 | ||
| 308674958 | Karuna arnold518 YeongTree | D | March 2, 2025, 3:28 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 1734 | 621568000 | ||
| 308656615 | 244mhq antontrygubO_o | D | March 2, 2025, 1:13 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 124 | 532582400 | ||
| 308666857 | chaeyihwan Numbering platter | D | March 2, 2025, 2:25 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 140 | 69120000 | ||
| 308662162 | LeoPro fastmath turmax | D | March 2, 2025, 1:52 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 499 | 276275200 | ||
| 308667985 | StarSilk | D | March 2, 2025, 2:34 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 515 | 433356800 | ||
| 308670496 | Kevin114514 jqdai0815 | D | March 2, 2025, 2:53 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 546 | 99123200 | ||
| 308711711 | toma_ariciu | D | March 2, 2025, 8:54 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 718 | 1061888000 | ||
| 308711909 | toma_ariciu | D | March 2, 2025, 8:56 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 749 | 1061888000 | ||
| 308656528 | jiangly | D | March 2, 2025, 1:12 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 843 | 769228800 | ||
| 308666269 | arvindf232 Noam527 errorgorn | D | March 2, 2025, 2:21 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 1203 | 90009600 | ||
| 308706785 | tkacper | D | March 2, 2025, 8:06 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 1561 | 81510400 | ||
| 308701212 | AghaTizi klein199 Tlatoani | D | March 2, 2025, 7:15 p.m. | OK | Kotlin 1.9 | TESTS | 24 | 312 | 131584000 |
Back to search problems