6575 | 2023-12-12 11:27:33 | batyu | Gergő és a sárkány | cpp17 | Wrong answer 0/100 | 600ms | 4532 KiB |
// Gergo_es_a_Sarkany.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <string>
#include <cmath>
int main()
{
int N, D;
std::cin >> N >> D;
int megoldasok[2] = { -1,-1 };
int temp = 0;
int szam = D;
int maradek = 0;
while (szam <= std::pow(10, N) && temp <= 1)
{
int tsz = szam;
szam += maradek;
maradek = szam;
if (szam >= std::pow(10, N - 1) && szam < std::pow(10, N))
megoldasok[temp++] = szam;
}
if (megoldasok[0] == -1 || megoldasok[1] == -1)
std::cout << "0 0";
else
std::cout << megoldasok[0] << " " << megoldasok[1];
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 3ms | 1964 KiB | ||||
2 | Accepted | 3ms | 2260 KiB | ||||
subtask2 | 0/8 | ||||||
3 | Accepted | 3ms | 2460 KiB | ||||
4 | Wrong answer | 3ms | 2700 KiB | ||||
5 | Accepted | 3ms | 2760 KiB | ||||
6 | Accepted | 3ms | 2916 KiB | ||||
subtask3 | 0/16 | ||||||
7 | Wrong answer | 3ms | 3056 KiB | ||||
8 | Accepted | 3ms | 3076 KiB | ||||
9 | Accepted | 3ms | 3196 KiB | ||||
10 | Wrong answer | 3ms | 3280 KiB | ||||
11 | Accepted | 3ms | 3320 KiB | ||||
subtask4 | 0/7 | ||||||
12 | Accepted | 3ms | 3408 KiB | ||||
13 | Wrong answer | 3ms | 3600 KiB | ||||
14 | Time limit exceeded | 565ms | 2932 KiB | ||||
subtask5 | 0/11 | ||||||
15 | Wrong answer | 3ms | 3744 KiB | ||||
16 | Time limit exceeded | 586ms | 3748 KiB | ||||
17 | Time limit exceeded | 587ms | 2984 KiB | ||||
18 | Accepted | 3ms | 3904 KiB | ||||
subtask6 | 0/58 | ||||||
19 | Time limit exceeded | 598ms | 3988 KiB | ||||
20 | Accepted | 3ms | 4168 KiB | ||||
21 | Accepted | 3ms | 4400 KiB | ||||
22 | Time limit exceeded | 600ms | 3408 KiB | ||||
23 | Time limit exceeded | 552ms | 3608 KiB | ||||
24 | Wrong answer | 3ms | 4532 KiB | ||||
25 | Time limit exceeded | 600ms | 3848 KiB | ||||
26 | Time limit exceeded | 542ms | 3964 KiB |