#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
long long a, b;
if(!(cin >> a >> b)) return 0;
long long ans = 0;
while(a <= b){
bool add = true;
long long k = a;
int q = -1, qp = -1, qpp = -1;
while(k > 0){
qpp = qp;
qp = q;
q = int(k % 10);
if(q == qpp || q == qp){
add = false;
break;
}
k /= 10;
}
ans += add;
a++;
}
cout << ans << '\n';
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |