# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
77224 | farukkastamonuda | 새로운 문제 (POI11_roz) | C++14 | 717 ms | 25936 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define li 1000005
#define fi first
#define se second
#define mp make_pair
using namespace std;
int n,c,c2,ans;
char s[li],ch;
vector< pair<int,int> > v[35];
pair<int,int> sw[li];
int main(){
scanf("%d",&n);
//scanf("%s",s+1);
for(int i=1;i<=n;i++){
scanf(" %c",&ch);
v[ch-'a'].push_back(mp(i,ch-'a'));
}
for(int i=0;i<26;i++){
for(int j=0;j<26;j++){
merge(v[i].begin(),v[i].end(),v[j].begin(),v[j].end(),sw);
int gh=(int)v[i].size()+(int)v[j].size();
c2=-(1<<30);c=0;
for(int k=0;k<gh;k++){
if(sw[k].se==i){
c++;
c2++;
}
else{
c2=c-1;
c--;
c=max(0,c);
}
ans=max(ans,c2);
}
}
}
printf("%d\n",ans);
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... |
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |