結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー mondo
提出日時 2019-07-31 16:39:45
言語 PHP
(843.2)
結果
AC  
実行時間 37 ms / 1,000 ms
コード長 313 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 32,404 KB
実行使用メモリ 31,472 KB
最終ジャッジ日時 2024-07-05 06:29:33
合計ジャッジ時間 2,058 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$ans = trim(fgets(STDIN));
$sosu = [2,3,5,7,11,13];
$gosu = [4,6,8,9,10,12];
$count =0;
for ($i = 0; $i < count($sosu); $i++) {
     for ($j = 0; $j < count($gosu); $j++) {
          if (($sosu[$i] * $gosu[$j]) == $ans){
              $count++;
        } 
    }
}
echo $count / (count($sosu)* count($gosu));
0