Submission #338451

#TimeUsernameProblemLanguageResultExecution timeMemory
338451amunduzbaevOdd-even (IZhO11_oddeven)C++14
Compilation error
0 ms0 KiB
x = int(input()) l = 1 r = math.sqrt(x) while (l < r): m = (l + r)//2 if((m*(m+1)//2) > x): r = m-1 elif(((m+1)*(m+2)//2) < x): l = m+1 else: break ans = (l + r)//2 need = x - ans*(ans+1)//2 if(need == 0): aa = ans * ans else : aa = ans * ans+1 +((need-1)*2) print(aa)

Compilation message (stderr)

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