結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
32,528 KB
testcase_01 AC 44 ms
32,596 KB
testcase_02 AC 43 ms
32,528 KB
testcase_03 AC 54 ms
32,656 KB
testcase_04 AC 41 ms
32,528 KB
testcase_05 AC 41 ms
32,404 KB
testcase_06 AC 40 ms
32,656 KB
testcase_07 AC 40 ms
32,276 KB
testcase_08 AC 41 ms
32,400 KB
testcase_09 AC 41 ms
32,528 KB
testcase_10 AC 43 ms
32,528 KB
testcase_11 AC 41 ms
32,528 KB
testcase_12 AC 41 ms
32,656 KB
testcase_13 AC 41 ms
32,532 KB
testcase_14 AC 40 ms
32,656 KB
testcase_15 AC 41 ms
32,528 KB
testcase_16 AC 43 ms
32,528 KB
testcase_17 AC 41 ms
32,652 KB
testcase_18 AC 41 ms
32,400 KB
testcase_19 AC 128 ms
32,660 KB
testcase_20 AC 429 ms
34,748 KB
testcase_21 AC 42 ms
32,660 KB
testcase_22 AC 41 ms
32,404 KB
testcase_23 AC 42 ms
32,528 KB
testcase_24 AC 42 ms
32,788 KB
testcase_25 AC 730 ms
38,592 KB
testcase_26 AC 41 ms
32,528 KB
testcase_27 AC 42 ms
32,532 KB
testcase_28 AC 41 ms
32,528 KB
testcase_29 AC 41 ms
32,532 KB
testcase_30 AC 41 ms
32,528 KB
testcase_31 AC 41 ms
32,528 KB
testcase_32 AC 353 ms
34,488 KB
testcase_33 TLE -
testcase_34 TLE -
testcase_35 AC 658 ms
38,460 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) {
    $primes[] = (int)gmp_strval($prime);
    $prime = (int)gmp_strval($prime);
    $sum = gmp_add($sum, $len+1 - ($prime*$num));
}
echo gmp_strval($sum);
echo PHP_EOL;
0