結果

問題 No.278 連続する整数の和(2)
ユーザー mmmpppmmmppp
提出日時 2017-03-07 14:57:09
言語 Ruby
(3.2.2)
結果
AC  
実行時間 201 ms / 2,000 ms
コード長 98 bytes
コンパイル時間 61 ms
コンパイル使用メモリ 11,224 KB
実行使用メモリ 15,532 KB
最終ジャッジ日時 2023-08-24 22:48:46
合計ジャッジ時間 2,898 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
15,164 KB
testcase_01 AC 92 ms
15,200 KB
testcase_02 AC 201 ms
15,532 KB
testcase_03 AC 89 ms
15,204 KB
testcase_04 AC 96 ms
15,140 KB
testcase_05 AC 91 ms
15,296 KB
testcase_06 AC 89 ms
15,096 KB
testcase_07 AC 90 ms
15,136 KB
testcase_08 AC 89 ms
15,344 KB
testcase_09 AC 91 ms
15,180 KB
testcase_10 AC 91 ms
15,144 KB
testcase_11 AC 103 ms
15,396 KB
testcase_12 AC 90 ms
15,148 KB
testcase_13 AC 165 ms
15,420 KB
testcase_14 AC 98 ms
15,288 KB
testcase_15 AC 132 ms
15,392 KB
testcase_16 AC 101 ms
15,332 KB
testcase_17 AC 97 ms
15,332 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require'prime'
n=gets.to_i
p (n&1<1?n/2:n).prime_division.map{|a,b|(a**(b+1)-1)/a-=1}.reduce(1,:*)
0