Submission #890769

#TimeUsernameProblemLanguageResultExecution timeMemory
890769Sir_Ahmed_ImranMiners (IOI07_miners)C++17
45 / 100
1559 ms860 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[20]; void solve(){ string a; int n,m,o,p,q,r; cin>>n>>a; for(int i=pwr[0]=1;i<20;i++) pwr[i]=pwr[i-1]*2; set<char> s; for(int i=o=0;i<pwr[n-1];i++){ vector<char> x,y; x.append(a[0]); for(int j=r=1;j<n;j++){ if(i&pwr[j-1]){ 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; }

Compilation message (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...