9815 | 2024-03-07 10:29:31 | EsVagy | Gergő és a sárkány | cpp17 | Accepted 100/100 | 3ms | 4380 KiB |
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <climits>
#include <queue>
#include <fstream>
#include <sstream>
#include <math.h>
#include <list>
using namespace std;
using ll = long long;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
long long n, d;
cin >> n >> d;
n--;
long long fnum = 1;
long long rem = 0;
for (size_t i = 0; i < n; i++)
{
fnum *= 10;
}
long long magnitude = fnum;
rem = fnum % d;
rem = d - rem;
fnum += rem;
long long secnum = fnum + d;
if (secnum >= 10 * magnitude) {
cout << "0 0";
return 0;
}
else cout << fnum << " " << secnum;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1760 KiB | ||||
2 | Accepted | 3ms | 2200 KiB | ||||
subtask2 | 8/8 | ||||||
3 | Accepted | 3ms | 2412 KiB | ||||
4 | Accepted | 3ms | 2680 KiB | ||||
5 | Accepted | 3ms | 2592 KiB | ||||
6 | Accepted | 3ms | 2808 KiB | ||||
subtask3 | 16/16 | ||||||
7 | Accepted | 3ms | 3044 KiB | ||||
8 | Accepted | 3ms | 3256 KiB | ||||
9 | Accepted | 3ms | 3336 KiB | ||||
10 | Accepted | 3ms | 3572 KiB | ||||
11 | Accepted | 3ms | 3460 KiB | ||||
subtask4 | 7/7 | ||||||
12 | Accepted | 3ms | 3660 KiB | ||||
13 | Accepted | 3ms | 3888 KiB | ||||
14 | Accepted | 3ms | 3884 KiB | ||||
subtask5 | 11/11 | ||||||
15 | Accepted | 3ms | 3992 KiB | ||||
16 | Accepted | 3ms | 4236 KiB | ||||
17 | Accepted | 3ms | 4124 KiB | ||||
18 | Accepted | 3ms | 4220 KiB | ||||
subtask6 | 58/58 | ||||||
19 | Accepted | 3ms | 4336 KiB | ||||
20 | Accepted | 3ms | 4260 KiB | ||||
21 | Accepted | 3ms | 4160 KiB | ||||
22 | Accepted | 3ms | 4192 KiB | ||||
23 | Accepted | 3ms | 4268 KiB | ||||
24 | Accepted | 3ms | 4380 KiB | ||||
25 | Accepted | 3ms | 4272 KiB | ||||
26 | Accepted | 3ms | 4376 KiB |