結果

問題 No.276 連続する整数の和(1)
ユーザー urutomurutom
提出日時 2019-04-13 16:05:25
言語 Ruby
(3.3.0)
結果
AC  
実行時間 314 ms / 1,000 ms
コード長 98 bytes
コンパイル時間 39 ms
コンパイル使用メモリ 11,520 KB
実行使用メモリ 15,328 KB
最終ジャッジ日時 2023-10-13 14:22:30
合計ジャッジ時間 3,929 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 275 ms
15,088 KB
testcase_01 AC 283 ms
15,072 KB
testcase_02 AC 275 ms
15,276 KB
testcase_03 AC 296 ms
15,128 KB
testcase_04 AC 298 ms
15,020 KB
testcase_05 AC 314 ms
15,044 KB
testcase_06 AC 303 ms
15,328 KB
testcase_07 AC 305 ms
15,308 KB
testcase_08 AC 287 ms
15,120 KB
testcase_09 AC 276 ms
15,020 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
gcd=sum=n*(n+1)/2
1.upto(1000000){|i|
  sum+=n+i
  sum-=i
  gcd=gcd.gcd sum
}
puts gcd
0