166862025-05-08 18:20:07algoproKiváló Számokpypy3Runtime error 66/10078ms23584 KiB
# UUID: 5ff9292c-22d1-4422-bb7b-5d4ecbb8265f
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-i)+("5"*i)
        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
1Accepted39ms19436 KiB
subtask233/33
2Accepted39ms19400 KiB
3Accepted43ms19360 KiB
4Accepted41ms19332 KiB
5Accepted46ms19504 KiB
6Accepted48ms21476 KiB
7Accepted54ms21580 KiB
8Accepted61ms21736 KiB
subtask333/33
9Accepted39ms20168 KiB
10Accepted45ms20932 KiB
11Accepted46ms21152 KiB
12Accepted41ms20700 KiB
13Accepted46ms20896 KiB
14Accepted46ms20220 KiB
15Accepted39ms19716 KiB
16Accepted39ms20008 KiB
17Accepted41ms20424 KiB
18Accepted46ms20968 KiB
19Accepted39ms19876 KiB
20Accepted48ms21576 KiB
subtask40/34
21Runtime error76ms23584 KiB
22Runtime error67ms22696 KiB
23Accepted46ms22356 KiB
24Accepted41ms22200 KiB
25Accepted41ms21740 KiB
26Accepted46ms20716 KiB
27Accepted41ms21736 KiB
28Runtime error78ms23372 KiB
29Runtime error65ms22504 KiB
30Runtime error75ms23220 KiB
31Accepted39ms21188 KiB
32Runtime error74ms22552 KiB
33Runtime error65ms22772 KiB