結果
問題 | No.11 カードマッチ |
ユーザー |
|
提出日時 | 2016-08-27 20:13:12 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 570 bytes |
コンパイル時間 | 726 ms |
コンパイル使用メモリ | 120,152 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-12 03:46:37 |
合計ジャッジ時間 | 1,347 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 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(w * k + s * h - s * k - ci.length);}