1 solutions

  • 1
    @ 2022-4-6 20:22:24
    #include<bits/stdc++.h>
    using namespace std;
    typedef long long ll;
    ll fun(ll x){
        ll cnt=0;
        while(x){
         ll tmp=x%10;
         if(tmp==2)cnt++;
         x/=10;
        }
        return cnt;
    }
    int main(){
        ll ans=2;
        for(int i=13;i<=2020;i++)ans+=fun(i);
        cout<<ans;
        return 0;
    }
    • 1

    Information

    ID
    6478
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    2
    Tags
    # Submissions
    40
    Accepted
    33
    Uploaded By