Submission #966232

#TimeUsernameProblemLanguageResultExecution timeMemory
9662323laaPalindrome-Free Numbers (BOI13_numbers)C++14
36.67 / 100
1077 ms600 KiB
//freopen(".in","r",stdin);freopen(".out","w",stdout);
#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#include <bits/stdc++.h>
#include <unordered_map>
#define endl '\n'
#define mid ((l+r)/2)
#define  F first
#define  S second
#define pb push_back
#define yes void (cout<<"YES"<<endl)
#define no void (cout<<"NO"<<endl)
#define ump unordered_map <ll,ll>
#define sp " "
#define vll vector<ll>
#define vint vector<int>
#define vp vector<pll>
#define pll pair<ll,ll>
#define mem(x,val) memset(x,val,sizeof(x))
typedef long double ld;
typedef long long ll;
using namespace std;
const ll inf=2e18+9;
const ll M=1e9+7;
ll a,b,ans;
int main(){
    fast;
    cin>>a>>b;
    for(ll i=a ; i<=b  ;i++){
        string s=to_string(i);
        ll n=s.size(),gg=1;
        s+="*?";
        for(ll i=0 ; i<n ;i++)
            if(s[i]==s[i+1]||s[i]==s[i+2])
                 gg=0;
        ans+=gg;
    }
    cout<<ans<<endl;

}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...