| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 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;
}