Submission #18427

#TimeUsernameProblemLanguageResultExecution timeMemory
18427mindol구간 성분 (KOI15_interval)C++14
61 / 100
665 ms131072 KiB
#include<iostream> #include<set> #include<algorithm> #include<vector> #include<string> using namespace std; string A,B; set<vector<int>> S; int main() { cin>>A>>B; for(int i=0;i<A.size();i++) { vector<int> p(26,0); for(int j=i;j<A.size();j++) { p[A[j]-'a']++; S.insert(p); } } int ans=0; for(int i=0;i<B.size();i++) { vector<int> p(26,0); for(int j=i;j<B.size();j++) { p[B[j]-'a']++; auto it=S.find(p); if(it!=S.end()) ans=max(ans,j-i+1); } } cout<<ans; 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...