Submission #1120187

# Submission time Handle Problem Language Result Execution time Memory
1120187 2024-11-28T06:27:32 Z vjudge1 Palindrome-Free Numbers (BOI13_numbers) C++17
54.1667 / 100
1000 ms 512 KB
#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

numbers.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main() {
      | ^~~~
# Verdict Execution time Memory 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 3 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 512 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 336 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 4 ms 336 KB Output is correct
15 Correct 3 ms 336 KB Output is correct
16 Correct 1 ms 336 KB Output is correct
17 Correct 2 ms 336 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 4 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 194 ms 336 KB Output is correct
2 Incorrect 1 ms 336 KB Output isn't correct
3 Incorrect 1 ms 504 KB Output isn't correct
4 Incorrect 1 ms 336 KB Output isn't correct
5 Execution timed out 1077 ms 336 KB Time limit exceeded
6 Execution timed out 1085 ms 336 KB Time limit exceeded
7 Correct 85 ms 336 KB Output is correct
8 Correct 64 ms 420 KB Output is correct
9 Correct 98 ms 348 KB Output is correct
10 Correct 168 ms 436 KB Output is correct
11 Correct 190 ms 420 KB Output is correct
12 Execution timed out 1010 ms 424 KB Time limit exceeded
13 Correct 212 ms 416 KB Output is correct
14 Execution timed out 1099 ms 336 KB Time limit exceeded
15 Execution timed out 1058 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 2 ms 336 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 504 KB Output is correct
23 Incorrect 1 ms 336 KB Output isn't correct
24 Correct 1 ms 504 KB Output is correct
25 Incorrect 1 ms 336 KB Output isn't correct
26 Incorrect 1 ms 336 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 336 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 336 KB Output isn't correct
37 Incorrect 1 ms 336 KB Output isn't correct
38 Incorrect 1 ms 336 KB Output isn't correct
39 Incorrect 1 ms 336 KB Output isn't correct
40 Correct 1 ms 336 KB Output is correct
41 Incorrect 1 ms 504 KB Output isn't correct
42 Correct 1 ms 432 KB Output is correct
43 Incorrect 1 ms 508 KB Output isn't correct
44 Incorrect 1 ms 352 KB Output isn't correct
45 Incorrect 1 ms 348 KB Output isn't correct