답안 #874448

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
874448 2023-11-17T04:09:27 Z The_Samurai 홀-짝 수열 (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)
# 결과 실행 시간 메모리 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 -