Submission #18429

#TimeUsernameProblemLanguageResultExecution timeMemory
18429mindol구간 성분 (KOI15_interval)C++14
61 / 100
1000 ms125932 KiB
#include<iostream> #include<set> #include<algorithm> #include<vector> #include<string> using namespace std; string A,B; set<vector<short>> S; int main() { cin>>A>>B; for(int i=0;i<A.size();i++) { vector<short> 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<short> 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...