結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー NoNo
提出日時 2015-06-07 09:24:50
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 72 ms / 1,000 ms
コード長 1,434 bytes
コンパイル時間 4,514 ms
コンパイル使用メモリ 109,912 KB
実行使用メモリ 23,976 KB
最終ジャッジ日時 2023-09-08 05:13:55
合計ジャッジ時間 6,194 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
23,912 KB
testcase_01 AC 68 ms
23,800 KB
testcase_02 AC 72 ms
23,976 KB
testcase_03 AC 70 ms
23,976 KB
testcase_04 AC 69 ms
23,736 KB
testcase_05 AC 69 ms
23,900 KB
testcase_06 AC 65 ms
23,816 KB
testcase_07 AC 66 ms
23,748 KB
testcase_08 AC 69 ms
23,796 KB
testcase_09 AC 66 ms
21,844 KB
testcase_10 AC 67 ms
21,812 KB
testcase_11 AC 69 ms
23,724 KB
testcase_12 AC 66 ms
23,964 KB
testcase_13 AC 66 ms
23,916 KB
testcase_14 AC 67 ms
23,920 KB
testcase_15 AC 66 ms
21,864 KB
testcase_16 AC 66 ms
21,788 KB
testcase_17 AC 70 ms
23,732 KB
testcase_18 AC 70 ms
23,764 KB
testcase_19 AC 68 ms
23,976 KB
testcase_20 AC 67 ms
21,888 KB
testcase_21 AC 66 ms
21,972 KB
testcase_22 AC 67 ms
21,776 KB
testcase_23 AC 66 ms
21,800 KB
testcase_24 AC 66 ms
23,836 KB
testcase_25 AC 66 ms
21,888 KB
testcase_26 AC 66 ms
21,948 KB
testcase_27 AC 66 ms
21,984 KB
testcase_28 AC 66 ms
21,972 KB
testcase_29 AC 66 ms
21,892 KB
testcase_30 AC 66 ms
21,976 KB
testcase_31 AC 66 ms
21,880 KB
testcase_32 AC 66 ms
21,868 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace foryuki
{
    class Program
    {
        static void Main(string[] args)
        {
            int K = int.Parse(Console.ReadLine());
            int[] s = new int[] { 2, 3, 5, 7, 11, 13 };
            int[] g = new int[] { 4, 6, 8, 9, 10, 12 };
            int[] seki = new int[36];
            int index = 0;

            for (int i = 0; i < s.Length; i++)
            {
                for (int j = 0; j < g.Length; j++)
                {
                    seki[index] = s[i] * g[j];
                    index++;
                }
            }

            double ans = 0;
            var a = seki.Where(x => x == K).Select(x => seki);
            foreach (var item in a)
            {
                ans = a.Count();
            }
         
            Console.WriteLine(string.Format("{0:f16}", ans/36));
        }

        //-------------------------------------------------------------

        private int[] ConvertStringArrayToIntArray(string[] str, int defaultValue)
        {
            int[] b = Array.ConvertAll<string, int>(str, delegate(string value)
                {
                    return int.Parse(value);
                });

            for (int i = 0; i < b.Length; i++)
            {
                b[i] = defaultValue;
            }
            return b;
        }
    }
}
0