제출 #992660

#제출 시각아이디문제언어결과실행 시간메모리
992660ezzzayMiners (IOI07_miners)C++14
45 / 100
1567 ms788 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++){ 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; }

컴파일 시 표준 에러 (stderr) 메시지

miners.cpp: In function 'int main()':
miners.cpp:13:13: warning: unused variable 'h' [-Wunused-variable]
   13 |         int h=0,u=0;
      |             ^
miners.cpp:13:17: warning: unused variable 'u' [-Wunused-variable]
   13 |         int h=0,u=0;
      |                 ^
#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...