2 solutions

  • 1
    @ 2025-10-29 17:23:41

    #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
    126
    Accepted
    19
    Uploaded By