# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
321012 | 2020-11-10T15:57:05 Z | tjdgus4384 | 구간 성분 (KOI15_interval) | C++14 | 377 ms | 740 KB |
#include<bits/stdc++.h> using namespace std; string s1, s2; vector<int> v(30, 0), t(30, 0); set<vector<int> > s; int main(){ cin >> s1 >> s2; for(int i = s1.size();i > 0;i--){ if(i > s2.size()) continue; for(int j = 0;j < i;j++){ v[s1[j]-'a']++; } s.insert(v); for(int j = i;j < s1.size();j++){ v[s1[j-i]-'a']--; v[s1[j]-'a']++; s.insert(v); } for(int j = 0;j < 30;j++) v[j] = 0; for(int j = 0;j < i;j++){ t[s2[j]-'a']++; } if(s.count(t)){ printf("%d", i); return 0; } for(int j = i;j < s2.size();j++){ t[s2[j-i]-'a']--; t[s2[j]-'a']++; if(s.count(t)){ printf("%d", i); return 0; } } for(int j = 0;j < 30;j++) t[j] = 0; s.clear(); } printf("0"); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Correct | 1 ms | 364 KB | Output is correct |
3 | Correct | 0 ms | 364 KB | Output is correct |
4 | Correct | 2 ms | 364 KB | Output is correct |
5 | Correct | 2 ms | 364 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 29 ms | 364 KB | Output is correct |
2 | Correct | 24 ms | 484 KB | Output is correct |
3 | Correct | 1 ms | 364 KB | Output is correct |
4 | Correct | 0 ms | 364 KB | Output is correct |
5 | Correct | 38 ms | 364 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 158 ms | 484 KB | Output is correct |
2 | Correct | 173 ms | 484 KB | Output is correct |
3 | Correct | 173 ms | 612 KB | Output is correct |
4 | Correct | 161 ms | 484 KB | Output is correct |
5 | Correct | 171 ms | 484 KB | Output is correct |
6 | Correct | 166 ms | 484 KB | Output is correct |
7 | Correct | 166 ms | 488 KB | Output is correct |
8 | Correct | 158 ms | 484 KB | Output is correct |
9 | Correct | 170 ms | 480 KB | Output is correct |
10 | Correct | 167 ms | 612 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 29 ms | 364 KB | Output is correct |
2 | Correct | 325 ms | 740 KB | Output is correct |
3 | Correct | 282 ms | 484 KB | Output is correct |
4 | Correct | 13 ms | 492 KB | Output is correct |
5 | Correct | 377 ms | 740 KB | Output is correct |