結果

問題 No.412 花火大会
ユーザー mbanmban
提出日時 2016-09-25 20:11:57
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 1,316 bytes
コンパイル時間 4,720 ms
コンパイル使用メモリ 104,448 KB
実行使用メモリ 23,928 KB
最終ジャッジ日時 2023-08-11 18:47:24
合計ジャッジ時間 5,520 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
21,836 KB
testcase_01 AC 63 ms
21,836 KB
testcase_02 AC 62 ms
21,832 KB
testcase_03 AC 63 ms
23,812 KB
testcase_04 AC 64 ms
21,792 KB
testcase_05 AC 63 ms
22,032 KB
testcase_06 AC 63 ms
23,916 KB
testcase_07 AC 63 ms
21,768 KB
testcase_08 AC 68 ms
23,760 KB
testcase_09 AC 61 ms
19,736 KB
testcase_10 AC 63 ms
21,896 KB
testcase_11 AC 63 ms
21,784 KB
testcase_12 AC 63 ms
21,792 KB
testcase_13 AC 62 ms
21,964 KB
testcase_14 AC 62 ms
21,964 KB
testcase_15 AC 63 ms
21,992 KB
testcase_16 AC 66 ms
23,892 KB
testcase_17 AC 64 ms
21,720 KB
testcase_18 AC 64 ms
21,828 KB
testcase_19 AC 64 ms
21,884 KB
testcase_20 AC 63 ms
21,924 KB
testcase_21 AC 63 ms
23,928 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;


class Magatro {
    static int[] BCD;
    static int N;
    static int[] E;
    static void Read() {
        BCD = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
        Array.Sort(BCD);

        N = int.Parse(Console.ReadLine());
        E = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
        Array.Sort(E);
    }
    static void Main() {
        Read();
        int[,] dp = new int[31, 4];
        for (int i = 0; i <= N; i++) {
            for(int j = 0; j <= 3; j++) {
                if (i == 0 && j == 0) {
                    
                    dp[i, j] = 1;
                    continue;
                }
                if (i == 0) {
                    dp[i, j] = 0;
                    continue;
                }
                if (j == 0) {
                    dp[i, j] = dp[i - 1, j] * 2;
                    continue;
                }
                if (E[i - 1] >= BCD[j - 1]) {
                    dp[i, j] = dp[i - 1, j - 1] + dp[i - 1, j] ;
                    continue;
                }
                else {
                    dp[i, j] = dp[i - 1, j] * 2;
                    continue;
                }
            }
        }
        Console.WriteLine(dp[N, 3]);
    }

}
0