Submission #523348

#TimeUsernameProblemLanguageResultExecution timeMemory
523348PetyOdd-even (IZhO11_oddeven)Cpython 3
100 / 100
20 ms2836 KiB
# Online Python - IDE, Editor, Compiler, Interpreter N = int(input()) st = 1; dr = pow(10, 50); ans = 0; while st <= dr: mij = (st + dr) // 2 if mij * (mij+1) // 2 >= N: ans = mij; dr = mij - 1; else: st = mij + 1; if ans % 2 == 1: print(2 * (N - ans // 2 - 1) + 1) else: print(2 * (N - ans // 2));
#Verdict Execution timeMemoryGrader output
Fetching results...