結果
| 問題 | 
                            No.211 素数サイコロと合成数サイコロ (1)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2016-07-27 16:02:44 | 
| 言語 | PHP  (843.2)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 42 ms / 1,000 ms | 
| コード長 | 464 bytes | 
| コンパイル時間 | 2,664 ms | 
| コンパイル使用メモリ | 30,724 KB | 
| 実行使用メモリ | 31,608 KB | 
| 最終ジャッジ日時 | 2024-06-25 23:03:23 | 
| 合計ジャッジ時間 | 5,053 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 33 | 
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
<?php
$primeDice = [2,3,5,7,11,13];
$nonPrimeDice = [4,6,8,9,10,12];
$expect = [];
foreach($primeDice as $prime) {
    foreach($nonPrimeDice as $nonPrime) {
        $idx = $prime * $nonPrime;
        if(!isset($expect[$idx])) {
            $expect[$idx] = 1;
        } else {
            $expect[$idx]++;
        }
    }
}
$num = trim(fgets(STDIN));
if(isset($expect[$num])) {
    printf("%.13f", $expect[$num]/36);
} else {
    printf("%.13f", 0);
}
echo PHP_EOL;