結果

問題 No.276 連続する整数の和(1)
ユーザー けむけむけむけむ
提出日時 2021-07-23 00:48:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 442 bytes
コンパイル時間 431 ms
コンパイル使用メモリ 10,948 KB
実行使用メモリ 8,120 KB
最終ジャッジ日時 2023-09-24 21:40:17
合計ジャッジ時間 1,113 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,920 KB
testcase_01 AC 17 ms
8,088 KB
testcase_02 AC 16 ms
7,964 KB
testcase_03 AC 17 ms
7,920 KB
testcase_04 AC 17 ms
7,884 KB
testcase_05 AC 18 ms
7,872 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 17 ms
7,868 KB
testcase_09 AC 17 ms
7,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

def seisuwa(N):
    M = (N / 2) * (N - 1)
    M = int(M)
    Nl = []
    for i in range(1, int(math.sqrt(N)) + 1):
        if N % i == 0:
            Nl.append(i)
            Nl.append(N // i)
    Nl = sorted(Nl)
    for j in range(1, len(Nl) + 1):
        if M % Nl[-j] == 0:
            ans = Nl[-j]
            break
    return ans

def main():
    N = int(input())
    print(seisuwa(N))

if __name__ == '__main__':
    main()
0