結果
| 問題 | No.11 カードマッチ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-08-27 20:05:28 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 542 bytes |
| 記録 | |
| コンパイル時間 | 771 ms |
| コンパイル使用メモリ | 116,536 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-12 03:46:27 |
| 合計ジャッジ時間 | 1,277 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 WA * 6 |
ソースコード
import std.algorithm, std.array, std.container, std.range;
import std.string, std.conv, std.math;
import std.stdio, std.typecons;
alias Tuple!(int, "s", int, "k") card;
void main()
{
auto w = readln.chomp.to!int;
auto h = readln.chomp.to!int;
auto n = readln.chomp.to!int;
auto ci = iota(n).map!((i) {
auto rd = readln.split.map!(to!int);
return card(rd[0], rd[1]);
}).array;
auto s = ci.map!(c => c.s).uniq.array.length;
auto k = ci.map!(c => c.k).uniq.array.length;
writeln(w * k + s * h - s * k - ci.length);
}