# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1120187 | vjudge1 | Palindrome-Free Numbers (BOI13_numbers) | C++17 | 1099 ms | 512 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();
int f = 1;
if (2 <= n) {
f = S[1] != S[0];
}
for (int j = 2; j < n; j ++) {
f &= (S[j] != S[j - 1] && S[j] != S[j - 2]);
}
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... |