結果
| 問題 |
No.11 カードマッチ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-07-30 23:54:51 |
| 言語 | Nim (2.2.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 644 bytes |
| コンパイル時間 | 846 ms |
| コンパイル使用メモリ | 69,692 KB |
| 最終ジャッジ日時 | 2024-11-14 20:10:46 |
| 合計ジャッジ時間 | 1,235 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 50) Warning: Use the new 'sugar' module instead; future is deprecated [Deprecated] /home/judge/data/code/Main.nim(1, 62) Error: cannot open file: queues
ソースコード
import sequtils,strutils,strscans,algorithm,math,future,sets,queues,tables
template get():string = stdin.readLine()
template times(n:int,body:untyped): untyped = (for _ in 0..<n: body)
let
W = get().parseInt
H = get().parseInt
N = get().parseInt
var
cards = newSeq[tuple[x:int,y:int]](0)
res = 0
w_left = W
h_left = H
N.times:
var x,y = 0
(x,y) = get().split().map(parseInt)
let
x_new = cards.allIt(it.x != x)
y_new = cards.allIt(it.y != y)
if not (x_new and y_new): res -= 1 # 被り
if x_new: w_left -= 1
if y_new: h_left -= 1
if x_new: res += h_left
if y_new: res += w_left
cards.add((x,y))
echo res