結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー CroweaCrowea
提出日時 2019-01-26 10:57:00
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 68 ms / 1,000 ms
コード長 650 bytes
コンパイル時間 1,838 ms
コンパイル使用メモリ 65,308 KB
実行使用メモリ 25,692 KB
最終ジャッジ日時 2023-10-14 09:57:30
合計ジャッジ時間 5,180 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
23,396 KB
testcase_01 AC 62 ms
21,392 KB
testcase_02 AC 67 ms
23,220 KB
testcase_03 AC 67 ms
23,592 KB
testcase_04 AC 67 ms
23,332 KB
testcase_05 AC 68 ms
23,356 KB
testcase_06 AC 63 ms
21,644 KB
testcase_07 AC 64 ms
21,428 KB
testcase_08 AC 67 ms
25,692 KB
testcase_09 AC 62 ms
21,432 KB
testcase_10 AC 63 ms
21,328 KB
testcase_11 AC 67 ms
23,320 KB
testcase_12 AC 63 ms
21,468 KB
testcase_13 AC 62 ms
21,408 KB
testcase_14 AC 62 ms
21,440 KB
testcase_15 AC 64 ms
21,636 KB
testcase_16 AC 63 ms
21,428 KB
testcase_17 AC 67 ms
23,332 KB
testcase_18 AC 68 ms
25,376 KB
testcase_19 AC 64 ms
21,376 KB
testcase_20 AC 63 ms
21,384 KB
testcase_21 AC 63 ms
21,308 KB
testcase_22 AC 62 ms
21,588 KB
testcase_23 AC 64 ms
23,460 KB
testcase_24 AC 63 ms
21,480 KB
testcase_25 AC 63 ms
23,672 KB
testcase_26 AC 63 ms
23,496 KB
testcase_27 AC 63 ms
23,448 KB
testcase_28 AC 63 ms
21,428 KB
testcase_29 AC 63 ms
21,432 KB
testcase_30 AC 63 ms
21,444 KB
testcase_31 AC 62 ms
19,384 KB
testcase_32 AC 63 ms
21,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;

class Program
{     
    static void Main(string[] args)
    {
        var primes = new List<int> { 2, 3, 5, 7, 11, 13 };
        var composite = new List<int> { 4, 6, 8, 9, 10, 12 };
        var combination = new List<int>(36);

        for (int i = 0; i < primes.Count(); i++)
            for (int j = 0; j < composite.Count(); j++)
                combination.Add(primes[i] * composite[j]);

        var K = int.Parse(Console.ReadLine());
        var cnt_K = combination.Count(item => item == K);
        Console.WriteLine("{0}", ((double)cnt_K / combination.Count()));
    }
}

0