結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー mbanmban
提出日時 2017-01-13 11:02:17
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 67 ms / 5,000 ms
コード長 1,622 bytes
コンパイル時間 2,263 ms
コンパイル使用メモリ 105,132 KB
実行使用メモリ 25,868 KB
最終ジャッジ日時 2023-08-23 09:58:05
合計ジャッジ時間 3,830 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
23,796 KB
testcase_01 AC 64 ms
25,868 KB
testcase_02 AC 66 ms
23,488 KB
testcase_03 AC 66 ms
23,596 KB
testcase_04 AC 67 ms
23,976 KB
testcase_05 AC 66 ms
23,692 KB
testcase_06 AC 66 ms
23,676 KB
testcase_07 AC 66 ms
23,756 KB
testcase_08 AC 67 ms
25,728 KB
testcase_09 AC 66 ms
23,832 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;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;

class Program
{
    static private Magatro M = new Magatro();
    static private void Main(string[]args)
    {
        M.Scan();
        M.Solve();
    }
}

public class Scanner
{
    private string[] S;
    private int Index;
    private char Separator;

    public Scanner(char separator = ' ')
    {
        Index = 0;
        Separator = separator;
        S = new string[0];
    }

    private string[] Line()
    {
        return Console.ReadLine().Split(Separator);
    }

    public string Next()
    {
        string result;
        if (Index >= S.Length)
        {
            S = Line();
            Index = 0;
        }
        result = S[Index];
        Index++;
        return result;
    }
    public int NextInt()
    {
        return int.Parse(Next());
    }
    public double NextDouble()
    {
        return double.Parse(Next());
    }
    public long NextLong()
    {
        return long.Parse(Next());
    }
}

public class Magatro
{
    private int P, C;
    readonly int[] Prime = new int[] { 2, 3, 5, 7, 11, 13 };
    readonly int[] Non = new int[] { 4, 6, 8, 9, 10, 12 };

    public void Scan()
    {
        Scanner sc = new Scanner();
        P = sc.NextInt();
        C = sc.NextInt();
    }

    public void Solve()
    {
        double ans = 1;
        ans *= Math.Pow((double)Prime.Sum()/6,P);
        ans *= Math.Pow((double)Non.Sum()/6,C);
        Console.WriteLine(ans);
    }

}
0