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;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int a, b, ans = 0;
cin >> a >> b;
for (int i = a; i <= b; i++) {
string str = to_string(i);
char ok = true;
for (size_t i = 0; i < str.size(); i++) {
for (size_t j = 2; j <= str.size() - i; j++) {
size_t e = j / 2;
size_t s1_size = i + e + j % 2;
for (size_t k = i; k < s1_size; k++) {
if (str[k] != str[i + i + e + j - k - 2]) {
break;
}
if (k == s1_size - 1) {
ok = false;
}
}
if (!ok) {
break;
}
}
if (!ok) {
break;
}
}
if (ok) {
ans++;
}
}
cout << ans << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |