This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define N 100005
#define MOD 1000000007
#define endl '\n'
#define all(x) x.begin(), x.end()
typedef long long int ll;
const ll inf = 1e17;
void solve()
{
ll a, b; cin >> a >> b;
ll cnt = 0;
for(ll i = b; i >= a; --i)
{
bool ok = true;
string s = to_string(i);
int k = s.size();
for(int l = 0; l < k - 1; ++l)
{
for(int r = l + 1; r < k; ++r)
{
string t = "";
for(int j = l; j <= r; ++j) t += s[j];
string tt = t;
reverse(all(tt));
ok &= (tt != t);
}
}
cnt += (ok ? 1 : 0);
}
cout << cnt;
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
//ll t; cin >> t;
//while(t--)
solve();
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |