65732023-12-12 11:09:50batyuGergő és a sárkánycpp17Time limit exceeded 24/100600ms4068 KiB
#include <iostream>
#include <string>
int DigitNum(int num)
{
    auto a = std::to_string(num);
    return a.length();
}
int main()
{
    int N, D;
    std::cin >> N >> D;
    int A = D, B = 2*D;
    int k = 1;
    while (DigitNum(A) < N || DigitNum(B) < N)
    {
        A += k*D;
        B += k * D;
        k++;
    }
    if (DigitNum(A) != N || DigitNum(B) != N)
        std::cout << "0 0";
    else {
        std::cout << A << " " << B;
    }
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1872 KiB
2Accepted3ms2004 KiB
subtask28/8
3Accepted3ms2216 KiB
4Accepted3ms2436 KiB
5Accepted3ms2560 KiB
6Accepted3ms2784 KiB
subtask316/16
7Accepted3ms2996 KiB
8Accepted3ms3216 KiB
9Accepted3ms3296 KiB
10Accepted3ms3332 KiB
11Accepted3ms3312 KiB
subtask40/7
12Accepted3ms3312 KiB
13Accepted3ms3420 KiB
14Time limit exceeded600ms2608 KiB
subtask50/11
15Accepted3ms3568 KiB
16Time limit exceeded598ms3552 KiB
17Time limit exceeded521ms3664 KiB
18Accepted3ms3700 KiB
subtask60/58
19Time limit exceeded600ms2916 KiB
20Accepted3ms3828 KiB
21Accepted3ms3836 KiB
22Time limit exceeded564ms4068 KiB
23Time limit exceeded552ms3268 KiB
24Wrong answer3ms4004 KiB
25Time limit exceeded600ms3136 KiB
26Time limit exceeded564ms3964 KiB