11423 | 2024-09-15 13:16:07 | Csongi | Kiváló Számok | cpp17 | Runtime error 33/100 | 64ms | 1680 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
//ifstream cin("input.txt");
int n;
cin >> n;
if (n < 3)
{
cout << 15 << endl;
}
else
{
if (n % 3 == 0)
{
for (int i = 0; i < n; i++)
{
cout << 1;
}
cout << endl;
}
else if (n % 3 == 1)
{
string m = "";
for (int i = 0; i < n; i++)
{
m += '1';
}
int i = m.size() - 1;
while (stoi(m) % 3 != 0)
{
m[i] = '5';
i--;
}
cout << m << endl;
}
else
{
string m = "";
for (int i = 0; i < n; i++)
{
m += '1';
}
int i = m.size() - 1;
while (stoi(m) % 3 != 0)
{
m[i] = '5';
i--;
}
cout << m << endl;
}
}
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 2ms | 360 KiB | ||||
subtask2 | 33/33 | ||||||
2 | Accepted | 3ms | 360 KiB | ||||
3 | Accepted | 3ms | 360 KiB | ||||
4 | Accepted | 3ms | 488 KiB | ||||
5 | Accepted | 3ms | 360 KiB | ||||
6 | Accepted | 2ms | 384 KiB | ||||
7 | Accepted | 2ms | 360 KiB | ||||
8 | Accepted | 3ms | 376 KiB | ||||
subtask3 | 0/33 | ||||||
9 | Accepted | 17ms | 660 KiB | ||||
10 | Runtime error | 8ms | 1076 KiB | ||||
11 | Accepted | 39ms | 1000 KiB | ||||
12 | Runtime error | 8ms | 1156 KiB | ||||
13 | Runtime error | 8ms | 1428 KiB | ||||
14 | Runtime error | 7ms | 904 KiB | ||||
15 | Runtime error | 6ms | 744 KiB | ||||
16 | Accepted | 17ms | 616 KiB | ||||
17 | Accepted | 27ms | 744 KiB | ||||
18 | Runtime error | 8ms | 1536 KiB | ||||
19 | Runtime error | 6ms | 888 KiB | ||||
20 | Runtime error | 8ms | 1412 KiB | ||||
subtask4 | 0/34 | ||||||
21 | Runtime error | 10ms | 1564 KiB | ||||
22 | Runtime error | 7ms | 920 KiB | ||||
23 | Runtime error | 9ms | 1568 KiB | ||||
24 | Accepted | 64ms | 1384 KiB | ||||
25 | Accepted | 50ms | 1128 KiB | ||||
26 | Accepted | 28ms | 732 KiB | ||||
27 | Runtime error | 10ms | 1488 KiB | ||||
28 | Runtime error | 9ms | 1680 KiB | ||||
29 | Runtime error | 6ms | 772 KiB | ||||
30 | Runtime error | 8ms | 1428 KiB | ||||
31 | Runtime error | 8ms | 1412 KiB | ||||
32 | Runtime error | 4ms | 616 KiB | ||||
33 | Accepted | 8ms | 504 KiB |