117052024-11-06 23:12:23kkristofKiváló Számokpython3Runtime error 33/100497ms262144 KiB
#!/usr/bin/env python3
# NOTE: it is recommended to use this even if you don't understand the following code.
from itertools import combinations_with_replacement

# input data
N = int(input().strip())

# insert your code here
szamok = list(combinations_with_replacement([1, 5], N))
i = 0
while i < len(szamok) and int("".join(list(map(str, szamok[i])))) % 3 != 0:
    i += 1
if i < len(szamok):
    print(int("".join(list(map(str, szamok[i])))))
else:
    print(-1)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted14ms3128 KiB
subtask233/33
2Accepted17ms3128 KiB
3Accepted14ms3156 KiB
4Accepted14ms3048 KiB
5Accepted16ms2984 KiB
6Accepted17ms3128 KiB
7Accepted16ms3304 KiB
8Accepted16ms3132 KiB
subtask30/33
9Runtime error317ms262144 KiB
10Runtime error270ms262144 KiB
11Runtime error275ms262144 KiB
12Runtime error317ms262144 KiB
13Runtime error275ms262144 KiB
14Runtime error273ms262144 KiB
15Runtime error289ms262144 KiB
16Runtime error312ms262144 KiB
17Runtime error316ms262144 KiB
18Runtime error312ms262144 KiB
19Runtime error314ms262144 KiB
20Runtime error268ms262144 KiB
subtask40/34
21Runtime error312ms262144 KiB
22Runtime error268ms262144 KiB
23Runtime error312ms262144 KiB
24Runtime error270ms262144 KiB
25Runtime error319ms262144 KiB
26Runtime error272ms262144 KiB
27Runtime error314ms262144 KiB
28Runtime error312ms262144 KiB
29Runtime error280ms262144 KiB
30Runtime error317ms262144 KiB
31Runtime error308ms262144 KiB
32Runtime error497ms262144 KiB
33Runtime error275ms262144 KiB