結果

問題 No.11 カードマッチ
コンテスト
ユーザー diginatu
提出日時 2014-11-24 01:35:11
言語 D
(dmd 2.112.0)
コンパイル:
dmd -fPIE -m64 -w -wi -O -release -inline -I/opt/dmd/src/druntime/import/ -I/opt/dmd/src/phobos -L-L/opt/dmd/linux/lib64/ -fPIC _filename_
実行:
./Main
結果
WA  
実行時間 -
コード長 571 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 646 ms
コンパイル使用メモリ 95,204 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2026-03-05 05:48:25
合計ジャッジ時間 1,546 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import std.stdio, std.string, std.conv
	,std.array,std.algorithm, std.range
	,std.math;

void main(){
	auto W = readln().strip().to!long;
	auto H = readln().strip().to!long;
	auto N = readln().strip().to!int;

	int[] S = new int[](N);
	int[] K = new int[](N);

	foreach(int i; 0 .. N) {
		auto buf = readln().strip().split().map!(to!int)();
		S[i] = buf[0];
		K[i] = buf[1];
	}

	S.sort();
	K.sort();

	immutable int sw = S.uniq().array().length.to!int;
	immutable int kw = K.uniq().array().length.to!int;

	writeln( H*W - (H-sw)*(W-kw) - N);
}
0