結果

問題 No.276 連続する整数の和(1)
ユーザー 👑 yumechiyumechi
提出日時 2015-10-24 09:52:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 1,000 ms
コード長 188 bytes
コンパイル時間 426 ms
コンパイル使用メモリ 10,748 KB
実行使用メモリ 7,956 KB
最終ジャッジ日時 2023-10-11 05:34:59
合計ジャッジ時間 955 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,804 KB
testcase_01 AC 16 ms
7,820 KB
testcase_02 AC 15 ms
7,788 KB
testcase_03 AC 16 ms
7,856 KB
testcase_04 AC 15 ms
7,924 KB
testcase_05 AC 15 ms
7,924 KB
testcase_06 AC 16 ms
7,792 KB
testcase_07 AC 15 ms
7,956 KB
testcase_08 AC 16 ms
7,928 KB
testcase_09 AC 16 ms
7,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def gcd(x, y):
    if x < y:
        x, y = y, x
    while y > 0:
        r = x % y
        x = y
        y = r
    return x

n = int(input())
n1, n2 = n, n * (n-1) // 2
print(gcd(n1, n2))
0