結果

問題 No.11 カードマッチ
ユーザー HimatsubushinHimatsubushin
提出日時 2022-12-17 15:05:05
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 1,082 bytes
コンパイル時間 4,268 ms
コンパイル使用メモリ 104,120 KB
実行使用メモリ 50,544 KB
最終ジャッジ日時 2023-08-10 16:17:56
合計ジャッジ時間 9,813 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
20,748 KB
testcase_01 AC 54 ms
22,656 KB
testcase_02 AC 55 ms
18,612 KB
testcase_03 AC 54 ms
20,596 KB
testcase_04 RE -
testcase_05 AC 56 ms
20,552 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace No011
{
  class Program
  {
    static void Main(string[] args)
    {
      long w, h, n, s, k;
      int sum = 0;
      char[,] card;

      w = int.Parse(Console.ReadLine());
      h = int.Parse(Console.ReadLine());
      n = int.Parse(Console.ReadLine());

      card = new char[w, h];

      for (int i = 0; i < n; i++)
      {
        string[] input = Console.ReadLine().Split(' ');
        s = int.Parse(input[0]) - 1;
        k = int.Parse(input[1]) - 1;
        for (int a = 0; a < w; a++)
        {
          for (int b = 0; b < h; b++)
          {
            if (a == s && b == k)
              card[a, b] = (char)2;
            else if (card[a, b] != 2)
            {
              if (a == s && b != k)
                card[a, b] = (char)1;
              else if (a != s && b == k)
                card[a, b] = (char)1;
            }
          }
        }
      }

      for (int a = 0; a < w; a++)
        for (int b = 0; b < h; b++)
          if (card[a, b] == 1)
            sum += (int)card[a, b];

      Console.WriteLine(sum);
    }
  }
}
0