Submission #874448

# Submission time Handle Problem Language Result Execution time Memory
874448 2023-11-17T04:09:27 Z The_Samurai Odd-even (IZhO11_oddeven) Python 3
0 / 100
11 ms 2956 KB
n = int(input())
l, r, best = 1, 2 * 10 ** 9, -1
while l <= r:
    m = (l + r) // 2
    if m * (m + 1) // 2 >= n:
        best = m
        r = m - 1
    else:
        l = m + 1
print(2 * n - best)
# Verdict Execution time Memory Grader output
1 Correct 11 ms 2908 KB Output is correct
2 Correct 10 ms 2908 KB Output is correct
3 Correct 10 ms 2908 KB Output is correct
4 Correct 10 ms 2908 KB Output is correct
5 Correct 10 ms 2908 KB Output is correct
6 Correct 10 ms 2956 KB Output is correct
7 Correct 10 ms 2908 KB Output is correct
8 Correct 10 ms 2908 KB Output is correct
9 Correct 11 ms 2908 KB Output is correct
10 Correct 10 ms 2908 KB Output is correct
11 Correct 10 ms 2808 KB Output is correct
12 Correct 10 ms 2908 KB Output is correct
13 Incorrect 10 ms 2908 KB Output isn't correct
14 Halted 0 ms 0 KB -