結果
| 問題 |
No.11 カードマッチ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-12-17 14:42:35 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,057 bytes |
| コンパイル時間 | 5,755 ms |
| コンパイル使用メモリ | 103,168 KB |
| 実行使用メモリ | 101,888 KB |
| 最終ジャッジ日時 | 2024-11-16 23:13:51 |
| 合計ジャッジ時間 | 25,766 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
int[,] card;
w = int.Parse(Console.ReadLine());
h = int.Parse(Console.ReadLine());
n = int.Parse(Console.ReadLine());
card = new int[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] = 2;
else if (card[a, b] != 2)
{
if (a == s && b != k)
card[a, b] = 1;
else if (a != s && b == k)
card[a, b] = 1;
}
}
}
}
for (int a = 0; a < w; a++)
for (int b = 0; b < h; b++)
if (card[a, b] == 1)
sum += card[a, b];
Console.WriteLine(sum);
}
}
}