Submission #1308540

#TimeUsernameProblemLanguageResultExecution timeMemory
1308540MahogOdd-even (IZhO11_oddeven)Pypy 3
0 / 100
169 ms48812 KiB
import math

n = int(input())

temp = int(math.sqrt(n * 2)) - 2
if (temp + 1) * (temp + 2) // 2 < n:
    temp += 1
if (temp + 1) * (temp + 2) // 2 < n:
    temp += 1
if (temp + 1) * (temp + 2) // 2 < n:
    temp += 1
print(temp + (n - temp - 1) * 2 + 1)

Compilation message (stdout)

Compiling 'oddeven.py'...

=======
  adding: __main__.pyc (deflated 35%)

=======
#Verdict Execution timeMemoryGrader output
Fetching results...