11705 | 2024-11-06 23:12:23 | kkristof | Kiváló Számok | python3 | Runtime error 33/100 | 497ms | 262144 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)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 14ms | 3128 KiB | ||||
subtask2 | 33/33 | ||||||
2 | Accepted | 17ms | 3128 KiB | ||||
3 | Accepted | 14ms | 3156 KiB | ||||
4 | Accepted | 14ms | 3048 KiB | ||||
5 | Accepted | 16ms | 2984 KiB | ||||
6 | Accepted | 17ms | 3128 KiB | ||||
7 | Accepted | 16ms | 3304 KiB | ||||
8 | Accepted | 16ms | 3132 KiB | ||||
subtask3 | 0/33 | ||||||
9 | Runtime error | 317ms | 262144 KiB | ||||
10 | Runtime error | 270ms | 262144 KiB | ||||
11 | Runtime error | 275ms | 262144 KiB | ||||
12 | Runtime error | 317ms | 262144 KiB | ||||
13 | Runtime error | 275ms | 262144 KiB | ||||
14 | Runtime error | 273ms | 262144 KiB | ||||
15 | Runtime error | 289ms | 262144 KiB | ||||
16 | Runtime error | 312ms | 262144 KiB | ||||
17 | Runtime error | 316ms | 262144 KiB | ||||
18 | Runtime error | 312ms | 262144 KiB | ||||
19 | Runtime error | 314ms | 262144 KiB | ||||
20 | Runtime error | 268ms | 262144 KiB | ||||
subtask4 | 0/34 | ||||||
21 | Runtime error | 312ms | 262144 KiB | ||||
22 | Runtime error | 268ms | 262144 KiB | ||||
23 | Runtime error | 312ms | 262144 KiB | ||||
24 | Runtime error | 270ms | 262144 KiB | ||||
25 | Runtime error | 319ms | 262144 KiB | ||||
26 | Runtime error | 272ms | 262144 KiB | ||||
27 | Runtime error | 314ms | 262144 KiB | ||||
28 | Runtime error | 312ms | 262144 KiB | ||||
29 | Runtime error | 280ms | 262144 KiB | ||||
30 | Runtime error | 317ms | 262144 KiB | ||||
31 | Runtime error | 308ms | 262144 KiB | ||||
32 | Runtime error | 497ms | 262144 KiB | ||||
33 | Runtime error | 275ms | 262144 KiB |