Codeforces Round 785 (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
1673 Codeforces Round 785 (Div. 2) FINISHED False 7200 85937063 April 30, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 18573 ) A Subtle Substring Subtraction PROGRAMMING games greedy strings

B'Alice and Bob are playing a game with strings. There will be t rounds in the game. In each round, there will be a string s consisting of lowercase English letters. Alice moves first and both the players take alternate turns. Alice is allowed to remove any substring of even length (possibly empty) and Bob is allowed to remove any substring of odd length from s . More formally, if there was a string s = s_1s_2 ldots s_k the player can choose a substring s_ls_{l+1} ldots s_{r-1}s_r with length of corresponding parity and remove it. After that the string will become s = s_1 ldots s_{l-1}s_{r+1} ldots s_k . After the string becomes empty, the round ends and each player calculates his/her score for this round. The score of a player is the sum of values of all characters removed by him/her. The value of texttt{a} is 1 , the value of texttt{b} is 2 , the value of texttt{c} is 3 , ldots , and the value of texttt{z} is 26 . The player with higher score wins the round. For each round, determine the winner and the difference between winner 's and loser 's scores. Assume that both players play optimally to maximize their score. It can be proved that a draw is impossible. The first line of input contains a single integer t ( 1 <= q t <= q 5 cdot 10^4 ) denoting the number of rounds. Each of the next t lines contain a single string s ( 1 <= q |s| <= q 2 cdot 10^5 ) consisting of lowercase English letters, denoting the string used for the round. Here |s| denotes the length of the string s . It is guaranteed that the sum of |s| over all rounds does not exceed 2 cdot 10^5 . For each round, print a single line containing a string and an integer. If Alice wins the round, the string must be "Alice". If Bob wins the round, the string must be "Bob". The integer must be the difference between their scores assuming both players play optimally. For '...

Tutorials

Codeforces Round #785 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
155478342 peanutbutter1 A May 1, 2022, 5:32 a.m. OK Clang++17 Diagnostics TESTS 18 139 13004800
155444088 shou7 A April 30, 2022, 5 p.m. OK Clang++17 Diagnostics TESTS 18 732 13107200
155439732 1435730 A April 30, 2022, 4:26 p.m. OK GNU C11 TESTS 18 15 204800
155432427 zsa.sauran A April 30, 2022, 3:58 p.m. OK GNU C11 TESTS 18 187 204800
155457938 Akshit_Sharma A April 30, 2022, 8:33 p.m. OK GNU C11 TESTS 18 187 204800
155439986 Akanta A April 30, 2022, 4:27 p.m. OK GNU C11 TESTS 18 202 204800
155456083 neelu_nzn A April 30, 2022, 7:52 p.m. OK GNU C11 TESTS 18 202 204800
155474395 Barnali59 A May 1, 2022, 4:23 a.m. OK GNU C11 TESTS 18 202 204800
155434889 YashOP_007 A April 30, 2022, 4:07 p.m. OK GNU C11 TESTS 18 202 204800
155435153 venomouseagle A April 30, 2022, 4:08 p.m. OK GNU C11 TESTS 18 202 204800
155449550 Gold_Dragon A April 30, 2022, 5:58 p.m. OK GNU C11 TESTS 18 218 204800
155472733 Dyaa A May 1, 2022, 3:52 a.m. OK GNU C11 TESTS 18 218 204800
155464673 lonely_lovely_ckj A May 1, 2022, 12:02 a.m. OK GNU C++14 TESTS 18 0 1945600
155475735 Eternal_Light A May 1, 2022, 4:50 a.m. OK GNU C++14 TESTS 18 15 204800
155471659 Sand_Tripper A May 1, 2022, 3:27 a.m. OK GNU C++14 TESTS 18 15 204800
155470892 frzhi A May 1, 2022, 3:09 a.m. OK GNU C++14 TESTS 18 15 204800
155468666 zorbin A May 1, 2022, 2:12 a.m. OK GNU C++14 TESTS 18 15 204800
155466830 Luminolic_Black A May 1, 2022, 1:15 a.m. OK GNU C++14 TESTS 18 15 204800
155463997 Ignotus0 A April 30, 2022, 11:35 p.m. OK GNU C++14 TESTS 18 15 204800
155471967 whitesirwang A May 1, 2022, 3:35 a.m. OK GNU C++14 TESTS 18 15 307200
155479104 Asuna12138666 A May 1, 2022, 5:42 a.m. OK GNU C++14 TESTS 18 15 512000
155477973 tawhidhassan A May 1, 2022, 5:26 a.m. OK GNU C++14 TESTS 18 15 512000
155471763 punitpatel A May 1, 2022, 3:29 a.m. OK GNU C++17 TESTS 18 15 204800
155467441 rbl_p A May 1, 2022, 1:35 a.m. OK GNU C++17 TESTS 18 15 204800
155432141 algoishard A April 30, 2022, 3:57 p.m. OK GNU C++17 TESTS 18 15 204800
155466737 202001024324 A May 1, 2022, 1:12 a.m. OK GNU C++17 TESTS 18 15 204800
155475617 kobeforces A May 1, 2022, 4:47 a.m. OK GNU C++17 TESTS 18 15 204800
155474974 ChuancyL A May 1, 2022, 4:35 a.m. OK GNU C++17 TESTS 18 15 204800
155479502 qu_bit A May 1, 2022, 5:48 a.m. OK GNU C++17 TESTS 18 15 512000
155478594 PraKash5 A May 1, 2022, 5:36 a.m. OK GNU C++17 TESTS 18 15 512000
155480049 ultranoob_coder A May 1, 2022, 5:55 a.m. OK GNU C++17 TESTS 18 15 512000
155480265 garvgarg100 A May 1, 2022, 5:58 a.m. OK GNU C++17 TESTS 18 15 512000
155439887 T1_ A April 30, 2022, 4:27 p.m. OK GNU C++17 (64) TESTS 18 15 204800
155475704 NinjaSenpai A May 1, 2022, 4:49 a.m. OK GNU C++17 (64) TESTS 18 15 512000
155472550 izumiQR A May 1, 2022, 3:48 a.m. OK GNU C++17 (64) TESTS 18 15 512000
155480198 paul_t A May 1, 2022, 5:57 a.m. OK GNU C++17 (64) TESTS 18 15 512000
155480042 S_Neal A May 1, 2022, 5:55 a.m. OK GNU C++17 (64) TESTS 18 15 512000
155480054 TomiokapEace A May 1, 2022, 5:55 a.m. OK GNU C++17 (64) TESTS 18 15 512000
155478885 sajin10 A May 1, 2022, 5:39 a.m. OK GNU C++17 (64) TESTS 18 15 512000
155478462 adarsh403 A May 1, 2022, 5:34 a.m. OK GNU C++17 (64) TESTS 18 15 512000
155477755 anant83 A May 1, 2022, 5:23 a.m. OK GNU C++17 (64) TESTS 18 15 512000
155476366 sugam10 A May 1, 2022, 5:01 a.m. OK GNU C++17 (64) TESTS 18 15 512000
155455349 Niko919 A April 30, 2022, 7:36 p.m. OK GNU C++20 (64) TESTS 18 0 512000
155476276 Aktan17 A May 1, 2022, 4:59 a.m. OK GNU C++20 (64) TESTS 18 0 512000
155476950 bhattaman0001 A May 1, 2022, 5:11 a.m. OK GNU C++20 (64) TESTS 18 15 512000
155478585 Chao_zi A May 1, 2022, 5:36 a.m. OK GNU C++20 (64) TESTS 18 15 512000
155478654 anirudh31 A May 1, 2022, 5:36 a.m. OK GNU C++20 (64) TESTS 18 15 512000
155478830 rxhxn_30 A May 1, 2022, 5:39 a.m. OK GNU C++20 (64) TESTS 18 15 512000
155479006 pradeep_kasyap A May 1, 2022, 5:41 a.m. OK GNU C++20 (64) TESTS 18 15 512000
155479112 Atangyl A May 1, 2022, 5:42 a.m. OK GNU C++20 (64) TESTS 18 15 512000
155479558 EnterYourName A May 1, 2022, 5:48 a.m. OK GNU C++20 (64) TESTS 18 15 512000
155479871 IUHAquarius A May 1, 2022, 5:53 a.m. OK GNU C++20 (64) TESTS 18 15 512000
155446180 Omar_Fahim A April 30, 2022, 5:21 p.m. OK Java 11 TESTS 18 171 0
155444836 vijender_8601 A April 30, 2022, 5:07 p.m. OK Java 11 TESTS 18 186 0
155466168 the_unseen A May 1, 2022, 12:52 a.m. OK Java 11 TESTS 18 202 0
155479204 sharnit A May 1, 2022, 5:44 a.m. OK Java 11 TESTS 18 202 0
155469268 Wuya A May 1, 2022, 2:27 a.m. OK Java 11 TESTS 18 202 0
155465807 HakkaAme A May 1, 2022, 12:40 a.m. OK Java 11 TESTS 18 202 0
155458785 powervic08 A April 30, 2022, 8:55 p.m. OK Java 11 TESTS 18 202 0
155444869 SJacob A April 30, 2022, 5:07 p.m. OK Java 11 TESTS 18 202 0
155443658 rohanailoni A April 30, 2022, 4:58 p.m. OK Java 11 TESTS 18 202 409600
155477560 sf14t A May 1, 2022, 5:20 a.m. OK Java 11 TESTS 18 218 0
155445897 Mohamed308 A April 30, 2022, 5:17 p.m. OK Java 8 TESTS 18 93 0
155453105 Koka A April 30, 2022, 6:56 p.m. OK Java 8 TESTS 18 108 0
155472408 vaibhav_1710 A May 1, 2022, 3:44 a.m. OK Java 8 TESTS 18 108 0
155455507 VishuTomar A April 30, 2022, 7:40 p.m. OK Java 8 TESTS 18 124 0
155449424 toufique_husein A April 30, 2022, 5:56 p.m. OK Java 8 TESTS 18 140 0
155459253 Ah86543 A April 30, 2022, 9:07 p.m. OK Java 8 TESTS 18 155 0
155445496 happy_or_saad A April 30, 2022, 5:13 p.m. OK Java 8 TESTS 18 404 0
155472718 Syed_Ali_SJIT A May 1, 2022, 3:52 a.m. OK Java 8 TESTS 18 405 0
155453128 S8ouL A April 30, 2022, 6:56 p.m. OK Java 8 TESTS 18 405 0
155464375 -crazy_coder- A April 30, 2022, 11:51 p.m. OK Java 8 TESTS 18 405 0
155477847 hoxym01a A May 1, 2022, 5:24 a.m. OK Kotlin 1.6 TESTS 18 514 0
155445133 Nuklinoid A April 30, 2022, 5:09 p.m. OK Mono C# TESTS 18 171 2969600
155458725 Damirca A April 30, 2022, 8:53 p.m. OK MS C++ 2017 TESTS 18 46 512000
155469022 Fish_L A May 1, 2022, 2:21 a.m. OK MS C++ 2017 TESTS 18 186 409600
155469182 mishra-aayush A May 1, 2022, 2:25 a.m. OK MS C++ 2017 TESTS 18 187 409600
155448647 Nitin333 A April 30, 2022, 5:46 p.m. OK MS C++ 2017 TESTS 18 187 512000
155439681 comderbro A April 30, 2022, 4:26 p.m. OK MS C++ 2017 TESTS 18 202 512000
155431249 anji_1105 A April 30, 2022, 3:54 p.m. OK MS C++ 2017 TESTS 18 202 512000
155436805 Ncato_Del_Gormo7 A April 30, 2022, 4:15 p.m. OK MS C++ 2017 TESTS 18 218 409600
155450183 TheILICH A April 30, 2022, 6:07 p.m. OK .NET Core C# TESTS 18 202 3174400
155445218 loop42 A April 30, 2022, 5:10 p.m. OK .NET Core C# TESTS 18 202 5734400
155448320 A7medTarik A April 30, 2022, 5:42 p.m. OK .NET Core C# TESTS 18 218 3276800
155443750 1_2_3_4_5_9 A April 30, 2022, 4:58 p.m. OK PyPy 2 TESTS 18 187 3993600
155460561 Deathfile78 A April 30, 2022, 9:41 p.m. OK PyPy 2 TESTS 18 374 4812800
155452483 Adolf988 A April 30, 2022, 6:45 p.m. OK PyPy 3 TESTS 18 233 9420800
155436101 yosuanicolaus A April 30, 2022, 4:12 p.m. OK PyPy 3 TESTS 18 311 8294400
155474671 dimasik06 A May 1, 2022, 4:29 a.m. OK PyPy 3 TESTS 18 733 9420800
155434495 r0lladur A April 30, 2022, 4:06 p.m. OK PyPy 3 TESTS 18 733 9932800
155452684 fiblonaria A April 30, 2022, 6:48 p.m. OK PyPy 3 TESTS 18 748 9420800
155443573 debjotyms A April 30, 2022, 4:57 p.m. OK PyPy 3 TESTS 18 748 9830400
155461748 python_for_uu A April 30, 2022, 10:16 p.m. OK PyPy 3 TESTS 18 763 10035200
155435197 newbie017coder A April 30, 2022, 4:08 p.m. OK PyPy 3 TESTS 18 764 9011200
155446692 Jguerra47 A April 30, 2022, 5:26 p.m. OK PyPy 3 TESTS 18 795 9523200
155430571 Coder_XX A April 30, 2022, 3:51 p.m. OK PyPy 3 TESTS 18 826 9728000
155450842 nitish420 A April 30, 2022, 6:17 p.m. OK PyPy 3-64 TESTS 18 139 13926400
155444984 DippleThree A April 30, 2022, 5:08 p.m. OK PyPy 3-64 TESTS 18 170 12288000
155472090 rivnam A May 1, 2022, 3:38 a.m. OK PyPy 3-64 TESTS 18 171 9830400
155445022 Ayushman_123 A April 30, 2022, 5:08 p.m. OK PyPy 3-64 TESTS 18 295 14745600
155455395 Abatur A April 30, 2022, 7:37 p.m. OK PyPy 3-64 TESTS 18 514 13004800
155456755 madhu94 A April 30, 2022, 8:07 p.m. OK PyPy 3-64 TESTS 18 639 10240000
155479523 darkeer A May 1, 2022, 5:48 a.m. OK PyPy 3-64 TESTS 18 639 10342400
155449965 Nurmyrat A April 30, 2022, 6:04 p.m. OK PyPy 3-64 TESTS 18 655 10547200
155478550 _Severus_Snape A May 1, 2022, 5:35 a.m. OK PyPy 3-64 TESTS 18 655 10649600
155449756 Pythonic__Python A April 30, 2022, 6:01 p.m. OK PyPy 3-64 TESTS 18 655 10649600
155480435 zzczzc004 A May 1, 2022, 6 a.m. OK Python 2 TESTS 18 124 1024000
155450657 daffynugget A April 30, 2022, 6:14 p.m. OK Python 3 TESTS 18 202 2867200
155438680 monodromy A April 30, 2022, 4:22 p.m. OK Python 3 TESTS 18 296 2764800
155443711 LastWhiteWalker A April 30, 2022, 4:58 p.m. OK Python 3 TESTS 18 327 2662400
155454559 michaleproff A April 30, 2022, 7:21 p.m. OK Python 3 TESTS 18 436 1945600
155472645 andr14142 A May 1, 2022, 3:50 a.m. OK Python 3 TESTS 18 451 512000
155459497 root__ A April 30, 2022, 9:13 p.m. OK Python 3 TESTS 18 451 1945600
155446121 bronze_coder A April 30, 2022, 5:20 p.m. OK Python 3 TESTS 18 467 512000
155478878 aidan792251 A May 1, 2022, 5:39 a.m. OK Python 3 TESTS 18 468 409600
155435955 nagasaikayithi A April 30, 2022, 4:11 p.m. OK Python 3 TESTS 18 468 512000
155451436 VedantMehta A April 30, 2022, 6:26 p.m. OK Python 3 TESTS 18 483 409600
155453652 utkarsh A April 30, 2022, 7:05 p.m. OK Ruby 3 TESTS 18 342 12288000
155469250 zeronosu77108_ A May 1, 2022, 2:27 a.m. OK Rust 2021 TESTS 18 420 3584000

remove filters

Back to search problems