# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
992660 | ezzzay | Miners (IOI07_miners) | C++14 | 1567 ms | 788 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
const int N=3e5+5;
signed main(){
int n;
string s;
int mx=0;
cin>>n>>s;
for(int i=0;i<(1<<n);i++){
int h=0,u=0;
int k=0;
vector<char>v1,v2;
for(int j=0;j<n;j++){
if(i&(1<<j)){
v1.pb(s[j]);
set<char>st;
st.insert(v1.back());
if(v1.size()>1){
st.insert(v1[v1.size()-2]);
}
if(v1.size()>2){
st.insert(v1[v1.size()-3]);
}
k+=st.size();
}
else{
v2.pb(s[j]);
set<char>st;
st.insert(v2.back());
if(v2.size()>1){
st.insert(v2[v2.size()-2]);
}
if(v2.size()>2){
st.insert(v2[v2.size()-3]);
}
k+=st.size();
}
}
mx=max(mx,k);
}
cout<<mx;
}
Compilation message (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |