이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |