이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |