BOJ - 14723 - 이산수학 과제

Updated:

def solution():
    N = int(input())

    cnt = 0
    for idx in range(1, N+1):
        for jdx in range(1, idx+1):
            A = idx-jdx + 1
            B = jdx
            cnt += 1
            if cnt == N:
                print(A, B)
                return

solution()

https://www.acmicpc.net/problem/14723

Categories:

Updated:

Leave a comment