結果
| 問題 | No.3427 Erasing a Subsequence |
| コンテスト | |
| ユーザー |
kidodesu
|
| 提出日時 | 2025-12-29 18:34:55 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 273 ms / 2,000 ms |
| + 165µs | |
| コード長 | 458 bytes |
| 記録 | |
| コンパイル時間 | 86 ms |
| コンパイル使用メモリ | 64,456 KB |
| 実行使用メモリ | 102,848 KB |
| 最終ジャッジ日時 | 2026-10-23 04:25:52 |
| 合計ジャッジ時間 | 3,020 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 |
ソースコード
n, m = map(int, input().split())
S = list(map(int, input().split()))
T = list(map(int, input().split()))
dp = [-1] * (m+1)
dp[0] = []
for y in range(n):
ndp = [-1] * (m+1)
for x in range(m+1):
if dp[x] == -1:
break
if ndp[x] != -1:
ndp[x] = min(ndp[x], dp[x]+[S[y]])
else:
ndp[x] = dp[x]+[S[y]]
if x < m and S[y] == T[x]:
ndp[x+1] = dp[x][:]
dp = ndp
print(*dp[-1])
kidodesu