Submission #319155

# Submission time Handle Problem Language Result Execution time Memory
319155 2020-11-04T09:22:19 Z sofapuden Odd-even (IZhO11_oddeven) C++14
Compilation error
0 ms 0 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)

Compilation message

oddeven.cpp:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^