結果

問題 No.276 連続する整数の和(1)
ユーザー maspymaspy
提出日時 2022-04-25 01:48:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 20 ms / 1,000 ms
コード長 293 bytes
コンパイル時間 113 ms
コンパイル使用メモリ 10,636 KB
実行使用メモリ 8,776 KB
最終ジャッジ日時 2023-09-09 03:52:32
合計ジャッジ時間 1,451 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
8,712 KB
testcase_01 AC 20 ms
8,628 KB
testcase_02 AC 19 ms
8,772 KB
testcase_03 AC 20 ms
8,776 KB
testcase_04 AC 19 ms
8,648 KB
testcase_05 AC 20 ms
8,724 KB
testcase_06 AC 20 ms
8,716 KB
testcase_07 AC 20 ms
8,656 KB
testcase_08 AC 20 ms
8,656 KB
testcase_09 AC 20 ms
8,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from math import gcd
from functools import reduce

N = int(read())

def f(x):
    return (x+x+N-1) * N // 2

A = [f(x) for x in range(10)]
answer = reduce(gcd, A)
print(answer)
0