# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
445813 | Jasiekstrz | Bajka (COCI20_bajka) | C++17 | 101 ms | 656 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define fi first
#define se second
using namespace std;
const int INF=1e9+7;
const int N=300;
int dp[N+10][N+10];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n,m;
cin>>n>>m;
string s,t;
cin>>s>>t;
for(int i=1;i<=n;i++)
dp[0][i]=-1;
for(int j=1;j<=m;j++)
{
dp[j][0]=dp[j][n+1]=INF;
for(int i=1;i<=n;i++)
{
dp[j][i]=INF;
if(s[i-1]==t[j-1])
dp[j][i]=min(dp[j-1][i-1],dp[j-1][i+1])+1;
}
for(int i=1;i<=n;i++)
{
for(int k=1;k<=n;k++)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |