Submission #18059

#TimeUsernameProblemLanguageResultExecution timeMemory
18059chan492811구간 성분 (KOI15_interval)C++98
30 / 100
553 ms131072 KiB
#include <cstdio> #include <cstring> #include <algorithm> #include <vector> #include <map> using namespace std; int n,m,res; char arr1[1510],arr2[1510]; vector<int> vt(26); map <vector <int> ,bool> mp; void vector_init(){ int i; for(i=0;i<26;i++) vt[i]=0; } int main(){ int i,j; scanf("%s %s",arr1,arr2); n=strlen(arr1); m=strlen(arr2); for(i=0;i<n;i++){ for(j=i;j<n;j++){ vt[arr1[j]-'a']++; mp[vt]=1; } vector_init(); } for(i=0;i<m;i++){ for(j=i;j<m;j++){ vt[arr2[j]-'a']++; if(mp[vt]==1) res=max(res,j-i+1); } vector_init(); } printf("%d",res); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...