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 |
---|---|---|---|---|---|---|
1301 | Codeforces Round 619 (Div. 2) | FINISHED | False | 7200 | 155748311 | Feb. 13, 2020, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 9432 ) | C | Ayoub's function | PROGRAMMING | binary search combinatorics greedy math strings | 1700 |
B'Ayoub thinks that he is a very smart person, so he created a function f(s) , where s is a binary string (a string which contains only symbols "0" and "1"). The function f(s) is equal to the number of substrings in the string s that contains at least one symbol, that is equal to "1". More formally, f(s) is equal to the number of pairs of integers (l, r) , such that 1 <= q l <= q r <= q |s| (where |s| is equal to the length of string s ), such that at least one of the symbols s_l, s_{l+1}, ldots, s_r is equal to "1". For example, if s = "01010" then f(s) = 12 , because there are 12 such pairs (l, r) : (1, 2), (1, 3), (1, 4), (1, 5), (2, 2), (2, 3), (2, 4), (2, 5), (3, 4), (3, 5), (4, 4), (4, 5) . Ayoub also thinks that he is smarter than Mahmoud so he gave him two integers n and m and asked him this problem. For all binary strings s of length n which contains exactly m symbols equal to "1", find the maximum value of f(s) . Mahmoud couldn 't solve the problem so he asked you for help. Can you help him? The input consists of multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 10^5 ) -- the number of test cases. The description of the test cases follows. The only line for each test case contains two integers n , m ( 1 <= q n <= q 10^{9} , 0 <= q m <= q n ) -- the length of the string and the number of symbols equal to "1" in it. For every test case print one integer number -- the maximum value of f(s) over all strings s of length n , which has exactly m symbols, equal to "1". In the first test case, there exists only 3 strings of length 3 , which has exactly 1 symbol, equal to "1". These strings are: s_1 = "100", s_2 = "010", s_3 = "001". The values of f for them are: f(s_1) = 3, f(s_2) = 4, f(s_3) = 3 , so the'... |
Codeforces Round #619 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
70977042 | iica | C | Feb. 13, 2020, 3:05 p.m. | OK | D | TESTS | 17 | 155 | 4505600 | 1700 | |
70981711 | ruban | C | Feb. 13, 2020, 3:17 p.m. | OK | Delphi | TESTS | 17 | 639 | 0 | 1700 | |
70979586 | _Rebellion | C | Feb. 13, 2020, 3:12 p.m. | OK | GNU C11 | TESTS | 17 | 436 | 0 | 1700 | |
71055566 | frank1586 | C | Feb. 14, 2020, 11:36 a.m. | OK | GNU C11 | TESTS | 17 | 436 | 0 | 1700 | |
71018218 | rainboy | C | Feb. 13, 2020, 7:19 p.m. | OK | GNU C11 | TESTS | 17 | 452 | 0 | 1700 | |
70994534 | kernel.bin | C | Feb. 13, 2020, 3:53 p.m. | OK | GNU C11 | TESTS | 17 | 452 | 409600 | 1700 | |
70991637 | Fikshun | C | Feb. 13, 2020, 3:45 p.m. | OK | GNU C11 | TESTS | 17 | 467 | 0 | 1700 | |
70977683 | pengin_2000 | C | Feb. 13, 2020, 3:07 p.m. | OK | GNU C11 | TESTS | 17 | 467 | 0 | 1700 | |
71029978 | StepMommy | C | Feb. 14, 2020, 2:41 a.m. | OK | GNU C11 | TESTS | 17 | 468 | 0 | 1700 | |
70999109 | nEo. | C | Feb. 13, 2020, 4:08 p.m. | OK | GNU C11 | TESTS | 17 | 468 | 0 | 1700 | |
71057438 | frank1586 | C | Feb. 14, 2020, 12:27 p.m. | OK | GNU C11 | TESTS | 17 | 483 | 0 | 1700 | |
71021161 | kaiboy | C | Feb. 13, 2020, 8:26 p.m. | OK | GNU C11 | TESTS | 17 | 514 | 0 | 1700 | |
70974609 | daydream. | C | Feb. 13, 2020, 3 p.m. | OK | GNU C++11 | TESTS | 17 | 61 | 7987200 | 1700 | |
71028978 | AutumnKite | C | Feb. 14, 2020, 2:06 a.m. | OK | GNU C++11 | TESTS | 17 | 61 | 16588800 | 1700 | |
71040959 | MasonMount19 | C | Feb. 14, 2020, 6:55 a.m. | OK | GNU C++11 | TESTS | 17 | 62 | 0 | 1700 | |
71038188 | YJJ_Konnyaku | C | Feb. 14, 2020, 6:08 a.m. | OK | GNU C++11 | TESTS | 17 | 62 | 0 | 1700 | |
71035196 | lin_rany | C | Feb. 14, 2020, 5:10 a.m. | OK | GNU C++11 | TESTS | 17 | 62 | 0 | 1700 | |
71000357 | MN2016 | C | Feb. 13, 2020, 4:12 p.m. | OK | GNU C++11 | TESTS | 17 | 62 | 0 | 1700 | |
70998943 | zhltao | C | Feb. 13, 2020, 4:07 p.m. | OK | GNU C++11 | TESTS | 17 | 62 | 0 | 1700 | |
70989892 | Leidaxxb | C | Feb. 13, 2020, 3:40 p.m. | OK | GNU C++11 | TESTS | 17 | 62 | 0 | 1700 | |
70988386 | ChthollyNotaSeniorious | C | Feb. 13, 2020, 3:35 p.m. | OK | GNU C++11 | TESTS | 17 | 62 | 0 | 1700 | |
71091909 | Frame233 | C | Feb. 15, 2020, 2:20 a.m. | OK | GNU C++11 | TESTS | 17 | 62 | 0 | 1700 | |
70982981 | wleung_bvg | C | Feb. 13, 2020, 3:20 p.m. | OK | GNU C++14 | TESTS | 17 | 62 | 102400 | 1700 | |
70997348 | tokitsukaze | C | Feb. 13, 2020, 4:02 p.m. | OK | GNU C++14 | TESTS | 17 | 78 | 102400 | 1700 | |
71058797 | vaibhavnandan | C | Feb. 14, 2020, 12:53 p.m. | OK | GNU C++14 | TESTS | 17 | 93 | 0 | 1700 | |
71058805 | Michaelxu | C | Feb. 14, 2020, 12:53 p.m. | OK | GNU C++14 | TESTS | 17 | 93 | 0 | 1700 | |
71062914 | Heart_Blue | C | Feb. 14, 2020, 1:50 p.m. | OK | GNU C++14 | TESTS | 17 | 93 | 0 | 1700 | |
71085742 | Ankit211999 | C | Feb. 14, 2020, 9:08 p.m. | OK | GNU C++14 | TESTS | 17 | 93 | 0 | 1700 | |
71088340 | Luzivanlt | C | Feb. 14, 2020, 10:57 p.m. | OK | GNU C++14 | TESTS | 17 | 93 | 0 | 1700 | |
71089126 | Tudor67 | C | Feb. 14, 2020, 11:37 p.m. | OK | GNU C++14 | TESTS | 17 | 93 | 0 | 1700 | |
71044625 | Beastaman | C | Feb. 14, 2020, 8:02 a.m. | OK | GNU C++14 | TESTS | 17 | 93 | 0 | 1700 | |
71053099 | __saanto_ | C | Feb. 14, 2020, 10:42 a.m. | OK | GNU C++14 | TESTS | 17 | 93 | 0 | 1700 | |
70981108 | Alphagocc | C | Feb. 13, 2020, 3:15 p.m. | OK | GNU C++17 | TESTS | 17 | 61 | 512000 | 1700 | |
70973611 | natsugiri | C | Feb. 13, 2020, 2:57 p.m. | OK | GNU C++17 | TESTS | 17 | 78 | 0 | 1700 | |
71030449 | XeroxAuto | C | Feb. 14, 2020, 2:54 a.m. | OK | GNU C++17 | TESTS | 17 | 78 | 2048000 | 1700 | |
71051698 | smilingface | C | Feb. 14, 2020, 10:12 a.m. | OK | GNU C++17 | TESTS | 17 | 93 | 0 | 1700 | |
71052488 | Madhav_Agarwal | C | Feb. 14, 2020, 10:28 a.m. | OK | GNU C++17 | TESTS | 17 | 93 | 0 | 1700 | |
71057035 | Diorvh | C | Feb. 14, 2020, 12:16 p.m. | OK | GNU C++17 | TESTS | 17 | 93 | 0 | 1700 | |
71072146 | 20181094 | C | Feb. 14, 2020, 4:13 p.m. | OK | GNU C++17 | TESTS | 17 | 93 | 0 | 1700 | |
71077674 | PIANOCF | C | Feb. 14, 2020, 5:54 p.m. | OK | GNU C++17 | TESTS | 17 | 93 | 0 | 1700 | |
71077696 | PIANOCF | C | Feb. 14, 2020, 5:54 p.m. | OK | GNU C++17 | TESTS | 17 | 93 | 0 | 1700 | |
71085134 | Ozbaysa | C | Feb. 14, 2020, 8:46 p.m. | OK | GNU C++17 | TESTS | 17 | 93 | 0 | 1700 | |
70980610 | u1s1reallycai | C | Feb. 13, 2020, 3:14 p.m. | OK | Go | TESTS | 17 | 202 | 4505600 | 1700 | |
70995761 | synapse | C | Feb. 13, 2020, 3:57 p.m. | OK | Go | TESTS | 17 | 218 | 4505600 | 1700 | |
71003653 | Jughead | C | Feb. 13, 2020, 4:22 p.m. | OK | Go | TESTS | 17 | 436 | 0 | 1700 | |
71002922 | naipia | C | Feb. 13, 2020, 4:20 p.m. | OK | Go | TESTS | 17 | 436 | 0 | 1700 | |
71019085 | rm360179 | C | Feb. 13, 2020, 7:38 p.m. | OK | Haskell | TESTS | 17 | 483 | 2150400 | 1700 | |
70998626 | avijit_agarwal | C | Feb. 13, 2020, 4:06 p.m. | OK | Java 11 | TESTS | 17 | 218 | 0 | 1700 | |
70996820 | jenish9599 | C | Feb. 13, 2020, 4 p.m. | OK | Java 11 | TESTS | 17 | 248 | 0 | 1700 | |
71079252 | alankritanand001 | C | Feb. 14, 2020, 6:25 p.m. | OK | Java 11 | TESTS | 17 | 249 | 0 | 1700 | |
71076667 | ZeyadKhattab | C | Feb. 14, 2020, 5:33 p.m. | OK | Java 11 | TESTS | 17 | 249 | 0 | 1700 | |
70990712 | GiantTornado | C | Feb. 13, 2020, 3:42 p.m. | OK | Java 11 | TESTS | 17 | 249 | 0 | 1700 | |
70989727 | kashishsingh8700 | C | Feb. 13, 2020, 3:39 p.m. | OK | Java 11 | TESTS | 17 | 249 | 0 | 1700 | |
71088968 | elkadymohammed01 | C | Feb. 14, 2020, 11:28 p.m. | OK | Java 11 | TESTS | 17 | 264 | 0 | 1700 | |
71075009 | AbdallahArafa | C | Feb. 14, 2020, 5:02 p.m. | OK | Java 11 | TESTS | 17 | 265 | 0 | 1700 | |
70983590 | Azakarka | C | Feb. 13, 2020, 3:22 p.m. | OK | Java 11 | TESTS | 17 | 265 | 0 | 1700 | |
71084729 | TheSawan | C | Feb. 14, 2020, 8:35 p.m. | OK | Java 11 | TESTS | 17 | 280 | 0 | 1700 | |
71043763 | In_The_Name_Of_Love | C | Feb. 14, 2020, 7:46 a.m. | OK | Java 8 | TESTS | 17 | 155 | 0 | 1700 | |
71027660 | bluesky111 | C | Feb. 14, 2020, 1:14 a.m. | OK | Java 8 | TESTS | 17 | 155 | 0 | 1700 | |
71017245 | Ad-007 | C | Feb. 13, 2020, 7 p.m. | OK | Java 8 | TESTS | 17 | 155 | 0 | 1700 | |
70986517 | aman28rwt | C | Feb. 13, 2020, 3:30 p.m. | OK | Java 8 | TESTS | 17 | 155 | 0 | 1700 | |
70982828 | KharYusuf | C | Feb. 13, 2020, 3:20 p.m. | OK | Java 8 | TESTS | 17 | 156 | 0 | 1700 | |
70979595 | bhavyashah9873 | C | Feb. 13, 2020, 3:12 p.m. | OK | Java 8 | TESTS | 17 | 156 | 0 | 1700 | |
71012816 | A5SAS51N | C | Feb. 13, 2020, 5:53 p.m. | OK | Java 8 | TESTS | 17 | 171 | 0 | 1700 | |
71013286 | shashwat07 | C | Feb. 13, 2020, 5:59 p.m. | OK | Java 8 | TESTS | 17 | 171 | 0 | 1700 | |
70988310 | Charlesna | C | Feb. 13, 2020, 3:35 p.m. | OK | Java 8 | TESTS | 17 | 171 | 0 | 1700 | |
70982766 | saurabhs1206 | C | Feb. 13, 2020, 3:20 p.m. | OK | Java 8 | TESTS | 17 | 171 | 2560000 | 1700 | |
71042476 | Spheniscine | C | Feb. 14, 2020, 7:21 a.m. | OK | Kotlin | TESTS | 17 | 187 | 0 | 1700 | |
71041941 | Spheniscine | C | Feb. 14, 2020, 7:11 a.m. | OK | Kotlin | TESTS | 17 | 202 | 0 | 1700 | |
70986020 | SlavaG | C | Feb. 13, 2020, 3:28 p.m. | OK | Kotlin | TESTS | 17 | 857 | 0 | 1700 | |
70983785 | Denzed | C | Feb. 13, 2020, 3:22 p.m. | OK | Kotlin | TESTS | 17 | 998 | 307200 | 1700 | |
71075286 | Glebik8 | C | Feb. 14, 2020, 5:06 p.m. | OK | Kotlin | TESTS | 17 | 998 | 307200 | 1700 | |
71085806 | T-D-K | C | Feb. 14, 2020, 9:11 p.m. | OK | Mono C# | TESTS | 17 | 108 | 3072000 | 1700 | |
70993250 | riantkb | C | Feb. 13, 2020, 3:49 p.m. | OK | Mono C# | TESTS | 17 | 156 | 3174400 | 1700 | |
70985443 | Yupiteru | C | Feb. 13, 2020, 3:27 p.m. | OK | Mono C# | TESTS | 17 | 186 | 139264000 | 1700 | |
71044215 | artworks | C | Feb. 14, 2020, 7:55 a.m. | OK | Mono C# | TESTS | 17 | 187 | 7884800 | 1700 | |
70982327 | mban259 | C | Feb. 13, 2020, 3:18 p.m. | OK | Mono C# | TESTS | 17 | 202 | 13107200 | 1700 | |
70973908 | plasma-effect | C | Feb. 13, 2020, 2:58 p.m. | OK | Mono C# | TESTS | 17 | 218 | 17100800 | 1700 | |
71034708 | korntest | C | Feb. 14, 2020, 4:57 a.m. | OK | Mono C# | TESTS | 17 | 733 | 3072000 | 1700 | |
70992761 | sergmel | C | Feb. 13, 2020, 3:48 p.m. | OK | Mono C# | TESTS | 17 | 764 | 3072000 | 1700 | |
70999641 | eki | C | Feb. 13, 2020, 4:09 p.m. | OK | Mono C# | TESTS | 17 | 779 | 3072000 | 1700 | |
70982181 | tarattata1 | C | Feb. 13, 2020, 3:18 p.m. | OK | MS C++ | TESTS | 17 | 93 | 0 | 1700 | |
70990418 | songhaoran | C | Feb. 13, 2020, 3:41 p.m. | OK | MS C++ | TESTS | 17 | 140 | 0 | 1700 | |
71033298 | Anterior | C | Feb. 14, 2020, 4:20 a.m. | OK | MS C++ | TESTS | 17 | 514 | 0 | 1700 | |
70987015 | kwfumou1242 | C | Feb. 13, 2020, 3:31 p.m. | OK | MS C++ | TESTS | 17 | 514 | 24064000 | 1700 | |
70973088 | pichulia | C | Feb. 13, 2020, 2:56 p.m. | OK | MS C++ 2017 | TESTS | 17 | 124 | 0 | 1700 | |
70986726 | anylonger | C | Feb. 13, 2020, 3:30 p.m. | OK | MS C++ 2017 | TESTS | 17 | 124 | 0 | 1700 | |
70998353 | LeeLdler | C | Feb. 13, 2020, 4:05 p.m. | OK | MS C++ 2017 | TESTS | 17 | 124 | 819200 | 1700 | |
70999935 | hnust_zhouzisheng | C | Feb. 13, 2020, 4:10 p.m. | OK | MS C++ 2017 | TESTS | 17 | 140 | 0 | 1700 | |
70980449 | youx | C | Feb. 13, 2020, 3:14 p.m. | OK | MS C++ 2017 | TESTS | 17 | 140 | 0 | 1700 | |
70994582 | ningBr | C | Feb. 13, 2020, 3:54 p.m. | OK | MS C++ 2017 | TESTS | 17 | 218 | 307200 | 1700 | |
71019180 | extremum | C | Feb. 13, 2020, 7:40 p.m. | OK | MS C++ 2017 | TESTS | 17 | 249 | 0 | 1700 | |
70989943 | suun | C | Feb. 13, 2020, 3:40 p.m. | OK | MS C++ 2017 | TESTS | 17 | 249 | 307200 | 1700 | |
71016940 | dimasidorenko | C | Feb. 13, 2020, 6:54 p.m. | OK | MS C++ 2017 | TESTS | 17 | 249 | 307200 | 1700 | |
70986522 | Ksenia_C | C | Feb. 13, 2020, 3:30 p.m. | OK | MS C++ 2017 | TESTS | 17 | 264 | 0 | 1700 | |
71088611 | IngaleAnkur10 | C | Feb. 14, 2020, 11:10 p.m. | OK | PyPy 2 | TESTS | 17 | 280 | 7475200 | 1700 | |
70975284 | kabeer27 | C | Feb. 13, 2020, 3:01 p.m. | OK | PyPy 2 | TESTS | 17 | 295 | 7782400 | 1700 | |
70985168 | _kawaii_neko_ | C | Feb. 13, 2020, 3:26 p.m. | OK | PyPy 2 | TESTS | 17 | 296 | 18124800 | 1700 | |
70987871 | pajenegod | C | Feb. 13, 2020, 3:34 p.m. | OK | PyPy 2 | TESTS | 17 | 374 | 24268800 | 1700 | |
70983219 | addammy | C | Feb. 13, 2020, 3:21 p.m. | OK | PyPy 2 | TESTS | 17 | 780 | 14336000 | 1700 | |
70975506 | astrom.lars | C | Feb. 13, 2020, 3:02 p.m. | OK | PyPy 2 | TESTS | 17 | 810 | 19456000 | 1700 | |
71013102 | anshuman16423 | C | Feb. 13, 2020, 5:57 p.m. | OK | PyPy 2 | TESTS | 17 | 966 | 4505600 | 1700 | |
71007852 | AryaPawn | C | Feb. 13, 2020, 4:34 p.m. | OK | PyPy 3 | TESTS | 17 | 342 | 10240000 | 1700 | |
71013055 | siyy | C | Feb. 13, 2020, 5:56 p.m. | OK | PyPy 3 | TESTS | 17 | 358 | 10342400 | 1700 | |
70988217 | Pisces0311 | C | Feb. 13, 2020, 3:35 p.m. | OK | PyPy 3 | TESTS | 17 | 374 | 11673600 | 1700 | |
70999803 | DarkYagami | C | Feb. 13, 2020, 4:10 p.m. | OK | PyPy 3 | TESTS | 17 | 436 | 10137600 | 1700 | |
71045539 | tachyon777 | C | Feb. 14, 2020, 8:18 a.m. | OK | PyPy 3 | TESTS | 17 | 452 | 9318400 | 1700 | |
71041594 | adityajn105 | C | Feb. 14, 2020, 7:05 a.m. | OK | PyPy 3 | TESTS | 17 | 514 | 19763200 | 1700 | |
71063480 | programmer_neo | C | Feb. 14, 2020, 1:58 p.m. | OK | PyPy 3 | TESTS | 17 | 530 | 9625600 | 1700 | |
71039456 | xicarik | C | Feb. 14, 2020, 6:29 a.m. | OK | PyPy 3 | TESTS | 17 | 530 | 9728000 | 1700 | |
71001062 | UTMoonlight | C | Feb. 13, 2020, 4:14 p.m. | OK | PyPy 3 | TESTS | 17 | 545 | 9625600 | 1700 | |
71093075 | info.sourovroy1998 | C | Feb. 15, 2020, 3:08 a.m. | OK | PyPy 3 | TESTS | 17 | 545 | 9932800 | 1700 | |
70971551 | nwi | C | Feb. 13, 2020, 2:52 p.m. | OK | Python 2 | TESTS | 17 | 514 | 19148800 | 1700 | |
70999992 | mohammadrdeh | C | Feb. 13, 2020, 4:11 p.m. | OK | Python 2 | TESTS | 17 | 577 | 0 | 1700 | |
71070097 | _dipu | C | Feb. 14, 2020, 3:40 p.m. | OK | Python 2 | TESTS | 17 | 608 | 1740800 | 1700 | |
71079235 | zapdospops | C | Feb. 14, 2020, 6:25 p.m. | OK | Python 3 | TESTS | 17 | 467 | 12595200 | 1700 | |
71077487 | ShArt23 | C | Feb. 14, 2020, 5:50 p.m. | OK | Python 3 | TESTS | 17 | 545 | 10854400 | 1700 | |
71053320 | ryo_n | C | Feb. 14, 2020, 10:48 a.m. | OK | Python 3 | TESTS | 17 | 546 | 716800 | 1700 | |
70982216 | nethish | C | Feb. 13, 2020, 3:18 p.m. | OK | Python 3 | TESTS | 17 | 560 | 12902400 | 1700 | |
71042353 | tushartyagi8750 | C | Feb. 14, 2020, 7:19 a.m. | OK | Python 3 | TESTS | 17 | 561 | 716800 | 1700 | |
71011136 | throwawayatcoder | C | Feb. 13, 2020, 5:38 p.m. | OK | Python 3 | TESTS | 17 | 561 | 11366400 | 1700 | |
70999814 | shikixyx | C | Feb. 13, 2020, 4:10 p.m. | OK | Python 3 | TESTS | 17 | 561 | 19558400 | 1700 | |
71014637 | maxwill | C | Feb. 13, 2020, 6:16 p.m. | OK | Python 3 | TESTS | 17 | 577 | 716800 | 1700 | |
71011743 | KA_Rma | C | Feb. 13, 2020, 5:43 p.m. | OK | Python 3 | TESTS | 17 | 577 | 13721600 | 1700 | |
70984768 | Gaurav1 | C | Feb. 13, 2020, 3:25 p.m. | OK | Python 3 | TESTS | 17 | 608 | 5939200 | 1700 | |
70988585 | simanman | C | Feb. 13, 2020, 3:36 p.m. | OK | Ruby | TESTS | 17 | 577 | 0 | 1700 | |
70974585 | sansen | C | Feb. 13, 2020, 3 p.m. | OK | Rust | TESTS | 17 | 46 | 3686400 | 1700 | |
70975265 | tuna_salad | C | Feb. 13, 2020, 3:01 p.m. | OK | Rust | TESTS | 17 | 61 | 4812800 | 1700 | |
70985703 | knshnb | C | Feb. 13, 2020, 3:27 p.m. | OK | Rust | TESTS | 17 | 171 | 0 | 1700 |
Back to search problems