結果
問題 |
No.11 カードマッチ
|
ユーザー |
|
提出日時 | 2022-12-17 15:05:05 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,082 bytes |
コンパイル時間 | 803 ms |
コンパイル使用メモリ | 110,264 KB |
実行使用メモリ | 107,216 KB |
最終ジャッジ日時 | 2024-11-16 23:26:11 |
合計ジャッジ時間 | 25,165 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 RE * 10 TLE * 4 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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); } } }