結果
問題 | No.276 連続する整数の和(1) |
ユーザー |
![]() |
提出日時 | 2020-12-01 14:33:12 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 40 ms / 1,000 ms |
コード長 | 430 bytes |
コンパイル時間 | 282 ms |
コンパイル使用メモリ | 82,512 KB |
実行使用メモリ | 58,648 KB |
最終ジャッジ日時 | 2024-09-13 02:58:40 |
合計ジャッジ時間 | 1,153 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
def make_divisors(n):lower_divisors , upper_divisors = [], []i = 1while i*i <= n:if n % i == 0:lower_divisors.append(i)if i != n // i:upper_divisors.append(n//i)i += 1return 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()