Submission #319174

# Submission time Handle Problem Language Result Execution time Memory
319174 2020-11-04T11:28:45 Z sofapuden Odd-even (IZhO11_oddeven) Python 3
0 / 100
17 ms 2796 KB
n = int(input())
l = 0
r = n
while(l < r):
	mid = (l+r+1)//2
	cur = (mid*(mid+1))//2
	if(cur > n):
		r = mid-1
	else:
		l = mid
	if((l*(l+1))//2 != n):
		l+=1
print(2*n-l)
# Verdict Execution time Memory Grader output
1 Correct 17 ms 2796 KB Output is correct
2 Incorrect 16 ms 2796 KB Output isn't correct
3 Halted 0 ms 0 KB -