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 |
---|---|---|---|---|---|---|
1646 | Codeforces Round 774 (Div. 2) | FINISHED | False | 7200 | 85415099 | March 4, 2022, 3:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 24350 ) | A | Square Counting | PROGRAMMING | math | 800 |
B"Luis has a sequence of n+1 integers a_1, a_2, ldots, a_{n+1} . For each i = 1, 2, ldots, n+1 it is guaranteed that 0 <= q a_i < n , or a_i=n^2 . He has calculated the sum of all the elements of the sequence, and called this value s . Luis has lost his sequence, but he remembers the values of n and s . Can you find the number of elements in the sequence that are equal to n^2 ? We can show that the answer is unique under the given constraints. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 2 cdot 10^4 ). Description of the test cases follows. The only line of each test case contains two integers n and s ( 1 <= n< 10^6 , 0 <= s <= 10^{18} ). It is guaranteed that the value of s is a valid sum for some sequence satisfying the above constraints. For each test case, print one integer -- the number of elements in the sequence which are equal to n^2 . In the first test case, we have s=0 so all numbers are equal to 0 and there isn't any number equal to 49 . In the second test case, we have s=1 . There are two possible sequences: [0, 1] or [1, 0] . In both cases, the number 1 appears just once. In the third test case, we have s=12 , which is the maximum possible value of s for this case. Thus, the number 4 appears 3 times in the sequence. "... |
Codeforces Round #774 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
148409865 | Bajrang01 | A | March 5, 2022, 2:42 a.m. | OK | Clang++17 Diagnostics | TESTS | 11 | 311 | 0 | 800 | |
148411824 | drbean | A | March 5, 2022, 3:20 a.m. | OK | GNU C11 | TESTS | 11 | 93 | 0 | 800 | |
148410359 | akshat211103 | A | March 5, 2022, 2:53 a.m. | OK | GNU C11 | TESTS | 11 | 93 | 0 | 800 | |
148411758 | tejas2 | A | March 5, 2022, 3:19 a.m. | OK | GNU C11 | TESTS | 11 | 93 | 0 | 800 | |
148378665 | couict6 | A | March 4, 2022, 5:25 p.m. | OK | GNU C11 | TESTS | 11 | 93 | 0 | 800 | |
148402807 | mahdavifar | A | March 4, 2022, 10:55 p.m. | OK | GNU C11 | TESTS | 11 | 93 | 0 | 800 | |
148407634 | dean.menezes | A | March 5, 2022, 1:58 a.m. | OK | GNU C11 | TESTS | 11 | 93 | 0 | 800 | |
148418761 | Om_mavani | A | March 5, 2022, 5:01 a.m. | OK | GNU C11 | TESTS | 11 | 93 | 512000 | 800 | |
148416265 | diaowang | A | March 5, 2022, 4:31 a.m. | OK | GNU C11 | TESTS | 11 | 108 | 0 | 800 | |
148392336 | sameeksha_m | A | March 4, 2022, 7:23 p.m. | OK | GNU C11 | TESTS | 11 | 108 | 0 | 800 | |
148416867 | int_0_star | A | March 5, 2022, 4:38 a.m. | OK | GNU C11 | TESTS | 11 | 109 | 0 | 800 | |
148415543 | tushirsahu30 | A | March 5, 2022, 4:21 a.m. | OK | GNU C++14 | TESTS | 11 | 15 | 0 | 800 | |
148423865 | SWE_WanKu | A | March 5, 2022, 5:55 a.m. | OK | GNU C++14 | TESTS | 11 | 15 | 0 | 800 | |
148423831 | Rakhymzhan01 | A | March 5, 2022, 5:55 a.m. | OK | GNU C++14 | TESTS | 11 | 15 | 0 | 800 | |
148423296 | SWE_WanKu | A | March 5, 2022, 5:50 a.m. | OK | GNU C++14 | TESTS | 11 | 15 | 0 | 800 | |
148422376 | Professor20 | A | March 5, 2022, 5:41 a.m. | OK | GNU C++14 | TESTS | 11 | 15 | 0 | 800 | |
148420627 | sjain108 | A | March 5, 2022, 5:23 a.m. | OK | GNU C++14 | TESTS | 11 | 15 | 0 | 800 | |
148419258 | patidarujjawal | A | March 5, 2022, 5:07 a.m. | OK | GNU C++14 | TESTS | 11 | 15 | 0 | 800 | |
148418989 | dlglg | A | March 5, 2022, 5:04 a.m. | OK | GNU C++14 | TESTS | 11 | 15 | 0 | 800 | |
148416731 | sangarg1 | A | March 5, 2022, 4:37 a.m. | OK | GNU C++14 | TESTS | 11 | 15 | 0 | 800 | |
148414222 | zor_se_bolo | A | March 5, 2022, 4:01 a.m. | OK | GNU C++14 | TESTS | 11 | 15 | 0 | 800 | |
148418601 | Firefrog418 | A | March 5, 2022, 4:59 a.m. | OK | GNU C++17 | TESTS | 11 | 15 | 0 | 800 | |
148419196 | yashberchha | A | March 5, 2022, 5:06 a.m. | OK | GNU C++17 | TESTS | 11 | 15 | 0 | 800 | |
148421679 | deepug | A | March 5, 2022, 5:34 a.m. | OK | GNU C++17 | TESTS | 11 | 15 | 0 | 800 | |
148417548 | Eclipsed | A | March 5, 2022, 4:47 a.m. | OK | GNU C++17 | TESTS | 11 | 15 | 0 | 800 | |
148417403 | vemulapandu | A | March 5, 2022, 4:45 a.m. | OK | GNU C++17 | TESTS | 11 | 15 | 0 | 800 | |
148418189 | rohanop | A | March 5, 2022, 4:55 a.m. | OK | GNU C++17 | TESTS | 11 | 15 | 0 | 800 | |
148422429 | YhlasY | A | March 5, 2022, 5:42 a.m. | OK | GNU C++17 | TESTS | 11 | 15 | 0 | 800 | |
148422452 | daniilzimin4 | A | March 5, 2022, 5:42 a.m. | OK | GNU C++17 | TESTS | 11 | 15 | 0 | 800 | |
148423370 | msvardhan19 | A | March 5, 2022, 5:50 a.m. | OK | GNU C++17 | TESTS | 11 | 15 | 0 | 800 | |
148423455 | shiv0701 | A | March 5, 2022, 5:51 a.m. | OK | GNU C++17 | TESTS | 11 | 15 | 0 | 800 | |
148414769 | _Akagami_ | A | March 5, 2022, 4:10 a.m. | OK | GNU C++17 (64) | TESTS | 11 | 15 | 0 | 800 | |
148413355 | kodomotachi | A | March 5, 2022, 3:46 a.m. | OK | GNU C++17 (64) | TESTS | 11 | 15 | 0 | 800 | |
148413327 | binminh01 | A | March 5, 2022, 3:46 a.m. | OK | GNU C++17 (64) | TESTS | 11 | 15 | 0 | 800 | |
148411192 | harshaa05 | A | March 5, 2022, 3:08 a.m. | OK | GNU C++17 (64) | TESTS | 11 | 15 | 0 | 800 | |
148410463 | Dog_food_is_me | A | March 5, 2022, 2:55 a.m. | OK | GNU C++17 (64) | TESTS | 11 | 15 | 0 | 800 | |
148409823 | Goddan. | A | March 5, 2022, 2:42 a.m. | OK | GNU C++17 (64) | TESTS | 11 | 15 | 0 | 800 | |
148421080 | kingshukroy | A | March 5, 2022, 5:28 a.m. | OK | GNU C++17 (64) | TESTS | 11 | 15 | 0 | 800 | |
148419435 | yaoweiliu | A | March 5, 2022, 5:09 a.m. | OK | GNU C++17 (64) | TESTS | 11 | 15 | 0 | 800 | |
148417736 | AnuMax | A | March 5, 2022, 4:49 a.m. | OK | GNU C++17 (64) | TESTS | 11 | 15 | 0 | 800 | |
148413949 | purushottam_1048 | A | March 5, 2022, 3:56 a.m. | OK | GNU C++17 (64) | TESTS | 11 | 15 | 0 | 800 | |
148423388 | syyyrup | A | March 5, 2022, 5:51 a.m. | OK | GNU C++20 (64) | TESTS | 11 | 15 | 0 | 800 | |
148424185 | Aritra_Mandal | A | March 5, 2022, 5:59 a.m. | OK | GNU C++20 (64) | TESTS | 11 | 15 | 0 | 800 | |
148423441 | get_out_of_my_way | A | March 5, 2022, 5:51 a.m. | OK | GNU C++20 (64) | TESTS | 11 | 15 | 0 | 800 | |
148423378 | yuexia | A | March 5, 2022, 5:51 a.m. | OK | GNU C++20 (64) | TESTS | 11 | 15 | 0 | 800 | |
148423199 | sarveshtiwari24 | A | March 5, 2022, 5:49 a.m. | OK | GNU C++20 (64) | TESTS | 11 | 15 | 0 | 800 | |
148423086 | md_rana | A | March 5, 2022, 5:48 a.m. | OK | GNU C++20 (64) | TESTS | 11 | 15 | 0 | 800 | |
148422958 | bedi_1234 | A | March 5, 2022, 5:47 a.m. | OK | GNU C++20 (64) | TESTS | 11 | 15 | 0 | 800 | |
148422812 | GRITP | A | March 5, 2022, 5:45 a.m. | OK | GNU C++20 (64) | TESTS | 11 | 15 | 0 | 800 | |
148421048 | ShauryaV | A | March 5, 2022, 5:27 a.m. | OK | GNU C++20 (64) | TESTS | 11 | 15 | 0 | 800 | |
148420150 | WA_King | A | March 5, 2022, 5:18 a.m. | OK | GNU C++20 (64) | TESTS | 11 | 15 | 0 | 800 | |
148391395 | snroy | A | March 4, 2022, 7:14 p.m. | OK | Haskell | TESTS | 11 | 202 | 0 | 800 | |
148395793 | Satyaa | A | March 4, 2022, 8:06 p.m. | OK | Java 11 | TESTS | 11 | 171 | 0 | 800 | |
148423685 | MrOtter | A | March 5, 2022, 5:53 a.m. | OK | Java 11 | TESTS | 11 | 171 | 0 | 800 | |
148421803 | akashkumarkly | A | March 5, 2022, 5:35 a.m. | OK | Java 11 | TESTS | 11 | 171 | 0 | 800 | |
148424424 | kartik__sethi | A | March 5, 2022, 6:01 a.m. | OK | Java 11 | TESTS | 11 | 187 | 0 | 800 | |
148419529 | __Serendipity | A | March 5, 2022, 5:10 a.m. | OK | Java 11 | TESTS | 11 | 187 | 0 | 800 | |
148405457 | vijender_8601 | A | March 5, 2022, 1:05 a.m. | OK | Java 11 | TESTS | 11 | 187 | 0 | 800 | |
148400969 | henrychenOutlook | A | March 4, 2022, 9:53 p.m. | OK | Java 11 | TESTS | 11 | 187 | 0 | 800 | |
148388669 | _bakytov_ | A | March 4, 2022, 6:43 p.m. | OK | Java 11 | TESTS | 11 | 202 | 0 | 800 | |
148414373 | demo0863 | A | March 5, 2022, 4:03 a.m. | OK | Java 11 | TESTS | 11 | 202 | 0 | 800 | |
148414404 | LoudSilence | A | March 5, 2022, 4:04 a.m. | OK | Java 11 | TESTS | 11 | 202 | 0 | 800 | |
148388069 | ak_ankit | A | March 4, 2022, 6:39 p.m. | OK | Java 8 | TESTS | 11 | 109 | 0 | 800 | |
148399214 | Youssef1Shawky | A | March 4, 2022, 9:09 p.m. | OK | Java 8 | TESTS | 11 | 109 | 0 | 800 | |
148413460 | fyseus | A | March 5, 2022, 3:48 a.m. | OK | Java 8 | TESTS | 11 | 124 | 0 | 800 | |
148390155 | Mohamed308 | A | March 4, 2022, 6:56 p.m. | OK | Java 8 | TESTS | 11 | 124 | 0 | 800 | |
148398938 | adi_daredevil | A | March 4, 2022, 9:03 p.m. | OK | Java 8 | TESTS | 11 | 140 | 0 | 800 | |
148407815 | amit_roy | A | March 5, 2022, 2:02 a.m. | OK | Java 8 | TESTS | 11 | 155 | 0 | 800 | |
148411330 | MerickBao | A | March 5, 2022, 3:11 a.m. | OK | Java 8 | TESTS | 11 | 233 | 0 | 800 | |
148400894 | sreeprasad | A | March 4, 2022, 9:50 p.m. | OK | Java 8 | TESTS | 11 | 249 | 0 | 800 | |
148388257 | Kritika717 | A | March 4, 2022, 6:40 p.m. | OK | Java 8 | TESTS | 11 | 249 | 0 | 800 | |
148395912 | Suman_5501 | A | March 4, 2022, 8:08 p.m. | OK | Java 8 | TESTS | 11 | 264 | 0 | 800 | |
148387263 | nikilokitin | A | March 4, 2022, 6:34 p.m. | OK | MS C++ 2017 | TESTS | 11 | 62 | 307200 | 800 | |
148403847 | MeiVinEight | A | March 5, 2022, 12:03 a.m. | OK | MS C++ 2017 | TESTS | 11 | 109 | 0 | 800 | |
148401425 | ahmadtamim69 | A | March 4, 2022, 10:06 p.m. | OK | MS C++ 2017 | TESTS | 11 | 109 | 307200 | 800 | |
148383198 | Pkyadav123456 | A | March 4, 2022, 5:34 p.m. | OK | MS C++ 2017 | TESTS | 11 | 124 | 0 | 800 | |
148386675 | gabalawy | A | March 4, 2022, 6:30 p.m. | OK | MS C++ 2017 | TESTS | 11 | 124 | 0 | 800 | |
148376488 | loocq | A | March 4, 2022, 5:19 p.m. | OK | MS C++ 2017 | TESTS | 11 | 124 | 0 | 800 | |
148407536 | abhinavneelam949 | A | March 5, 2022, 1:57 a.m. | OK | MS C++ 2017 | TESTS | 11 | 124 | 0 | 800 | |
148406956 | HoangTran84 | A | March 5, 2022, 1:44 a.m. | OK | MS C++ 2017 | TESTS | 11 | 124 | 0 | 800 | |
148401519 | mohammad_n_hantouli | A | March 4, 2022, 10:09 p.m. | OK | MS C++ 2017 | TESTS | 11 | 124 | 409600 | 800 | |
148396027 | Weylyn | A | March 4, 2022, 8:10 p.m. | OK | .NET Core C# | TESTS | 11 | 202 | 3072000 | 800 | |
148376914 | enggandiys | A | March 4, 2022, 5:20 p.m. | OK | .NET Core C# | TESTS | 11 | 202 | 4198400 | 800 | |
148377867 | aldi.setiawan | A | March 4, 2022, 5:23 p.m. | OK | .NET Core C# | TESTS | 11 | 202 | 4198400 | 800 | |
148386372 | 1_2_3_4_5_9 | A | March 4, 2022, 6:28 p.m. | OK | PyPy 2 | TESTS | 11 | 140 | 3174400 | 800 | |
148396424 | ca3sar | A | March 4, 2022, 8:17 p.m. | OK | PyPy 3 | TESTS | 11 | 170 | 12595200 | 800 | |
148407292 | grawlixes | A | March 5, 2022, 1:52 a.m. | OK | PyPy 3 | TESTS | 11 | 202 | 8396800 | 800 | |
148415161 | ambs_ | A | March 5, 2022, 4:16 a.m. | OK | PyPy 3 | TESTS | 11 | 217 | 7168000 | 800 | |
148416574 | dominator1234 | A | March 5, 2022, 4:35 a.m. | OK | PyPy 3 | TESTS | 11 | 280 | 9728000 | 800 | |
148400676 | Usurper__ | A | March 4, 2022, 9:45 p.m. | OK | PyPy 3 | TESTS | 11 | 405 | 17100800 | 800 | |
148398941 | noobsatish | A | March 4, 2022, 9:03 p.m. | OK | PyPy 3 | TESTS | 11 | 436 | 7782400 | 800 | |
148393334 | zxcuser2 | A | March 4, 2022, 7:34 p.m. | OK | PyPy 3 | TESTS | 11 | 436 | 8704000 | 800 | |
148394748 | viveknegi | A | March 4, 2022, 7:52 p.m. | OK | PyPy 3 | TESTS | 11 | 452 | 8396800 | 800 | |
148424206 | 500068183 | A | March 5, 2022, 5:59 a.m. | OK | PyPy 3 | TESTS | 11 | 452 | 8601600 | 800 | |
148420264 | nicku123 | A | March 5, 2022, 5:19 a.m. | OK | PyPy 3-64 | TESTS | 11 | 93 | 5324800 | 800 | |
148414915 | DippleThree | A | March 5, 2022, 4:12 a.m. | OK | PyPy 3-64 | TESTS | 11 | 109 | 7168000 | 800 | |
148397084 | wolfram_ | A | March 4, 2022, 8:28 p.m. | OK | PyPy 3-64 | TESTS | 11 | 155 | 9420800 | 800 | |
148396049 | _icy_ | A | March 4, 2022, 8:10 p.m. | OK | PyPy 3-64 | TESTS | 11 | 171 | 9420800 | 800 | |
148412776 | DarkHorse_it_iz | A | March 5, 2022, 3:35 a.m. | OK | PyPy 3-64 | TESTS | 11 | 171 | 9523200 | 800 | |
148402337 | samchen123 | A | March 4, 2022, 10:37 p.m. | OK | PyPy 3-64 | TESTS | 11 | 171 | 9625600 | 800 | |
148416591 | Vanthoci | A | March 5, 2022, 4:35 a.m. | OK | PyPy 3-64 | TESTS | 11 | 171 | 9728000 | 800 | |
148410604 | Pars03 | A | March 5, 2022, 2:58 a.m. | OK | PyPy 3-64 | TESTS | 11 | 171 | 12800000 | 800 | |
148394150 | furmarie | A | March 4, 2022, 7:44 p.m. | OK | PyPy 3-64 | TESTS | 11 | 187 | 9625600 | 800 | |
148421158 | neshdev | A | March 5, 2022, 5:28 a.m. | OK | PyPy 3-64 | TESTS | 11 | 265 | 9728000 | 800 | |
148413766 | vjudge1 | A | March 5, 2022, 3:53 a.m. | OK | Python 3 | TESTS | 11 | 93 | 204800 | 800 | |
148412453 | bkifhr8 | A | March 5, 2022, 3:29 a.m. | OK | Python 3 | TESTS | 11 | 93 | 204800 | 800 | |
148400488 | Brigibel12 | A | March 4, 2022, 9:40 p.m. | OK | Python 3 | TESTS | 11 | 108 | 614400 | 800 | |
148397541 | RuddyCD | A | March 4, 2022, 8:35 p.m. | OK | Python 3 | TESTS | 11 | 108 | 614400 | 800 | |
148413992 | shriyans_3 | A | March 5, 2022, 3:57 a.m. | OK | Python 3 | TESTS | 11 | 108 | 1024000 | 800 | |
148410739 | MaveV | A | March 5, 2022, 3 a.m. | OK | Python 3 | TESTS | 11 | 109 | 716800 | 800 | |
148386190 | narrennagendra | A | March 4, 2022, 6:28 p.m. | OK | Python 3 | TESTS | 11 | 124 | 102400 | 800 | |
148421624 | Amir_hm | A | March 5, 2022, 5:33 a.m. | OK | Python 3 | TESTS | 11 | 155 | 3481600 | 800 | |
148414966 | vinayak3010 | A | March 5, 2022, 4:13 a.m. | OK | Python 3 | TESTS | 11 | 202 | 0 | 800 | |
148413570 | b20190 | A | March 5, 2022, 3:50 a.m. | OK | Python 3 | TESTS | 11 | 202 | 0 | 800 | |
148405347 | kela_bush | A | March 5, 2022, 1:02 a.m. | OK | Rust 2021 | TESTS | 11 | 202 | 0 | 800 |
Back to search problems