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