Submission #337847

# Submission time Handle Problem Language Result Execution time Memory
337847 2020-12-22T03:15:26 Z beksultan04 Odd-even (IZhO11_oddeven) Python 3
0 / 100
16 ms 2924 KB
a = (input())
a = int(a)
l = 1;
r = 1e50;
while (r-l>1):
    m = int((l+r)//2)
    x = int((l+r)//2)
    x = int((x*(x+1))//2)
    if int(x) >= int(a):
        r = m
    else:
        l = m
x = int((r*(r+1))//2)
if x >= a:
    l = r
c = l*l
cnt = l*(l+1)//2
c -= (cnt-a)*2


print (c)
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 2924 KB Output isn't correct
2 Halted 0 ms 0 KB -