結果

問題 No.11 カードマッチ
ユーザー pirorirori_n712pirorirori_n712
提出日時 2018-10-30 01:32:16
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 30 ms / 5,000 ms
コード長 637 bytes
コンパイル時間 948 ms
コンパイル使用メモリ 106,624 KB
実行使用メモリ 20,352 KB
最終ジャッジ日時 2024-04-30 00:21:58
合計ジャッジ時間 2,352 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
19,968 KB
testcase_01 AC 26 ms
20,096 KB
testcase_02 AC 28 ms
20,096 KB
testcase_03 AC 27 ms
20,096 KB
testcase_04 AC 28 ms
20,224 KB
testcase_05 AC 27 ms
19,968 KB
testcase_06 AC 28 ms
20,224 KB
testcase_07 AC 29 ms
20,096 KB
testcase_08 AC 28 ms
20,224 KB
testcase_09 AC 28 ms
20,352 KB
testcase_10 AC 30 ms
20,096 KB
testcase_11 AC 28 ms
19,968 KB
testcase_12 AC 27 ms
20,224 KB
testcase_13 AC 27 ms
20,096 KB
testcase_14 AC 27 ms
20,096 KB
testcase_15 AC 27 ms
20,096 KB
testcase_16 AC 27 ms
20,224 KB
testcase_17 AC 27 ms
20,096 KB
testcase_18 AC 28 ms
19,968 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Linq;
using System.Collections.Generic;

class No11{
    static void Main(){
        var W = Int64.Parse(Console.ReadLine());
        var H = Int64.Parse(Console.ReadLine());
        var N = Int64.Parse(Console.ReadLine());
        var wHashSet = new HashSet<long>();
        var hHashSet = new HashSet<long>();
        for(int i=0;i<N;++i){
            var line=Console.ReadLine().Split(' ').Select(x=>Int64.Parse(x)).ToArray();
            wHashSet.Add(line[0]);
            hHashSet.Add(line[1]);
        }
        var c=(W-wHashSet.Count())*(H-hHashSet.Count());
        Console.WriteLine(W*H-c-N);
    }
}
0