#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int int_fast32_t
#define ll int_fast64_t
#define dll long double
#define ull uint_fast64_t
#define spektar this_thread::sleep_for(chrono::milliseconds(1000))
void solve(){
ll a,b;
cin >> a >> b;
int ss=0;
for(ll i=a; i<=b; i++){
string s=to_string(i);
bool ka=true;
for(int j=0; j<s.size(); j++){
int jj=j;
deque<char> s1;
deque<char> s2;
while(jj<s.size() && jj<=2+j){
s1.push_back(s[jj]);
s2.push_front(s[jj]);
jj++;
if(s1.size()>=2 && s1==s2){
ka=false;
break;
}
}
if(!ka) break;
}
if(ka) ss++;
}
cout << ss << endl;
}
signed main(){
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int t=1;
//cin >> t;
while(t--){
solve();
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |