結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー papinianuspapinianus
提出日時 2016-08-31 23:32:30
言語 PHP
(8.3.4)
結果
TLE  
実行時間 -
コード長 307 bytes
コンパイル時間 2,072 ms
コンパイル使用メモリ 30,732 KB
実行使用メモリ 31,420 KB
最終ジャッジ日時 2024-04-26 22:08:47
合計ジャッジ時間 7,489 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
31,196 KB
testcase_01 AC 35 ms
31,164 KB
testcase_02 AC 35 ms
31,084 KB
testcase_03 AC 44 ms
31,100 KB
testcase_04 AC 39 ms
31,024 KB
testcase_05 AC 35 ms
31,148 KB
testcase_06 AC 34 ms
31,128 KB
testcase_07 AC 40 ms
31,012 KB
testcase_08 AC 40 ms
30,948 KB
testcase_09 AC 40 ms
30,944 KB
testcase_10 AC 39 ms
31,144 KB
testcase_11 AC 41 ms
31,212 KB
testcase_12 AC 40 ms
31,180 KB
testcase_13 AC 40 ms
31,264 KB
testcase_14 AC 40 ms
31,216 KB
testcase_15 AC 40 ms
31,064 KB
testcase_16 AC 38 ms
31,420 KB
testcase_17 AC 40 ms
30,788 KB
testcase_18 AC 41 ms
31,040 KB
testcase_19 AC 118 ms
31,112 KB
testcase_20 AC 391 ms
31,044 KB
testcase_21 AC 40 ms
31,140 KB
testcase_22 AC 41 ms
31,156 KB
testcase_23 AC 40 ms
31,080 KB
testcase_24 AC 39 ms
30,952 KB
testcase_25 AC 669 ms
31,108 KB
testcase_26 AC 40 ms
30,912 KB
testcase_27 AC 40 ms
31,240 KB
testcase_28 AC 40 ms
30,960 KB
testcase_29 AC 40 ms
31,232 KB
testcase_30 AC 41 ms
31,276 KB
testcase_31 AC 40 ms
31,100 KB
testcase_32 AC 321 ms
31,200 KB
testcase_33 TLE -
testcase_34 TLE -
testcase_35 AC 618 ms
31,216 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
list($num, $len) = explode(" ", trim(fgets(STDIN)));
$num--;
$sum = gmp_init("0");
$max = (int)floor($len/$num);
$prime = 1;
while(($prime = gmp_nextprime($prime)) <= $max) {
    $prime = (int)gmp_strval($prime);
    $sum = gmp_add($sum, $len+1 - ($prime*$num));
}
echo gmp_strval($sum);
echo PHP_EOL;
0