結果

問題 No.278 連続する整数の和(2)
ユーザー cielciel
提出日時 2015-09-04 23:13:33
言語 Ruby
(3.3.0)
結果
AC  
実行時間 200 ms / 2,000 ms
コード長 100 bytes
コンパイル時間 246 ms
コンパイル使用メモリ 11,520 KB
実行使用メモリ 15,568 KB
最終ジャッジ日時 2023-08-24 22:36:33
合計ジャッジ時間 3,622 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
15,196 KB
testcase_01 AC 88 ms
15,052 KB
testcase_02 AC 200 ms
15,568 KB
testcase_03 AC 89 ms
15,152 KB
testcase_04 AC 88 ms
15,300 KB
testcase_05 AC 89 ms
15,292 KB
testcase_06 AC 89 ms
15,128 KB
testcase_07 AC 88 ms
15,292 KB
testcase_08 AC 89 ms
15,068 KB
testcase_09 AC 91 ms
15,376 KB
testcase_10 AC 91 ms
15,172 KB
testcase_11 AC 103 ms
15,248 KB
testcase_12 AC 90 ms
15,328 KB
testcase_13 AC 163 ms
15,312 KB
testcase_14 AC 98 ms
15,488 KB
testcase_15 AC 133 ms
15,352 KB
testcase_16 AC 102 ms
15,348 KB
testcase_17 AC 98 ms
15,392 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require'prime';n=gets.to_i;p (n.gcd n*~-n/2).prime_division.reduce(1){|s,(n,p)|s*(n**(p+1)-1)/(n-1)}
0