2 solutions
-
0
Guest MOD
-
0
#include <bits/stdc++.h> using namespace std; char s[20]; int main(){ cin>>(s+1); int n=strlen(s+1); int ans=100; for(int sta=1;sta<(1<<n);sta++){ int tmp=0,cnt=0; for(int i=n-1;i>=0;i--){ int flag=(sta>>i)&1; if(flag0) tmp++; else cnt+=s[i+1]-'0'; } if(cnt%30) ans=min(ans,tmp); } if(ans==100) cout<<"dottle bot"; else cout<<ans; return 0; }
Information
- ID
- 183
- Time
- 1000ms
- Memory
- 512MiB
- Difficulty
- 8
- Tags
- (None)
- # Submissions
- 125
- Accepted
- 18
- Uploaded By