# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
18430 |
2016-02-01T13:29:50 Z |
mindol |
구간 성분 (KOI15_interval) |
C++14 |
|
531 ms |
1856 KB |
#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=min(A.size(),B.size());i>=1;i--)
{
S.clear();
vector<int> p(26,0);
for(int j=0;j<i;j++)
p[A[j]-'a']++;
S.insert(p);
for(int j=i;j<A.size();j++)
{
p[A[j-i]-'a']--;
p[A[j]-'a']++;
S.insert(p);
}
vector<int> q(26,0);
for(int j=0;j<i;j++)
q[B[j]-'a']++;
if(S.find(q)!=S.end()){ cout<<i; return 0; }
for(int j=i;j<B.size();j++)
{
q[B[j-i]-'a']--;
q[B[j]-'a']++;
if(S.find(q)!=S.end()){ cout<<i; return 0; }
}
}
cout<<0;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1724 KB |
Output is correct |
2 |
Correct |
0 ms |
1724 KB |
Output is correct |
3 |
Correct |
0 ms |
1724 KB |
Output is correct |
4 |
Correct |
2 ms |
1724 KB |
Output is correct |
5 |
Correct |
0 ms |
1724 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
38 ms |
1724 KB |
Output is correct |
2 |
Correct |
30 ms |
1724 KB |
Output is correct |
3 |
Correct |
0 ms |
1724 KB |
Output is correct |
4 |
Correct |
0 ms |
1724 KB |
Output is correct |
5 |
Correct |
52 ms |
1724 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
217 ms |
1856 KB |
Output is correct |
2 |
Correct |
236 ms |
1856 KB |
Output is correct |
3 |
Correct |
225 ms |
1856 KB |
Output is correct |
4 |
Correct |
219 ms |
1856 KB |
Output is correct |
5 |
Correct |
228 ms |
1856 KB |
Output is correct |
6 |
Correct |
222 ms |
1856 KB |
Output is correct |
7 |
Correct |
225 ms |
1856 KB |
Output is correct |
8 |
Correct |
221 ms |
1856 KB |
Output is correct |
9 |
Correct |
230 ms |
1856 KB |
Output is correct |
10 |
Correct |
228 ms |
1856 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
36 ms |
1724 KB |
Output is correct |
2 |
Correct |
438 ms |
1856 KB |
Output is correct |
3 |
Correct |
377 ms |
1856 KB |
Output is correct |
4 |
Correct |
14 ms |
1724 KB |
Output is correct |
5 |
Correct |
531 ms |
1856 KB |
Output is correct |