166842025-05-08 18:13:38algoproKiváló Számokpypy3Runtime error 66/10074ms25268 KiB
# UUID: be63ed4d-0d32-4d2c-b81e-1685aeb6b5b3
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"*i
        print (szam)
        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
1Accepted45ms19368 KiB
subtask233/33
2Accepted43ms19304 KiB
3Accepted45ms19360 KiB
4Accepted39ms19356 KiB
5Accepted39ms19400 KiB
6Accepted48ms21480 KiB
7Accepted54ms21488 KiB
8Accepted64ms21732 KiB
subtask333/33
9Accepted45ms20152 KiB
10Accepted41ms20864 KiB
11Accepted41ms21112 KiB
12Accepted45ms20700 KiB
13Accepted46ms20884 KiB
14Accepted45ms20120 KiB
15Accepted41ms19756 KiB
16Accepted39ms20152 KiB
17Accepted46ms20652 KiB
18Accepted48ms21036 KiB
19Accepted39ms20036 KiB
20Accepted41ms21580 KiB
subtask40/34
21Runtime error70ms25268 KiB
22Runtime error68ms22900 KiB
23Accepted48ms22236 KiB
24Accepted46ms22332 KiB
25Accepted41ms21760 KiB
26Accepted46ms20484 KiB
27Accepted46ms21736 KiB
28Runtime error70ms24124 KiB
29Runtime error65ms22708 KiB
30Runtime error68ms23924 KiB
31Accepted46ms21212 KiB
32Runtime error74ms22704 KiB
33Runtime error64ms22720 KiB