답안 #676516

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
676516 2022-12-31T06:02:55 Z QwertyPi 홀-짝 수열 (IZhO11_oddeven) C++14
컴파일 오류
0 ms 0 KB
from math import sqrt
n = int(input())

def isqrt(n):
    x = n
    y = (x + 1) // 2
    while y < x:
        x = y
        y = (x + n // x) // 2
    return x


x = isqrt(n * 2)

while x * (x - 1) // 2 >= n:
    x -= 1
while x * (x + 1) // 2 < n:
    x += 1
print(n * 2 - x)

Compilation message

oddeven.cpp:1:1: error: 'from' does not name a type
    1 | from math import sqrt
      | ^~~~