114262024-09-15 13:26:33CsongiKiváló Számokcpp17Accepted 100/10046ms1440 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    if (n == 1)
    {
        cout << -1 << endl;
    }
    else if (n % 3 == 0)
    {
        for (int i = 0; i < n; i++)
        {
            cout << 5;
        }
    }
    else if (n % 3 == 1)
    {
        for (int i = 0; i < n - 2; i++)
        {
            cout << 1;
        }
        cout << 55 << endl;
    }
    else
    {
        for (int i = 0; i < n - 1; i++)
        {
            cout << 1;
        }
        cout << 5 << endl;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted2ms360 KiB
subtask233/33
2Accepted2ms360 KiB
3Accepted3ms492 KiB
4Accepted3ms360 KiB
5Accepted3ms504 KiB
6Accepted2ms376 KiB
7Accepted2ms360 KiB
8Accepted3ms496 KiB
subtask333/33
9Accepted13ms544 KiB
10Accepted25ms852 KiB
11Accepted29ms1144 KiB
12Accepted24ms872 KiB
13Accepted25ms832 KiB
14Accepted14ms540 KiB
15Accepted7ms488 KiB
16Accepted12ms656 KiB
17Accepted19ms616 KiB
18Accepted27ms1000 KiB
19Accepted12ms624 KiB
20Accepted34ms1128 KiB
subtask434/34
21Accepted46ms1440 KiB
22Accepted9ms488 KiB
23Accepted45ms1408 KiB
24Accepted46ms1340 KiB
25Accepted35ms1128 KiB
26Accepted19ms784 KiB
27Accepted37ms1256 KiB
28Accepted32ms1144 KiB
29Accepted8ms412 KiB
30Accepted28ms1000 KiB
31Accepted28ms912 KiB
32Accepted3ms360 KiB
33Accepted6ms488 KiB