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