// author - alimammadzade
#include <bits/stdc++.h>
using namespace std;
int free(int i) {
string s = to_string(i);
for (int i = 0; i < (int)s.size() - 1; i++)
for (int j = i + 1; j < (int)s.size(); j++) {
string a = s.substr(i, j - i + 1), b = a;
reverse(b.begin(), b.end());
if (a == b) return 0;
}
return 1;
}
signed main() {
cin.tie(nullptr)->sync_with_stdio(false);
// system("cls"), freopen("in.txt", "r", stdin);
int a, b, res = 0;
cin >> a >> b;
for (int i = a; i <= b; i++) res += free(i);
cout << res;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
3 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
4 |
Correct |
15 ms |
336 KB |
Output is correct |
5 |
Correct |
1 ms |
336 KB |
Output is correct |
6 |
Correct |
1 ms |
336 KB |
Output is correct |
7 |
Correct |
1 ms |
336 KB |
Output is correct |
8 |
Correct |
1 ms |
336 KB |
Output is correct |
9 |
Correct |
1 ms |
336 KB |
Output is correct |
10 |
Correct |
1 ms |
336 KB |
Output is correct |
11 |
Correct |
1 ms |
336 KB |
Output is correct |
12 |
Correct |
1 ms |
384 KB |
Output is correct |
13 |
Correct |
1 ms |
336 KB |
Output is correct |
14 |
Correct |
18 ms |
456 KB |
Output is correct |
15 |
Correct |
20 ms |
336 KB |
Output is correct |
16 |
Correct |
2 ms |
336 KB |
Output is correct |
17 |
Correct |
9 ms |
512 KB |
Output is correct |
18 |
Correct |
1 ms |
336 KB |
Output is correct |
19 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
20 |
Correct |
14 ms |
336 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1058 ms |
336 KB |
Time limit exceeded |
2 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
5 |
Execution timed out |
1063 ms |
336 KB |
Time limit exceeded |
6 |
Execution timed out |
1045 ms |
336 KB |
Time limit exceeded |
7 |
Correct |
911 ms |
508 KB |
Output is correct |
8 |
Correct |
526 ms |
336 KB |
Output is correct |
9 |
Execution timed out |
1027 ms |
336 KB |
Time limit exceeded |
10 |
Execution timed out |
1065 ms |
336 KB |
Time limit exceeded |
11 |
Execution timed out |
1043 ms |
336 KB |
Time limit exceeded |
12 |
Execution timed out |
1056 ms |
336 KB |
Time limit exceeded |
13 |
Execution timed out |
1061 ms |
336 KB |
Time limit exceeded |
14 |
Execution timed out |
1054 ms |
336 KB |
Time limit exceeded |
15 |
Execution timed out |
1057 ms |
336 KB |
Time limit exceeded |
16 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
17 |
Correct |
1 ms |
336 KB |
Output is correct |
18 |
Correct |
1 ms |
336 KB |
Output is correct |
19 |
Correct |
1 ms |
592 KB |
Output is correct |
20 |
Correct |
1 ms |
336 KB |
Output is correct |
21 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
22 |
Correct |
1 ms |
336 KB |
Output is correct |
23 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
24 |
Correct |
1 ms |
336 KB |
Output is correct |
25 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
26 |
Incorrect |
1 ms |
356 KB |
Output isn't correct |
27 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
28 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
29 |
Correct |
1 ms |
336 KB |
Output is correct |
30 |
Correct |
1 ms |
336 KB |
Output is correct |
31 |
Incorrect |
1 ms |
508 KB |
Output isn't correct |
32 |
Correct |
1 ms |
336 KB |
Output is correct |
33 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
34 |
Correct |
1 ms |
336 KB |
Output is correct |
35 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
36 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
37 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
38 |
Incorrect |
1 ms |
460 KB |
Output isn't correct |
39 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
40 |
Correct |
1 ms |
340 KB |
Output is correct |
41 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
42 |
Correct |
1 ms |
336 KB |
Output is correct |
43 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
44 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
45 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |