166822025-05-08 18:12:31algoproKiváló Számokpypy3Runtime error 66/10075ms23704 KiB
# UUID: 452fa894-c45e-4a98-833c-3b11d3561f8a
N= int(input())
#l=[]
if N>7 and N%2==0:
    print ("15"*(N//2))
    exit()
if N>7 and N%2!=0:
    for i in range (N):
        szam= "1"*(N-1-i)+"5"
        if int(szam)%3==0:
            print (szam)
            exit()
     
for i in range (10**(N-1)+2,10**N,3): #elsőnek a 3-mal oszthatókat keresem meg majd azokból válogatok
    #if i%3==0:
    #    l.append(i)

    only_five_and_ones = True
    for ii in str(i):
        if ii not in "15": # ["1","5"]
            only_five_and_ones = False
    
    if only_five_and_ones:
        print (i)
        exit()
# igen, igy el lehet donteni, hogy ez szam jo-e 1-5 szempontbol
print(-1)
    

    
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted46ms19544 KiB
subtask233/33
2Accepted39ms19348 KiB
3Accepted39ms19424 KiB
4Accepted43ms19572 KiB
5Accepted43ms19404 KiB
6Accepted54ms21480 KiB
7Accepted48ms21480 KiB
8Accepted61ms21616 KiB
subtask333/33
9Accepted39ms20088 KiB
10Accepted41ms21140 KiB
11Accepted46ms21328 KiB
12Accepted45ms20880 KiB
13Accepted41ms20940 KiB
14Accepted46ms20200 KiB
15Accepted45ms19692 KiB
16Accepted41ms19944 KiB
17Accepted46ms20508 KiB
18Accepted46ms21004 KiB
19Accepted39ms19960 KiB
20Accepted43ms21484 KiB
subtask40/34
21Runtime error68ms23704 KiB
22Runtime error67ms22748 KiB
23Accepted46ms22132 KiB
24Accepted46ms22252 KiB
25Accepted46ms21592 KiB
26Accepted41ms20692 KiB
27Accepted41ms21628 KiB
28Runtime error75ms23376 KiB
29Runtime error65ms22504 KiB
30Runtime error65ms23216 KiB
31Accepted46ms20976 KiB
32Runtime error74ms22680 KiB
33Runtime error64ms22612 KiB