結果
問題 |
No.11 カードマッチ
|
ユーザー |
|
提出日時 | 2023-07-27 09:46:53 |
言語 | C# (.NET 8.0.404) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,098 bytes |
コンパイル時間 | 11,107 ms |
コンパイル使用メモリ | 166,856 KB |
実行使用メモリ | 564,808 KB |
最終ジャッジ日時 | 2024-10-04 02:32:44 |
合計ジャッジ時間 | 16,513 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 8 RE * 10 MLE * 1 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (84 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using System; using System.Collections.Generic; using System.Linq; namespace yukicoder { public class Program { public static void Main() { var h = int.Parse(Console.ReadLine()); var w = int.Parse(Console.ReadLine()); var n = int.Parse(Console.ReadLine()); var s = new bool[h, w, 2]; long sum = 0; for (var i = 0; i < n; i++){ var a = Console.ReadLine().Split(' ').Select(value => int.Parse(value) - 1).ToArray(); for(var j = 0; j < w; j++) { if (!s[a[0], j, 1]) { s[a[0], j, 0] = true; } } for(var j = 0; j < h; j++) { if (!s[j, a[1], 1]) { s[j, a[1], 0] = true; } } s[a[0], a[1], 1] = true; s[a[0], a[1], 0] = false; } for(var i = 0; i < h; i++) { for(var j = 0; j < w; j++) { if (s[i, j, 0]) { sum++; } } } Console.WriteLine(sum); } } }