結果
| 問題 | No.225 文字列変更(medium) |
| コンテスト | |
| ユーザー |
konsin_tokage
|
| 提出日時 | 2018-03-28 10:35:14 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 317 bytes |
| 記録 | |
| コンパイル時間 | 288 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 44,928 KB |
| 最終ジャッジ日時 | 2024-06-25 13:05:25 |
| 合計ジャッジ時間 | 15,951 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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