Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
256322 刘明樾 *小美的字符串匹配度 C++ 通过 100 672 MS 276 KB 438 2024-04-17 21:18:34

Tests(5/5):


#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int maxx=-1; int sum=0; string s,t; getline(cin,s); getline(cin,s); getline(cin,t); for(int i=0;i<n;i++) for(int j=0;j<n;j++) { swap(t[i],t[j]); for(int l=0;l<n;l++) { if((char)s[l]==(char)t[l]) { sum++; } } if(sum>maxx) { maxx=sum; } swap(t[i],t[j]); sum=0; } cout<<maxx; return 0; }


测评信息: