# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1120687 | vjudge1 | Palindrome-Free Numbers (BOI13_numbers) | C++17 | 1094 ms | 588 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 <stdint.h>
#include <stdio.h>
#include <string.h>
int a, b, ans = 0, n;
char str[20] = {'0'};
size_t i, j, k, d, e;
void toString(char str[], int n) {
if (n == 0) {
str[0] = '0';
return;
}
for (i = 0; n > 0; i++) {
str[i] = '0' + n % 10;
n /= 10;
}
str[i + 1] = '\0';
}
int main() {
scanf("%d%d", &a, &b);
for (n = a; n <= b; n++) {
toString(str, n);
for (i = 0; i < strlen(str); i++) {
for (j = 2; j <= strlen(str) - i; j++) {
e = j / 2;
d = i + e + j % 2;
for (k = i; k < d; k++) {
if (str[k] != str[i + i + e + j - k - 2]) {
break;
}
if (k == d - 1) {
goto next;
}
}
}
}
ans++;
next:
continue;
}
printf("%d\n", ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |