115002024-10-13 19:34:22mraronKiváló Számokcpp17Accepted 100/1008ms2332 KiB
#include <bits/stdc++.h>
using namespace std;
#define f(i,k,n) for(int i=k; i<n; i++)
#define ll long long
const int inf = INT_MAX;

void solve()
{
    int n;
    cin>>n;
    if(n==1)
    {
        cout<<"-1\n";
        return;
    }
    string s=""; 
    if(n%3==1)
    {
        s+="1155";
        n-=4;
    }    
    else if(n%3==2)
    {
        s+="15";
        n-=2;
    }
    f(i,0,n)  s+="1";
    cout<<s<<"\n";
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t=1;
    //cin>>t;
    while(t--)  solve();
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms508 KiB
subtask233/33
2Accepted1ms320 KiB
3Accepted1ms320 KiB
4Accepted1ms424 KiB
5Accepted1ms320 KiB
6Accepted1ms320 KiB
7Accepted1ms320 KiB
8Accepted1ms320 KiB
subtask333/33
9Accepted3ms968 KiB
10Accepted4ms1520 KiB
11Accepted4ms1724 KiB
12Accepted4ms1492 KiB
13Accepted4ms1516 KiB
14Accepted3ms1040 KiB
15Accepted2ms568 KiB
16Accepted2ms760 KiB
17Accepted4ms1068 KiB
18Accepted4ms1644 KiB
19Accepted2ms712 KiB
20Accepted6ms1776 KiB
subtask434/34
21Accepted8ms2332 KiB
22Accepted3ms716 KiB
23Accepted8ms2288 KiB
24Accepted8ms2288 KiB
25Accepted6ms2032 KiB
26Accepted4ms1236 KiB
27Accepted6ms2024 KiB
28Accepted6ms1820 KiB
29Accepted2ms568 KiB
30Accepted4ms1520 KiB
31Accepted4ms1592 KiB
32Accepted1ms332 KiB
33Accepted1ms572 KiB