# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
337970 | amunduzbaev | Odd-even (IZhO11_oddeven) | Cpython 3 | 2033 ms | 2796 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
n = int(input())
sz = 1
last = 1
prev = 0
i = 2
while (sz < n):
prev = last
last += (i*2)-1
sz += i
i+=1
if(sz == n):
print(last % 10)
else :
while(sz > n and prev < last):
last -= 2
sz -= 1
print(last)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |