| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1346926 | novemnotes | Round words (IZhO13_rowords) | C++20 | 6 ms | 5700 KiB |
#include <bits/stdc++.h>
using namespace std;
string a,b;
int main(){
ios_base::sync_with_stdio(false);cin.tie(NULL);
getline(cin,a);
getline(cin,b);
sort(a.begin(),a.end());
sort(b.begin(),b.end());
int n = a.size();
int m = b.size();
vector<vector<int>> dp(n+1,vector<int>(m+1,0));
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
if(a[i-1]==b[j-1])dp[i][j]=dp[i-1][j-1]+1;
else dp[i][j]=max({dp[i-1][j],dp[i][j-1],dp[i-1][j-1]});
}
}
cout << dp[n][m] << "\n";
return 0;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
