Submission #992658

#TimeUsernameProblemLanguageResultExecution timeMemory
992658ezzzayMiners (IOI07_miners)C++14
0 / 100
1597 ms604 KiB
#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++){ set<int>st1,st2; int k=0; for(int j=0;j<n;j++){ if(i&(1<<j)){ st1.insert(s[j]); k+=st1.size(); if(st1.size()==3)st1.clear(); } else{ st2.insert(s[j]); k+=st2.size(); if(st2.size()==3)st2.clear(); } } mx=max(mx,k); } cout<<mx; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...