結果
| 問題 | No.225 文字列変更(medium) |
| コンテスト | |
| ユーザー |
konsin_tokage
|
| 提出日時 | 2018-03-28 10:35:14 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 317 bytes |
| 記録 | |
| コンパイル時間 | 417 ms |
| コンパイル使用メモリ | 20,820 KB |
| 実行使用メモリ | 46,556 KB |
| 最終ジャッジ日時 | 2026-03-11 21:39:28 |
| 合計ジャッジ時間 | 9,415 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 WA * 5 |
ソースコード
n, m = map(int, input().split())
s = input()
t = input()
dp = [[1001]*(m+1) for _ in range(n+1)]
dp[0][0] = 0
for i in range(1, n+1):
for j in range(1, m+1):
dp[i][j] = min(
int(s[i-1]!=t[j-1]) + dp[i-1][j-1],
1 + dp[i-1][j],
1 + dp[i][j-1])
print(dp[n][m])
konsin_tokage