結果

問題 No.276 連続する整数の和(1)
ユーザー H20H20
提出日時 2020-12-01 14:33:12
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 87 ms / 1,000 ms
コード長 430 bytes
コンパイル時間 590 ms
使用メモリ 80,048 KB
最終ジャッジ日時 2023-02-24 18:31:24
合計ジャッジ時間 2,465 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 82 ms
75,392 KB
testcase_01 AC 81 ms
75,644 KB
testcase_02 AC 82 ms
75,380 KB
testcase_03 AC 86 ms
79,956 KB
testcase_04 AC 85 ms
80,004 KB
testcase_05 AC 86 ms
79,956 KB
testcase_06 AC 87 ms
80,032 KB
testcase_07 AC 85 ms
79,932 KB
testcase_08 AC 86 ms
80,048 KB
testcase_09 AC 82 ms
75,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
N = int(input())
L = make_divisors(N)
for i in reversed(range(len(L))):
    if (N*(N-1)//2)%L[i]==0:
        print(L[i])
        exit()

0