結果

問題 No.276 連続する整数の和(1)
ユーザー gorugo30gorugo30
提出日時 2021-03-18 09:54:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 1,000 ms
コード長 121 bytes
コンパイル時間 306 ms
コンパイル使用メモリ 82,172 KB
実行使用メモリ 52,984 KB
最終ジャッジ日時 2024-04-28 01:02:45
合計ジャッジ時間 1,047 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
52,068 KB
testcase_01 AC 32 ms
52,824 KB
testcase_02 AC 32 ms
52,540 KB
testcase_03 AC 35 ms
52,680 KB
testcase_04 AC 40 ms
52,984 KB
testcase_05 AC 32 ms
52,272 KB
testcase_06 AC 30 ms
51,812 KB
testcase_07 AC 31 ms
52,668 KB
testcase_08 AC 30 ms
52,484 KB
testcase_09 AC 28 ms
51,796 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