Codeforces Round 570 (Div. 3)

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
1183 Codeforces Round 570 (Div. 3) FINISHED False 8100 175879487 June 26, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 14190 ) C Computer Game PROGRAMMING binary search math 1400

B"Vova is playing a computer game. There are in total n turns in the game and Vova really wants to play all of them. The initial charge of his laptop battery (i.e. the charge before the start of the game) is k . During each turn Vova can choose what to do: Regardless of Vova's turns the charge of the laptop battery is always decreases. Vova wants to complete the game (Vova can complete the game if after each of n turns the charge of the laptop battery is strictly greater than 0 ). Vova has to play exactly n turns. Among all possible ways to complete the game, Vova wants to choose the one where the number of turns when he just plays (first type turn) is the maximum possible. It is possible that Vova cannot complete the game at all. Your task is to find out the maximum possible number of turns Vova can just play (make the first type turn) or report that Vova cannot complete the game. You have to answer q independent queries. The first line of the input contains one integer q ( 1 <= q <= 10^5 ) -- the number of queries. Each query is presented by a single line. The only line of the query contains four integers k, n, a and b ( 1 <= k, n <= 10^9, 1 <= b < a <= 10^9 ) -- the initial charge of Vova's laptop battery, the number of turns in the game and values a and b , correspondingly. For each query print one integer: -1 if Vova cannot complete the game or the maximum number of turns Vova can just play (make the first type turn) otherwise. In the first example query Vova can just play 4 turns and spend 12 units of charge and then one turn play and charge and spend 2 more units. So the remaining charge of the battery will be 1 . In the second example query Vova cannot complete the game because even if he will play and charge the battery during each turn then the charge of the laptop battery will be 0 after the last turn. "...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
56252092 xingqiwu C June 29, 2019, 4:04 a.m. OK Clang++17 Diagnostics TESTS 48 186 0 1400
57132164 wjzyh356 C July 16, 2019, 7:33 a.m. OK Clang++17 Diagnostics TESTS 48 2527 0 1400
56155771 shenqihao C June 27, 2019, 10:08 a.m. OK Clang++17 Diagnostics TESTS 48 2542 0 1400
56689848 vjudge2 C July 8, 2019, 2:54 a.m. OK Clang++17 Diagnostics TESTS 48 2713 0 1400
56251286 Zeatea C June 29, 2019, 3:22 a.m. OK FPC TESTS 48 374 3993600 1400
56170322 bin9638 C June 27, 2019, 4:12 p.m. OK FPC TESTS 48 390 102400 1400
56166421 Bear.-. C June 27, 2019, 2:28 p.m. OK FPC TESTS 48 404 819200 1400
63916010 chaorenhaha C Oct. 31, 2019, 10:05 a.m. OK FPC TESTS 48 405 0 1400
63655964 chaorenhaha C Oct. 28, 2019, 12:43 p.m. OK FPC TESTS 48 405 0 1400
56419361 sansen C July 2, 2019, 6:35 a.m. OK GNU C11 TESTS 48 46 0 1400
58488461 harshitrkt C Aug. 9, 2019, 8:36 a.m. OK GNU C11 TESTS 48 390 0 1400
56224113 RitikBaid C June 28, 2019, 11:12 a.m. OK GNU C11 TESTS 48 405 0 1400
56237436 rishiraje C June 28, 2019, 4:52 p.m. OK GNU C11 TESTS 48 405 0 1400
56729543 cs234_shrey C July 8, 2019, 11:29 p.m. OK GNU C11 TESTS 48 405 0 1400
56181760 kaiboy C June 28, 2019, 12:35 a.m. OK GNU C11 TESTS 48 405 0 1400
56223669 LuqiraTanU C June 28, 2019, 10:54 a.m. OK GNU C11 TESTS 48 405 0 1400
64259330 Razvan2000f C Nov. 4, 2019, 4:03 p.m. OK GNU C11 TESTS 48 405 819200 1400
66420914 cdza C Dec. 6, 2019, 6:53 p.m. OK GNU C11 TESTS 48 421 0 1400
65890874 mth1908 C Nov. 28, 2019, 3:12 a.m. OK GNU C11 TESTS 48 421 0 1400
56714276 lyzqs C July 8, 2019, 1:58 p.m. OK GNU C++11 TESTS 48 46 0 1400
56181966 Heartlessly C June 28, 2019, 12:50 a.m. OK GNU C++11 TESTS 48 46 0 1400
56181501 Heartlessly csj C June 28, 2019, 12:11 a.m. OK GNU C++11 TESTS 48 46 0 1400
63518364 Vxlimo C Oct. 27, 2019, 2:17 a.m. OK GNU C++11 TESTS 48 46 0 1400
64152256 yalizjc C Nov. 3, 2019, 11:47 a.m. OK GNU C++11 TESTS 48 46 0 1400
57200663 RoseKey C July 17, 2019, 1:37 p.m. OK GNU C++11 TESTS 48 46 0 1400
56706927 vjudge3 C July 8, 2019, 11:24 a.m. OK GNU C++11 TESTS 48 46 0 1400
58223934 Angrymath C Aug. 3, 2019, 1:41 p.m. OK GNU C++11 TESTS 48 46 0 1400
58224009 yashbad20 C Aug. 3, 2019, 1:43 p.m. OK GNU C++11 TESTS 48 46 0 1400
63518336 Vxlimo C Oct. 27, 2019, 2:15 a.m. OK GNU C++11 TESTS 48 46 0 1400
57796408 vishnu_m C July 26, 2019, 11:34 a.m. OK GNU C++14 TESTS 48 77 0 1400
56164339 xxrpg C June 27, 2019, 1:40 p.m. OK GNU C++14 TESTS 48 93 0 1400
56252079 xingqiwu C June 29, 2019, 4:04 a.m. OK GNU C++14 TESTS 48 93 0 1400
56171366 HipHop C June 27, 2019, 4:46 p.m. OK GNU C++14 TESTS 48 93 0 1400
56251450 DuyDn C June 29, 2019, 3:30 a.m. OK GNU C++14 TESTS 48 108 0 1400
67577849 MewnianO21 C Dec. 25, 2019, 4:02 a.m. OK GNU C++14 TESTS 48 108 0 1400
57152266 incognito_ C July 16, 2019, 3:16 p.m. OK GNU C++14 TESTS 48 108 0 1400
57100048 mayaohua2003 C July 15, 2019, 1:28 p.m. OK GNU C++14 TESTS 48 108 0 1400
56155317 ronaldocr7 C June 27, 2019, 9:55 a.m. OK GNU C++14 TESTS 48 108 0 1400
68840142 _HonEy C Jan. 15, 2020, 5:28 a.m. OK GNU C++14 TESTS 48 109 0 1400
57093712 lesskreker C July 15, 2019, 11:34 a.m. OK GNU C++17 TESTS 48 62 0 1400
56163898 Armin_Asgari C June 27, 2019, 1:29 p.m. OK GNU C++17 TESTS 48 78 0 1400
56164148 armin2006 C June 27, 2019, 1:35 p.m. OK GNU C++17 TESTS 48 78 0 1400
58133464 lgezyxr C Aug. 1, 2019, 3:09 p.m. OK GNU C++17 TESTS 48 93 0 1400
65153714 vjudge1 C Nov. 16, 2019, 8:31 a.m. OK GNU C++17 TESTS 48 93 0 1400
65154464 vjudge2 C Nov. 16, 2019, 8:47 a.m. OK GNU C++17 TESTS 48 93 0 1400
56740562 hertom5896 C July 9, 2019, 7:29 a.m. OK GNU C++17 TESTS 48 93 0 1400
57312842 gkkkrrrr131313 C July 19, 2019, 7:08 a.m. OK GNU C++17 TESTS 48 93 0 1400
56714034 pmitkov C July 8, 2019, 1:51 p.m. OK GNU C++17 TESTS 48 93 0 1400
57500733 shaozechen1999 C July 22, 2019, 10:03 a.m. OK GNU C++17 TESTS 48 93 0 1400
56168460 mredigonda C June 27, 2019, 3:22 p.m. OK Haskell TESTS 48 717 102400 1400
56178869 mr.pwner C June 27, 2019, 9:08 p.m. OK Java 8 TESTS 48 140 0 1400
56444963 IBatJ C July 2, 2019, 6:22 p.m. OK Java 8 TESTS 48 155 0 1400
58939262 dyhu083 C Aug. 17, 2019, 6:10 a.m. OK Java 8 TESTS 48 155 0 1400
58254324 T_Nady C Aug. 4, 2019, 9:17 a.m. OK Java 8 TESTS 48 155 0 1400
56725795 heet_2201 C July 8, 2019, 7:37 p.m. OK Java 8 TESTS 48 171 0 1400
56418914 Seco_seco C July 2, 2019, 6:22 a.m. OK Java 8 TESTS 48 171 0 1400
64174089 catforce C Nov. 3, 2019, 7:53 p.m. OK Java 8 TESTS 48 186 0 1400
61843325 housni C Oct. 4, 2019, 10:28 a.m. OK Java 8 TESTS 48 186 0 1400
61843132 housni C Oct. 4, 2019, 10:24 a.m. OK Java 8 TESTS 48 187 0 1400
57921326 darren_yao C July 29, 2019, 4:59 a.m. OK Java 8 TESTS 48 187 0 1400
57381243 hainhvn C July 20, 2019, 2:40 p.m. OK JavaScript TESTS 48 264 4300800 1400
56478980 Lavlet C July 3, 2019, 3:04 p.m. OK JavaScript TESTS 48 748 4300800 1400
56441382 Lavlet C July 2, 2019, 4:35 p.m. OK JavaScript TESTS 48 858 3686400 1400
57569464 Killer45 C July 23, 2019, 4:35 a.m. OK Kotlin TESTS 48 233 0 1400
56186403 Spheniscine C June 28, 2019, 5:07 a.m. OK Kotlin TESTS 48 436 409600 1400
56186313 Spheniscine C June 28, 2019, 5:02 a.m. OK Kotlin TESTS 48 436 409600 1400
62351962 david_varela C Oct. 11, 2019, 9:37 a.m. OK Kotlin TESTS 48 467 1331200 1400
56471717 harryoooooooooo C July 3, 2019, 11:26 a.m. OK Kotlin TESTS 48 577 2150400 1400
56226360 ScanNorOne C June 28, 2019, 12:35 p.m. OK Kotlin TESTS 48 1123 307200 1400
56499157 mendel_vv C July 4, 2019, 5:24 a.m. OK Kotlin TESTS 48 1138 307200 1400
56467843 treasuryonly C July 3, 2019, 9:40 a.m. OK Mono C# TESTS 48 217 9728000 1400
66166148 tomomo2b2 C Dec. 2, 2019, 7:43 a.m. OK Mono C# TESTS 48 249 6758400 1400
57859715 zazak C July 27, 2019, 5:03 p.m. OK Mono C# TESTS 48 842 3072000 1400
56551337 NEvOl C July 5, 2019, 9:55 a.m. OK Mono C# TESTS 48 842 6758400 1400
56185041 S.K C June 28, 2019, 4 a.m. OK MS C++ TESTS 48 78 0 1400
65149668 vjudge5 C Nov. 16, 2019, 6:58 a.m. OK MS C++ TESTS 48 78 0 1400
56706639 vjudge2 C July 8, 2019, 11:18 a.m. OK MS C++ TESTS 48 78 0 1400
66507771 vjudge2 C Dec. 8, 2019, 3:06 p.m. OK MS C++ TESTS 48 78 0 1400
65197055 vjudge3 C Nov. 16, 2019, 3:50 p.m. OK MS C++ TESTS 48 78 0 1400
65417586 vjudge2 C Nov. 20, 2019, 7:35 a.m. OK MS C++ TESTS 48 92 0 1400
65436924 vjudge5 C Nov. 20, 2019, 1:39 p.m. OK MS C++ TESTS 48 93 0 1400
68572616 vjudge1 C Jan. 11, 2020, 3:13 a.m. OK MS C++ TESTS 48 93 0 1400
65795595 vjudge5 C Nov. 27, 2019, 4:16 a.m. OK MS C++ TESTS 48 93 0 1400
65446445 vjudge1 C Nov. 20, 2019, 4:11 p.m. OK MS C++ TESTS 48 93 0 1400
56741669 lyk1012 C July 9, 2019, 7:58 a.m. OK MS C++ 2017 TESTS 48 140 0 1400
56293667 s0ysauce C June 30, 2019, 3:55 a.m. OK MS C++ 2017 TESTS 48 140 0 1400
56184932 llolitay C June 28, 2019, 3:53 a.m. OK MS C++ 2017 TESTS 48 140 0 1400
65413248 vjudge2 C Nov. 20, 2019, 5:34 a.m. OK MS C++ 2017 TESTS 48 140 0 1400
57103059 vjudge4 C July 15, 2019, 2:26 p.m. OK MS C++ 2017 TESTS 48 140 0 1400
57103017 vjudge2 C July 15, 2019, 2:25 p.m. OK MS C++ 2017 TESTS 48 140 0 1400
56961317 zhuzimo0802 C July 13, 2019, 6:42 a.m. OK MS C++ 2017 TESTS 48 140 0 1400
56424342 ENLYNN C July 2, 2019, 8:52 a.m. OK MS C++ 2017 TESTS 48 155 0 1400
57576675 ZSTU-2018329621261 C July 23, 2019, 7:18 a.m. OK MS C++ 2017 TESTS 48 156 0 1400
65232569 vjudge1 C Nov. 17, 2019, 5:48 a.m. OK MS C++ 2017 TESTS 48 171 0 1400
56633677 smarrti C July 6, 2019, 6:01 p.m. OK PascalABC.NET TESTS 48 2698 102400 1400
56399533 eg322 C July 1, 2019, 4:12 p.m. OK PascalABC.NET TESTS 48 2807 102400 1400
57956922 mayakin C July 29, 2019, 7:13 p.m. OK PHP TESTS 48 1340 0 1400
56177537 raj1307 C June 27, 2019, 8:08 p.m. OK PyPy 2 TESTS 48 233 14643200 1400
56374085 homie C July 1, 2019, 5:41 a.m. OK PyPy 2 TESTS 48 1403 5632000 1400
57937273 -Morass- C July 29, 2019, 11:16 a.m. OK PyPy 2 TESTS 48 1403 7372800 1400
56525400 frostD C July 4, 2019, 4:55 p.m. OK PyPy 2 TESTS 48 1653 5017600 1400
56248045 homie C June 28, 2019, 11:25 p.m. OK PyPy 2 TESTS 48 1700 5734400 1400
56625261 smunjal96 C July 6, 2019, 1:34 p.m. OK PyPy 2 TESTS 48 1700 6041600 1400
58626102 ssk497 C Aug. 11, 2019, 5:31 p.m. OK PyPy 2 TESTS 48 1700 6246400 1400
56166718 kaif_7 C June 27, 2019, 2:35 p.m. OK PyPy 2 TESTS 48 1731 5222400 1400
56552621 bertrandovide C July 5, 2019, 10:34 a.m. OK PyPy 2 TESTS 48 1777 6041600 1400
56729256 eightants C July 8, 2019, 11:03 p.m. OK PyPy 2 TESTS 48 1778 6144000 1400
64907166 yugismop C Nov. 14, 2019, 11:10 p.m. OK PyPy 3 TESTS 48 545 10649600 1400
67610293 vyassamir C Dec. 25, 2019, 3:08 p.m. OK PyPy 3 TESTS 48 546 10854400 1400
64993185 amruth_kumar C Nov. 15, 2019, 4:48 a.m. OK PyPy 3 TESTS 48 561 11059200 1400
57973449 StinsonOvO C July 30, 2019, 6:52 a.m. OK PyPy 3 TESTS 48 576 10854400 1400
57973080 StinsonOvO C July 30, 2019, 6:44 a.m. OK PyPy 3 TESTS 48 576 10956800 1400
56188194 dcshin C June 28, 2019, 6:11 a.m. OK PyPy 3 TESTS 48 577 11059200 1400
57881380 Parag_AP C July 28, 2019, 7:56 a.m. OK PyPy 3 TESTS 48 607 10649600 1400
57973001 StinsonOvO C July 30, 2019, 6:43 a.m. OK PyPy 3 TESTS 48 608 10752000 1400
56151204 nik-in-au C June 27, 2019, 8:14 a.m. OK PyPy 3 TESTS 48 608 15360000 1400
57991347 yfo C July 30, 2019, 1:22 p.m. OK PyPy 3 TESTS 48 624 10547200 1400
58117074 bhuya C Aug. 1, 2019, 9:14 a.m. OK Python 2 TESTS 48 545 0 1400
57547704 Helli.code C July 22, 2019, 4:35 p.m. OK Python 2 TESTS 48 576 1638400 1400
62094087 aTastyNoodle C Oct. 8, 2019, 6:52 a.m. OK Python 2 TESTS 48 577 14028800 1400
56280432 jolt.tks C June 29, 2019, 4:29 p.m. OK Python 2 TESTS 48 607 0 1400
56175919 Danimator C June 27, 2019, 7:07 p.m. OK Python 2 TESTS 48 654 1638400 1400
56248108 homie C June 28, 2019, 11:30 p.m. OK Python 2 TESTS 48 1138 1740800 1400
56374048 homie C July 1, 2019, 5:40 a.m. OK Python 2 TESTS 48 1169 1740800 1400
56408473 Dake3601 C July 1, 2019, 9:06 p.m. OK Python 3 TESTS 48 483 8396800 1400
57591346 takakin C July 23, 2019, 12:23 p.m. OK Python 3 TESTS 48 577 921600 1400
56185481 jhonhrge C June 28, 2019, 4:24 a.m. OK Python 3 TESTS 48 577 921600 1400
56281310 dejang C June 29, 2019, 4:58 p.m. OK Python 3 TESTS 48 592 409600 1400
56168464 crazy_bee C June 27, 2019, 3:22 p.m. OK Python 3 TESTS 48 654 921600 1400
56374188 nguyenminhhieu0709 C July 1, 2019, 5:44 a.m. OK Python 3 TESTS 48 654 2867200 1400
56541448 tapchik C July 5, 2019, 5:30 a.m. OK Python 3 TESTS 48 670 2457600 1400
57129311 Diplodont C July 16, 2019, 6:26 a.m. OK Python 3 TESTS 48 670 2867200 1400
56169874 LintuStorm C June 27, 2019, 3:59 p.m. OK Python 3 TESTS 48 670 2969600 1400
69464938 anshu271 C Jan. 24, 2020, 12:27 p.m. OK Python 3 TESTS 48 670 23654400 1400
68227273 nemi_zzz C Jan. 5, 2020, 7:41 a.m. OK Ruby TESTS 48 639 102400 1400
56271783 kobae964 C June 29, 2019, 12:24 p.m. OK Rust TESTS 48 217 3481600 1400
61108648 chinmaykousik1 C Sept. 23, 2019, 10:21 a.m. OK Rust TESTS 48 1091 0 1400
56155669 Peaupote C June 27, 2019, 10:05 a.m. OK Rust TESTS 48 1091 0 1400
64878895 techaddict C Nov. 14, 2019, 10:55 a.m. OK Scala TESTS 48 670 0 1400

remove filters

Back to search problems