# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
584138 | Olympia | Palindrome-Free Numbers (BOI13_numbers) | C++17 | 1095 ms | 320 KiB |
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() {
int64_t a, b;
cin >> a >> b;
int ans = 0;
for (int i = a; i <= b; i++) {
string s = to_string(i);
bool fine = true;
for (int j = 0; j < s.length(); j++) {
if (j >= 1 && s[j] == s[j - 1]) {
fine = false;
}
if (j >= 2 && s[j] == s[j - 2]) {
fine = false;
}
}
ans += fine;
}
cout << ans << '\n';
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |