Submission #882214

#TimeUsernameProblemLanguageResultExecution timeMemory
882214Mr_HusanboyOdd-even (IZhO11_oddeven)C++17
Compilation error
0 ms0 KiB
n = int(input()) l = 1 r = 10**51 while l <= r: m = (l + r) // 2 if((m + 1) * m / 2 >= n): r = m - 1 else: l = m + 1 l -= 1 k = (l + 1) * l // 2 if l % 2 == 1: if n == k: print((n - (l - 1) // 2) * 2 - 1) else: print((n - (l + 1) // 2) * 2) else: if n == k: print((n - l // 2) * 2) else: print((n - l // 2) * 2 - 1)

Compilation message (stderr)

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