結果
問題 | No.606 カラフルタイル |
ユーザー |
![]() |
提出日時 | 2021-02-05 00:23:58 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 162 ms / 2,000 ms |
コード長 | 608 bytes |
コンパイル時間 | 173 ms |
コンパイル使用メモリ | 82,108 KB |
実行使用メモリ | 104,576 KB |
最終ジャッジ日時 | 2024-07-01 05:24:28 |
合計ジャッジ時間 | 4,348 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
ソースコード
import sysinput = sys.stdin.readlinesys.setrecursionlimit(10 ** 7)N, K, Q = map(int, input().split())query = list(input().rstrip().split() for _ in range(Q))seen_r = [0] * Nseen_c = [0] * Nrest_r = Nrest_c = Nans = [0] * Kfor a, b, c in query[::-1]:b = int(b) - 1c = int(c) - 1if a == "R":if seen_r[b]:continueans[c] += rest_rseen_r[b] = 1rest_c -= 1else:if seen_c[b]:continueans[c] += rest_cseen_c[b] = 1rest_r -= 1ans[0] += (N - sum(seen_r)) * rest_rprint(*ans, sep="\n")