9814 | 2024-03-07 10:25:17 | EsVagy | Gergő és a sárkány | cpp17 | Wrong answer 24/100 | 3ms | 4920 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);
int n, d;
cin >> n >> d;
n--;
long long fnum = 1;
long long rem = 0;
for (size_t i = 0; i < n; i++)
{
fnum *= 10;
}
int magnitude = fnum;
rem = fnum % d;
rem = d - rem;
fnum += rem;
int 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 | 1888 KiB | ||||
2 | Accepted | 3ms | 2124 KiB | ||||
subtask2 | 8/8 | ||||||
3 | Accepted | 3ms | 2336 KiB | ||||
4 | Accepted | 3ms | 2564 KiB | ||||
5 | Accepted | 3ms | 2748 KiB | ||||
6 | Accepted | 3ms | 2840 KiB | ||||
subtask3 | 16/16 | ||||||
7 | Accepted | 3ms | 2844 KiB | ||||
8 | Accepted | 3ms | 3340 KiB | ||||
9 | Accepted | 3ms | 3168 KiB | ||||
10 | Accepted | 3ms | 3208 KiB | ||||
11 | Accepted | 3ms | 3416 KiB | ||||
subtask4 | 0/7 | ||||||
12 | Accepted | 3ms | 3648 KiB | ||||
13 | Accepted | 3ms | 3868 KiB | ||||
14 | Wrong answer | 3ms | 4220 KiB | ||||
subtask5 | 0/11 | ||||||
15 | Accepted | 3ms | 4240 KiB | ||||
16 | Wrong answer | 3ms | 4388 KiB | ||||
17 | Wrong answer | 3ms | 4492 KiB | ||||
18 | Accepted | 3ms | 4588 KiB | ||||
subtask6 | 0/58 | ||||||
19 | Wrong answer | 3ms | 4696 KiB | ||||
20 | Accepted | 3ms | 4700 KiB | ||||
21 | Accepted | 3ms | 4832 KiB | ||||
22 | Wrong answer | 3ms | 4920 KiB | ||||
23 | Wrong answer | 3ms | 4900 KiB | ||||
24 | Wrong answer | 3ms | 4812 KiB | ||||
25 | Wrong answer | 3ms | 4808 KiB | ||||
26 | Wrong answer | 3ms | 4820 KiB |