제출 #609770

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
6097702022-07-27 21:39:09DanerZeinMatch (CEOI16_match)C++14
37 / 100
2093 ms12768 KiB
#include <bits/stdc++.h>
using namespace std;
const int MAX_N=1e5+10;
int n;
string x;
string ans;
int rabc[MAX_N][30];
int maxr(int l,int r){
rabc[r][x[r]-'a']=r;
if(rabc[r][x[l]-'a']!=-1) return rabc[r][x[l]-'a'];
stack<int> st;
st.push(r);
for(int j=r-1;j>=l;j--){
if(st.empty() || x[st.top()]!=x[j]){
st.push(j);
}
else{
int i=st.top();
st.pop();
if(st.empty()){
if(rabc[r][x[j]-'a']==-1) rabc[r][x[j]-'a']=i;
if(rabc[r][x[l]-'a']!=-1)
break;
}
}
}
return rabc[r][x[l]-'a'];
}
void match(int l,int r){
if(l>=r){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...