제출 #890766

#제출 시각아이디문제언어결과실행 시간메모리
890766Sir_Ahmed_ImranMiners (IOI07_miners)C++17
45 / 100
1226 ms1116 KiB
///~~~LOTA~~~/// #include <bits/stdc++.h> using namespace std; #define nl '\n' #define ff first #define ss second #define ll long long #define append push_back #define all(x) (x).begin(),(x).end() int pwr[21]; void solve(){ string a; int n,m,o,p,q,r; cin>>n>>a; for(int i=pwr[0]=1;i<21;i++) pwr[i]=pwr[i-1]*2; set<char> s; for(int i=o=0;i<pwr[n];i++){ vector<char> x,y; for(int j=r=0;j<n;j++){ if(i&pwr[j]){ m=x.size(); x.append(a[j]); for(int k=m;k>=max(m-2,0);k--) s.insert(x[k]); r+=s.size(); s.clear(); } else{ m=y.size(); y.append(a[j]); for(int k=m;k>=max(m-2,0);k--) s.insert(y[k]); r+=s.size(); s.clear(); } } o=max(o,r); } cout<<o; } int main(){ ios_base::sync_with_stdio(false);cin.tie(NULL); solve(); return 0; }

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

miners.cpp: In function 'void solve()':
miners.cpp:13:15: warning: unused variable 'p' [-Wunused-variable]
   13 |     int n,m,o,p,q,r;
      |               ^
miners.cpp:13:17: warning: unused variable 'q' [-Wunused-variable]
   13 |     int n,m,o,p,q,r;
      |                 ^
#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...