結果

問題 No.276 連続する整数の和(1)
ユーザー 🍡yurahuna🍡yurahuna
提出日時 2015-12-20 16:55:43
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 203 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 7,084 KB
実行使用メモリ 8,220 KB
最終ジャッジ日時 2023-10-17 14:30:43
合計ジャッジ時間 6,286 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
8,220 KB
testcase_01 AC 24 ms
8,220 KB
testcase_02 AC 24 ms
8,220 KB
testcase_03 TLE -
testcase_04 TLE -
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#N = 4なら
#4k,4k+1,4k+2,4k+3 
#余りについて1+2+3=6
#gcd(4, 6) = 2で割り切れる
#つまり答えはgcd(N, sum(xrange(N)))

from fractions import gcd

N = input()
print gcd(N, sum(xrange(N)))
0