結果
| 問題 | No.11 カードマッチ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-10-04 17:24:59 |
| 言語 | D (dmd 2.112.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 523 bytes |
| 記録 | |
| コンパイル時間 | 4,476 ms |
| コンパイル使用メモリ | 211,200 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-03 17:20:31 |
| 合計ジャッジ時間 | 10,371 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
コンパイルメッセージ
/home/linuxbrew/.linuxbrew/opt/dmd/include/dlang/dmd/core/checkedint.d(814): Warning: cannot inline function `core.checkedint.mulu!().mulu`
ulong mulu()(ulong x, uint y, ref bool overflow)
^
ソースコード
module main;
import std;
void main()
{
// 入力
auto W = readln.chomp.to!long;
auto H = readln.chomp.to!long;
auto N = readln.chomp.to!int;
auto S = new long[](N), K = new long[](N);
auto sSet = new RedBlackTree!long(), kSet = new RedBlackTree!long();
foreach (ref s, ref k; lockstep(S, K)) {
readln.chomp.formattedRead("%d %d", s, k);
sSet.insert(s);
kSet.insert(k);
}
// 答えの計算
long ans = sSet.length * H + kSet.length * W - sSet.length * kSet.length - N;
// 答えの出力
writeln(ans);
}