Codeforces Round 390 (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
754 Codeforces Round 390 (Div. 2) FINISHED False 7200 292692323 Jan. 6, 2017, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 1094 ) C Vladik and chat PROGRAMMING brute force constructive algorithms dp implementation strings 2200

Recently Vladik discovered a new entertainment — coding bots for social networks. He would like to use machine learning in his bots so now he want to prepare some learning data for them. At first, he need to download t chats. Vladik coded a script which should have downloaded the chats, however, something went wrong. In particular, some of the messages have no information of their sender. It is known that if a person sends several messages in a row, they all are merged into a single message. It means that there could not be two or more messages in a row with the same sender . Moreover, a sender never mention himself in his messages . Vladik wants to recover senders of all the messages so that each two neighboring messages will have different senders and no sender will mention himself in his messages. He has no idea of how to do this, and asks you for help. Help Vladik to recover senders in each of the chats! The first line contains single integer t ( 1 ≤ t ≤ 10 ) — the number of chats. The t chats follow. Each chat is given in the following format. The first line of each chat description contains single integer n ( 1 ≤ n ≤ 100 ) — the number of users in the chat. The next line contains n space-separated distinct usernames. Each username consists of lowercase and uppercase English letters and digits. The usernames can't start with a digit. Two usernames are different even if they differ only with letters' case. The length of username is positive and doesn't exceed 10 characters. The next line contains single integer m ( 1 ≤ m ≤ 100 ) — the number of messages in the chat. The next m line contain the messages in the following formats, one per line: : — the format of a message with known sender. The username should appear in the list of usernames of the chat. : — the format of a message with unknown sender. The text of a message can consist of lowercase and uppercase English letter, digits, characters '.' (dot), ',' (comma), '!' (exclamation mark), '?' (questi

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
23876120 FalseMirror C Jan. 16, 2017, 7:29 a.m. OK D TESTS 104 31 7372800 2200
23655324 FalseMirror C Jan. 8, 2017, 6:50 p.m. OK D TESTS 104 31 7372800 2200
23655252 FalseMirror C Jan. 8, 2017, 6:44 p.m. OK D TESTS 104 31 7372800 2200
23876085 FalseMirror C Jan. 16, 2017, 7:27 a.m. OK D TESTS 104 31 7475200 2200
23655671 FalseMirror C Jan. 8, 2017, 7:15 p.m. OK D TESTS 104 46 7372800 2200
23655370 FalseMirror C Jan. 8, 2017, 6:52 p.m. OK D TESTS 104 46 7372800 2200
23622358 MintGreen C Jan. 7, 2017, 11:03 a.m. OK FPC TESTS 104 46 4096000 2200
23615194 Tommyr7 C Jan. 7, 2017, 1:46 a.m. OK FPC TESTS 104 140 1945600 2200
23601038 gigajet C Jan. 6, 2017, 3:51 p.m. OK FPC TESTS 104 312 2969600 2200
23603385 hvcuong98 C Jan. 6, 2017, 4:10 p.m. OK FPC TESTS 104 1091 3788800 2200
23605349 NoSoul C Jan. 6, 2017, 4:26 p.m. OK GNU C TESTS 104 15 1945600 2200
23730626 KinKong1 C Jan. 12, 2017, 4:35 a.m. OK GNU C TESTS 104 30 2355200 2200
24354108 the_skinny_one C Feb. 1, 2017, 8:03 p.m. OK GNU C TESTS 104 31 1945600 2200
23891378 rainboy C Jan. 16, 2017, 10:22 p.m. OK GNU C TESTS 104 31 2355200 2200
23600920 cyand1317 C Jan. 6, 2017, 3:50 p.m. OK GNU C++ TESTS 104 15 1945600 2200
24884345 vjudge3 C Feb. 22, 2017, 3:44 a.m. OK GNU C++ TESTS 104 15 2150400 2200
24620775 vjudge3 C Feb. 13, 2017, 4:23 a.m. OK GNU C++ TESTS 104 15 2150400 2200
23598844 imaxblue C Jan. 6, 2017, 3:35 p.m. OK GNU C++ TESTS 104 15 2150400 2200
23603610 SAeed C Jan. 6, 2017, 4:12 p.m. OK GNU C++ TESTS 104 15 2252800 2200
23607550 laekov_ C Jan. 6, 2017, 5:15 p.m. OK GNU C++ TESTS 104 15 2355200 2200
23602318 salvare002 C Jan. 6, 2017, 4:01 p.m. OK GNU C++ TESTS 104 15 2457600 2200
23603986 orbitingflea C Jan. 6, 2017, 4:15 p.m. OK GNU C++ TESTS 104 30 2048000 2200
23739075 nsfxlyl C Jan. 12, 2017, 2:59 p.m. OK GNU C++ TESTS 104 30 2150400 2200
23608974 D_StrawHat C Jan. 6, 2017, 5:44 p.m. OK GNU C++ TESTS 104 30 2150400 2200
25704207 Amirp78 C March 22, 2017, 5:48 a.m. OK GNU C++11 TESTS 104 15 2150400 2200
23645584 javacoder1 C Jan. 8, 2017, 12:04 p.m. OK GNU C++11 TESTS 104 15 2150400 2200
23607263 WTL C Jan. 6, 2017, 5:11 p.m. OK GNU C++11 TESTS 104 15 2150400 2200
23600674 igand C Jan. 6, 2017, 3:48 p.m. OK GNU C++11 TESTS 104 15 2150400 2200
26766960 xianl C April 30, 2017, 11:59 a.m. OK GNU C++11 TESTS 104 15 2252800 2200
23603474 ae04071 C Jan. 6, 2017, 4:11 p.m. OK GNU C++11 TESTS 104 15 2252800 2200
23610658 flatline C Jan. 6, 2017, 6:47 p.m. OK GNU C++11 TESTS 104 15 2355200 2200
35610487 Ahmad__ C Feb. 23, 2018, 10 p.m. OK GNU C++11 TESTS 104 30 2150400 2200
24452179 Jurjstyle C Feb. 5, 2017, 1:29 p.m. OK GNU C++11 TESTS 104 30 2150400 2200
23687350 0xA28 C Jan. 10, 2017, 8:03 p.m. OK GNU C++11 TESTS 104 30 2150400 2200
27466049 despair C May 31, 2017, 12:07 p.m. OK GNU C++14 TESTS 104 15 307200 2200
24021634 kuyaAa26 C Jan. 22, 2017, 2:22 a.m. OK GNU C++14 TESTS 104 15 1945600 2200
26713879 Sereja C April 28, 2017, 6:14 a.m. OK GNU C++14 TESTS 104 15 2150400 2200
23780515 dipta1010 C Jan. 13, 2017, 9:17 a.m. OK GNU C++14 TESTS 104 15 2150400 2200
23780362 dipta1010 C Jan. 13, 2017, 9:09 a.m. OK GNU C++14 TESTS 104 15 2150400 2200
23624012 egor.okhterov C Jan. 7, 2017, 12:51 p.m. OK GNU C++14 TESTS 104 15 2150400 2200
23609386 yaegashi C Jan. 6, 2017, 5:58 p.m. OK GNU C++14 TESTS 104 15 2150400 2200
23600526 brokenblaze C Jan. 6, 2017, 3:47 p.m. OK GNU C++14 TESTS 104 15 2150400 2200
23613959 -Morass- C Jan. 6, 2017, 10:36 p.m. OK GNU C++14 TESTS 104 15 2252800 2200
23611100 treggit C Jan. 6, 2017, 7:07 p.m. OK GNU C++14 TESTS 104 15 2252800 2200
67969347 gs17005 C Dec. 30, 2019, 2:26 p.m. OK GNU C++17 TESTS 104 31 204800 2200
62440162 Phortox C Oct. 12, 2019, 7:03 p.m. OK GNU C++17 TESTS 104 31 307200 2200
47079510 abraham14 C Dec. 15, 2018, 6:46 p.m. OK GNU C++17 TESTS 104 31 307200 2200
40677068 walidsad C July 23, 2018, 4:15 p.m. OK GNU C++17 TESTS 104 31 307200 2200
38066314 Jakube C May 9, 2018, 9:18 a.m. OK GNU C++17 TESTS 104 31 3584000 2200
62440181 Phortox C Oct. 12, 2019, 7:03 p.m. OK GNU C++17 TESTS 104 46 307200 2200
60925276 Muhammad_Mustafa C Sept. 20, 2019, 12:04 p.m. OK GNU C++17 TESTS 104 46 307200 2200
56378104 zstu_MingSD C July 1, 2019, 7:22 a.m. OK GNU C++17 TESTS 104 46 307200 2200
65782125 karemo C Nov. 26, 2019, 8:25 p.m. OK GNU C++17 TESTS 104 46 409600 2200
60319900 vjudge4 C Sept. 9, 2019, 7:52 p.m. OK GNU C++17 TESTS 104 46 614400 2200
23611156 smalex69 C Jan. 6, 2017, 7:10 p.m. OK Go TESTS 104 31 27033600 2200
23605142 bhishma C Jan. 6, 2017, 4:24 p.m. OK Java 8 TESTS 104 124 20684800 2200
23608528 dusty.and.rusty C Jan. 6, 2017, 5:32 p.m. OK Java 8 TESTS 104 124 20787200 2200
23607369 dusty.and.rusty C Jan. 6, 2017, 5:13 p.m. OK Java 8 TESTS 104 124 20787200 2200
23608126 dusty.and.rusty C Jan. 6, 2017, 5:25 p.m. OK Java 8 TESTS 104 139 20889600 2200
52549773 TTTT0720 C April 10, 2019, 2:48 a.m. OK Java 8 TESTS 104 140 0 2200
23668640 JialinOuyang C Jan. 9, 2017, 6:05 p.m. OK Java 8 TESTS 104 140 20787200 2200
23603306 dusty.and.rusty C Jan. 6, 2017, 4:09 p.m. OK Java 8 TESTS 104 140 20889600 2200
23600999 Dukkha C Jan. 6, 2017, 3:51 p.m. OK Java 8 TESTS 104 140 20889600 2200
23600445 mcprice30 C Jan. 6, 2017, 3:46 p.m. OK Java 8 TESTS 104 140 20889600 2200
24748899 Abdullah_Abu_Alrish C Feb. 18, 2017, 2:33 a.m. OK Java 8 TESTS 104 140 20992000 2200
25025953 svilen C Feb. 26, 2017, 12:27 a.m. OK Kotlin TESTS 104 186 22220800 2200
25025980 svilen C Feb. 26, 2017, 12:32 a.m. OK Kotlin TESTS 104 187 22220800 2200
23613279 HaibaraAi C Jan. 6, 2017, 9:29 p.m. OK Mono C# TESTS 104 202 14643200 2200
23738326 AnatolyTolstobrov C Jan. 12, 2017, 2:13 p.m. OK MS C# TESTS 104 77 13926400 2200
23633270 og.kostya C Jan. 7, 2017, 6:51 p.m. OK MS C# TESTS 104 92 13107200 2200
23603469 camypaper C Jan. 6, 2017, 4:11 p.m. OK MS C# TESTS 104 93 11980800 2200
23608579 fr0st C Jan. 6, 2017, 5:34 p.m. OK MS C# TESTS 104 233 15257600 2200
25437310 Minnakhmetov C March 12, 2017, 2:46 p.m. OK MS C++ TESTS 104 15 2150400 2200
23616192 ferc C Jan. 7, 2017, 3:59 a.m. OK MS C++ TESTS 104 15 2252800 2200
23608794 _mactep C Jan. 6, 2017, 5:39 p.m. OK MS C++ TESTS 104 30 2252800 2200
23609927 Ruslan C Jan. 6, 2017, 6:17 p.m. OK MS C++ TESTS 104 30 2662400 2200
26462298 RCG C April 17, 2017, 6:48 p.m. OK MS C++ TESTS 104 30 2764800 2200
23646270 Eldervald C Jan. 8, 2017, 12:51 p.m. OK MS C++ TESTS 104 30 5836800 2200
24025495 superwatermelon C Jan. 22, 2017, 7:44 a.m. OK MS C++ TESTS 104 31 2150400 2200
23698503 666qwerty C Jan. 11, 2017, 10:23 a.m. OK MS C++ TESTS 104 31 2150400 2200
23620549 sand-martin C Jan. 7, 2017, 9:10 a.m. OK MS C++ TESTS 104 31 2150400 2200
23608128 nukeykt C Jan. 6, 2017, 5:25 p.m. OK MS C++ TESTS 104 31 2150400 2200
23614775 rsFalse C Jan. 7, 2017, 12:38 a.m. OK Perl TESTS 104 46 2764800 2200
23614710 rsFalse C Jan. 7, 2017, 12:23 a.m. OK Perl TESTS 104 61 2764800 2200
23614589 rsFalse C Jan. 7, 2017, 12:06 a.m. OK Perl TESTS 104 61 2969600 2200
23777642 perillasy C Jan. 13, 2017, 5:59 a.m. OK PHP TESTS 104 46 6041600 2200
23637431 mayakin C Jan. 7, 2017, 9:52 p.m. OK PHP TESTS 104 670 6041600 2200
29317957 venkat1997 C Aug. 10, 2017, 5:15 a.m. OK PyPy 2 TESTS 104 186 24371200 2200
23631902 mrthefakeperson C Jan. 7, 2017, 5:11 p.m. OK PyPy 2 TESTS 104 311 28160000 2200
23783234 cugel C Jan. 13, 2017, 11:32 a.m. OK PyPy 3 TESTS 104 218 29491200 2200
24470163 Ferume C Feb. 6, 2017, 2:28 p.m. OK PyPy 3 TESTS 104 249 29388800 2200
23617139 SimonR C Jan. 7, 2017, 5:30 a.m. OK PyPy 3 TESTS 104 311 30208000 2200
23597623 LiTi C Jan. 6, 2017, 3:27 p.m. OK PyPy 3 TESTS 104 530 29593600 2200
25142637 whn6325689 C March 2, 2017, 8:31 a.m. OK Python 2 TESTS 104 62 5324800 2200
23604071 yuto C Jan. 6, 2017, 4:16 p.m. OK Python 2 TESTS 104 62 5324800 2200
23662776 franckmy C Jan. 9, 2017, 8:45 a.m. OK Python 2 TESTS 104 77 5324800 2200
23620765 Vvalter C Jan. 7, 2017, 9:24 a.m. OK Python 2 TESTS 104 77 5324800 2200
23600966 fluffyowl C Jan. 6, 2017, 3:50 p.m. OK Python 2 TESTS 104 77 6860800 2200
28635712 HowardChung C July 17, 2017, 9:53 a.m. OK Python 2 TESTS 104 93 4915200 2200
23602111 zensh C Jan. 6, 2017, 3:59 p.m. OK Python 2 TESTS 104 108 4710400 2200
23623568 enterHandle C Jan. 7, 2017, 12:17 p.m. OK Python 2 TESTS 104 109 5324800 2200
23735286 pypy C Jan. 12, 2017, 10:37 a.m. OK Python 2 TESTS 104 155 4710400 2200
23622615 enterHandle C Jan. 7, 2017, 11:21 a.m. OK Python 2 TESTS 104 155 5427200 2200
23599678 wjh C Jan. 6, 2017, 3:41 p.m. OK Python 3 TESTS 104 77 5017600 2200
23605091 eku C Jan. 6, 2017, 4:24 p.m. OK Python 3 TESTS 104 77 5427200 2200
23603623 pylol C Jan. 6, 2017, 4:12 p.m. OK Python 3 TESTS 104 78 5017600 2200
23685098 alkhwarizmi C Jan. 10, 2017, 5:05 p.m. OK Python 3 TESTS 104 93 5017600 2200
23671593 alkhwarizmi C Jan. 9, 2017, 9:56 p.m. OK Python 3 TESTS 104 93 5017600 2200
23610612 swetank C Jan. 6, 2017, 6:45 p.m. OK Python 3 TESTS 104 93 5017600 2200
23615611 Totodile17 C Jan. 7, 2017, 2:47 a.m. OK Python 3 TESTS 104 93 5324800 2200
23660107 pimenta C Jan. 9, 2017, 5:20 a.m. OK Python 3 TESTS 104 93 5427200 2200
23607793 kostka C Jan. 6, 2017, 5:19 p.m. OK Python 3 TESTS 104 93 5529600 2200
23607725 kostka C Jan. 6, 2017, 5:18 p.m. OK Python 3 TESTS 104 93 5529600 2200

remove filters

Back to search problems