結果

問題 No.276 連続する整数の和(1)
ユーザー gorugo30gorugo30
提出日時 2021-03-18 09:54:33
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 71 ms / 1,000 ms
コード長 121 bytes
コンパイル時間 1,386 ms
コンパイル使用メモリ 86,884 KB
実行使用メモリ 71,468 KB
最終ジャッジ日時 2023-08-10 07:26:57
合計ジャッジ時間 1,815 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,264 KB
testcase_01 AC 70 ms
71,168 KB
testcase_02 AC 70 ms
71,112 KB
testcase_03 AC 70 ms
71,216 KB
testcase_04 AC 70 ms
71,364 KB
testcase_05 AC 70 ms
71,252 KB
testcase_06 AC 68 ms
71,152 KB
testcase_07 AC 67 ms
71,364 KB
testcase_08 AC 67 ms
71,468 KB
testcase_09 AC 66 ms
71,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)

N = int(input())
print(gcd(N, N * (N - 1) // 2))
0