| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1360811 | ozner77 | Palindrome-Free Numbers (BOI13_numbers) | Pypy 3 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
bool palin(string s){
for(int i=0;i<s.size();i++){
if(i>0){
if(s[i]==s[i-1]){
return true;
}
}
if(i>1){
if(s[i]==s[i-2]){
return true;
}
}
}
return false;
}
int main(){
ll a,b;
cin>>a>>b;
ll res=0;
for(int i=a;i<=b;i++){
if(palin(to_string(i))){
res++;
}
}
cout<<b-a+1-res;
}