#include <bits/stdc++.h>
using namespace std;
#define int long long
long long cnt = 0;
signed main(){
long long a, b;
cin >> a >> b;
int cnt = 0;
for(int k = a; k <= b; k++){
string s = to_string(k);
bool ok = true, yes = false;
for(int i = 0; i < s.size() - 1; i++){
ok = true;
for(int j = i + 1; j < s.size(); j++){
ok = true;
for(int a = i; a <= j; a++){
if(s[a] != s[i + j - a]){
ok = false;
break;
}
}
if(ok){
yes = true;
break;
}
//else cnt++;
}
if(yes) break;
}
if(!yes) cnt++;
}
cout << cnt << endl;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |