답안 #860024

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
860024 2023-10-11T11:35:25 Z raphaelp Palindrome-Free Numbers (BOI13_numbers) C++14
7.5 / 100
1 ms 600 KB
#include <bits/stdc++.h>
using namespace std;
long long nb(long long N)
{
    long long mult = 1;
    long long tot = 0;
    int first = 0;
    for (int i = 1; i < N; i *= 10)
    {
        if (N / i > 9 && (N / i) % 10 == (N / i / 10) % 10)
        {
            first = i;
        }
        if (N / i > 99 && (N / i) % 10 == (N / i / 100) % 10)
        {
            first = i;
        }
    }
    if (first == 0)
        tot++;
    for (int i = first; N; i++)
    {
        int pos = N % 10;
        if (N > 9 && (N / 10) % 10 < N % 10)
            pos--;
        if (N > 99 && (N / 100) % 10 < N % 10)
            pos--;
        tot += pos * mult;
        N /= 10;
        if (N > 9)
            mult *= 8;
        else
            mult *= 9;
    }
    return tot;
}
int main()
{
    long long a, b;
    cin >> a >> b;
    cout << nb(b) - nb(a - 1) << endl;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Incorrect 0 ms 440 KB Output isn't correct
3 Runtime error 1 ms 600 KB Execution killed with signal 8
4 Incorrect 0 ms 348 KB Output isn't correct
5 Incorrect 0 ms 348 KB Output isn't correct
6 Incorrect 0 ms 348 KB Output isn't correct
7 Incorrect 1 ms 348 KB Output isn't correct
8 Incorrect 0 ms 348 KB Output isn't correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Incorrect 0 ms 344 KB Output isn't correct
14 Incorrect 0 ms 348 KB Output isn't correct
15 Incorrect 0 ms 348 KB Output isn't correct
16 Incorrect 0 ms 348 KB Output isn't correct
17 Correct 0 ms 344 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Runtime error 1 ms 348 KB Execution killed with signal 8
20 Incorrect 0 ms 348 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Runtime error 1 ms 348 KB Execution killed with signal 8
3 Runtime error 1 ms 348 KB Execution killed with signal 8
4 Runtime error 1 ms 348 KB Execution killed with signal 8
5 Incorrect 0 ms 348 KB Output isn't correct
6 Incorrect 0 ms 348 KB Output isn't correct
7 Incorrect 1 ms 348 KB Output isn't correct
8 Incorrect 0 ms 344 KB Output isn't correct
9 Incorrect 0 ms 344 KB Output isn't correct
10 Incorrect 0 ms 348 KB Output isn't correct
11 Incorrect 1 ms 440 KB Output isn't correct
12 Incorrect 0 ms 348 KB Output isn't correct
13 Incorrect 0 ms 348 KB Output isn't correct
14 Incorrect 1 ms 348 KB Output isn't correct
15 Incorrect 0 ms 348 KB Output isn't correct
16 Runtime error 1 ms 580 KB Execution killed with signal 8
17 Runtime error 1 ms 348 KB Execution killed with signal 8
18 Runtime error 1 ms 348 KB Execution killed with signal 8
19 Runtime error 1 ms 348 KB Execution killed with signal 8
20 Runtime error 1 ms 348 KB Execution killed with signal 8
21 Runtime error 0 ms 348 KB Execution killed with signal 8
22 Runtime error 1 ms 348 KB Execution killed with signal 8
23 Runtime error 0 ms 348 KB Execution killed with signal 8
24 Runtime error 0 ms 348 KB Execution killed with signal 8
25 Runtime error 0 ms 348 KB Execution killed with signal 8
26 Runtime error 1 ms 360 KB Execution killed with signal 8
27 Runtime error 1 ms 360 KB Execution killed with signal 8
28 Runtime error 0 ms 360 KB Execution killed with signal 8
29 Runtime error 1 ms 360 KB Execution killed with signal 8
30 Runtime error 1 ms 360 KB Execution killed with signal 8
31 Runtime error 0 ms 360 KB Execution killed with signal 8
32 Runtime error 1 ms 360 KB Execution killed with signal 8
33 Runtime error 1 ms 360 KB Execution killed with signal 8
34 Runtime error 1 ms 360 KB Execution killed with signal 8
35 Runtime error 0 ms 360 KB Execution killed with signal 8
36 Runtime error 0 ms 360 KB Execution killed with signal 8
37 Runtime error 1 ms 360 KB Execution killed with signal 8
38 Runtime error 1 ms 348 KB Execution killed with signal 8
39 Runtime error 1 ms 348 KB Execution killed with signal 8
40 Runtime error 0 ms 348 KB Execution killed with signal 8
41 Runtime error 1 ms 348 KB Execution killed with signal 8
42 Runtime error 1 ms 348 KB Execution killed with signal 8
43 Runtime error 0 ms 432 KB Execution killed with signal 8
44 Runtime error 0 ms 348 KB Execution killed with signal 8
45 Runtime error 1 ms 344 KB Execution killed with signal 8