# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1120768 | vjudge1 | Palindrome-Free Numbers (BOI13_numbers) | C++14 | 1099 ms | 508 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;
main() {
int A, B;
cin >> A >> B;
int ans = 0;
for (int i = A; i <= B; i ++) {
string S = to_string(i);
int n = S.size();
if (2 <= n && S[1] == S[0]) {
continue;
}
int f = 1;
for (int j = 2; j < n; j ++) {
if (S[j] == S[j - 1] || S[j] == S[j - 2]) {
f = 0;
break;
}
}
if (f) {
ans ++;
}
}
cout << ans << endl;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |