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.
Problems
B"You are given a multiset S . Initially, S = {1,2,3, ldots, n } . You will perform the following operation n-1 times. It's easy to show that there will be exactly one number left after n-1 operations. Output that number. Each test contains multiple test cases. The first line contains a single integer t ( 1 <= t <= 10^5 ) -- the number of test cases. Their description follows. For each test case, one single line contains a single integer n ( 2 <= n <= 10^9 ) -- the initial size of the multiset S . For each test case, output an integer denoting the only number left after n-1 operations. We show how the multiset S changes for n=4 . Thus, the answer for n = 4 is 2 . "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
200077038 |
Lasya24 |
H |
April 1, 2023, 5:31 a.m. |
OK |
GNU C++14 |
TESTS |
18 |
342 |
0 |
|
|
200046944 |
kapopenko Gegedosh MakShon |
H |
March 31, 2023, 8:48 p.m. |
OK |
GNU C++17 |
TESTS |
18 |
311 |
0 |
|
|
200035767 |
HassanKh2002 |
H |
March 31, 2023, 6:48 p.m. |
OK |
GNU C++17 |
TESTS |
18 |
311 |
0 |
|
|
200034704 |
mlk_moaz_01 |
H |
March 31, 2023, 6:37 p.m. |
OK |
GNU C++17 |
TESTS |
18 |
311 |
0 |
|
|
200070326 |
gautamankoji |
H |
April 1, 2023, 4:06 a.m. |
OK |
GNU C++20 (64) |
TESTS |
18 |
312 |
0 |
|
|
200035707 |
ahmed.gamal007 |
H |
March 31, 2023, 6:47 p.m. |
OK |
GNU C++20 (64) |
TESTS |
18 |
312 |
0 |
|
|
200037970 |
Benq |
H |
March 31, 2023, 7:12 p.m. |
OK |
GNU C++20 (64) |
TESTS |
18 |
343 |
0 |
|
|
200054946 |
dmenezes |
H |
March 31, 2023, 10:43 p.m. |
OK |
GNU C++20 (64) |
TESTS |
18 |
452 |
0 |
|
|
200079273 |
Kurbanov |
H |
April 1, 2023, 5:55 a.m. |
OK |
GNU C++20 (64) |
TESTS |
18 |
467 |
0 |
|
|
200079346 |
Kurbanov |
H |
April 1, 2023, 5:56 a.m. |
OK |
GNU C++20 (64) |
TESTS |
18 |
468 |
0 |
|
|
remove filters
Back to search problems