| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1308492 | reginox | Odd-even (IZhO11_oddeven) | Pypy 3 | 170 ms | 48800 KiB |
n = int(input())
l = 0
r = n
while(l <= r):
mid = (l+r)//2
if(mid*(mid+1) <= n*2):
l = mid+1
else:
r = mid-1
v = l-1
add = 0
if(n-v*(v+1)//2 > 0):
add = (n-v*(v+1)//2)*2-1
print(int(v**2+add))
Compilation message (stdout)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
