# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
51644 | okaybody10 | 구간 성분 (KOI15_interval) | C++98 | 1091 ms | 171900 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
#include <set>
#include <string.h>
#pragma GCC optimize(Ofast)
using namespace std;
typedef vector<int> vi;
set<vi> gg;
int main()
{
char s1[1605],s2[1605];
scanf("%s %s",s1,s2);
int l1=strlen(s1),l2=strlen(s2);
for(int i=l1;i>0;i--)
{
vi alpha(26);
int s=0,e=i-1;
for(int j=s;j<=e;j++) alpha[s1[j]-'a']++;
while(e<l1)
{
gg.insert(alpha);
if(++e<l1) alpha[s1[e]-'a']++,alpha[s1[s++]-'a']--;
}
}
for(int i=l2;i>0;i--)
{
vi alpha(26);
int s=0,e=i-1;
for(int j=s;j<=e;j++) alpha[s2[j]-'a']++;
while(e<l2)
{
if(gg.find(alpha) != gg.end()) { return !printf("%d",i);}
if(++e<l2) alpha[s2[e]-'a']++,alpha[s2[s++]-'a']--;
}
}
printf("0");
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |