Codeforces Round 1124 (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
2269 Codeforces Round 1124 (Div. 2) FINISHED False 9000 1005916 Sept. 26, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 17578 ) A SauSaGe Bank PROGRAMMING greedy math

Everyone in SauSaGe City is talking about its famous bank that offers a seemingly impossible deal: "Leave your money with us, and we'll double it every single day!" Hamed decides to give it a try, so he deposits (1) dollar into his account. Suppose that at the beginning of a day, his bank balance is (x) dollars. Every day, the following events happen in order: In the morning, the bank magically doubles his balance, so it becomes (2x) dollars. At night, Hamed may choose to withdraw all of the money from his bank account. If he does, the withdrawn amount is added to his card, and his bank account is immediately reset to (1) dollar so that the doubling process can begin again the next day. Otherwise, he leaves the money in the bank. Unfortunately, this incredible bank will remain open for exactly (n) days before shutting down forever. Hamed wants to withdraw money on exactly (k) different days before the bank closes. Determine the maximum amount of money that can be on Hamed's card after the (n)-th day. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 500)). The description of the test cases follows. The only line of each test case contains the two integers (n) and (k) ((1\le k\le n\le30)). For each test case, print a single integer — the maximum amount of money that can be on Hamed's card after the (n)-th day. In the first test case, his bank balance becomes (2) on the first day, and he chooses to withdraw it. In the second test case, he can withdraw his money on the (2)-nd day. In the third test case, he can withdraw his money on the (1)-st, (3)-rd, and (4)-th days. He receives (2), (4), and (2), respectively.

Tutorials

157140

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
392276158 codaron A Sept. 27, 2026, 2:40 a.m. OK C++17 (GCC 7-32) TESTS 3 0 0
392227239 swordlord A Sept. 26, 2026, 4:37 p.m. OK C++17 (GCC 7-32) TESTS 3 0 0
392288839 Itu_Talishman A Sept. 27, 2026, 6:05 a.m. OK C++17 (GCC 7-32) TESTS 3 15 0
392288328 kavyabhadiyadra A Sept. 27, 2026, 5:59 a.m. OK C++17 (GCC 7-32) TESTS 3 15 0
392288291 Damn_NA A Sept. 27, 2026, 5:59 a.m. OK C++17 (GCC 7-32) TESTS 3 15 0
392288194 The_Tanish A Sept. 27, 2026, 5:58 a.m. OK C++17 (GCC 7-32) TESTS 3 15 0
392287593 sakshhhlovecp A Sept. 27, 2026, 5:52 a.m. OK C++17 (GCC 7-32) TESTS 3 15 0
392287149 drpook A Sept. 27, 2026, 5:48 a.m. OK C++17 (GCC 7-32) TESTS 3 15 0
392287042 kartikey_20cs A Sept. 27, 2026, 5:47 a.m. OK C++17 (GCC 7-32) TESTS 3 15 0
392286902 qixin777 A Sept. 27, 2026, 5:46 a.m. OK C++17 (GCC 7-32) TESTS 3 15 0
392288469 HuyzNolan A Sept. 27, 2026, 6:01 a.m. OK C++20 (GCC 13-64) TESTS 3 15 0
392286726 puneetrandhawa972 A Sept. 27, 2026, 5:44 a.m. OK C++20 (GCC 13-64) TESTS 3 15 0
392286388 kavya-rustagi A Sept. 27, 2026, 5:41 a.m. OK C++20 (GCC 13-64) TESTS 3 15 0
392284226 cisfire7 A Sept. 27, 2026, 5:16 a.m. OK C++20 (GCC 13-64) TESTS 3 15 0
392283686 Vikrant_Singh A Sept. 27, 2026, 5:08 a.m. OK C++20 (GCC 13-64) TESTS 3 15 0
392282069 biggerKING A Sept. 27, 2026, 4:40 a.m. OK C++20 (GCC 13-64) TESTS 3 15 0
392281905 A_T A Sept. 27, 2026, 4:37 a.m. OK C++20 (GCC 13-64) TESTS 3 15 0
392281040 sarthaksawant25 A Sept. 27, 2026, 4:21 a.m. OK C++20 (GCC 13-64) TESTS 3 15 0
392280870 Darshik A Sept. 27, 2026, 4:17 a.m. OK C++20 (GCC 13-64) TESTS 3 15 0
392280227 amogh17 A Sept. 27, 2026, 4:05 a.m. OK C++20 (GCC 13-64) TESTS 3 15 0

remove filters

Back to search problems