結果

問題 No.11 カードマッチ
ユーザー kmtrc130kmtrc130
提出日時 2017-06-08 10:01:34
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,008 bytes
コンパイル時間 999 ms
コンパイル使用メモリ 109,240 KB
実行使用メモリ 81,476 KB
最終ジャッジ日時 2023-10-23 19:43:45
合計ジャッジ時間 3,584 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
25,092 KB
testcase_01 AC 26 ms
25,092 KB
testcase_02 AC 27 ms
25,092 KB
testcase_03 AC 27 ms
25,092 KB
testcase_04 WA -
testcase_05 AC 26 ms
25,092 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 Program
{
    static void Main()
    {
        int W = int.Parse(Console.ReadLine());  // トランプのマークの種類
        int H = int.Parse(Console.ReadLine());  // トランプの数値の最大
        int N = int.Parse(Console.ReadLine());  // 手元の枚数

        List<int>[] SK = new List<int>[W + 1];
        for (int i = 0; i < W + 1; i++) { SK[i] = new List<int>(); }

        string[] tmp = new string[2];
        for (int i = 0; i < N; i++)
        {
            tmp = Console.ReadLine().Split(' ');
            SK[int.Parse(tmp[0])].Add(int.Parse(tmp[1]));
        }

        decimal ansCnt = 0;
        int cnt = 0;
        int maxCnt = 0;
        for (int i = 1; i <= W; i++)
        {
            cnt = SK[i].Count();
            if (maxCnt < cnt) { maxCnt = cnt; }
            if (0 < cnt) { ansCnt += H - cnt; }
            else { ansCnt += maxCnt; }
        }
        Console.WriteLine(ansCnt);
    }
}
0