8732 | 2024-01-26 18:59:46 | NagyLeo | Kiváló számok 2 | pypy3 | Accepted 100/100 | 48ms | 79216 KiB |
MOD = 10**9 + 7
def count_excellent_3():
_ = int(input().strip())
for __ in range(_):
N = int(input().strip())
if N % 2 == 0:
last = (pow(2, N, MOD) + 2) * pow(3, -1, MOD)
else:
last = (pow(2, N, MOD) - 2) * pow(3, -1, MOD)
print(f"{last % MOD}")
count_excellent_3()
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 48ms | 76524 KiB | ||||
subtask2 | 13/13 | ||||||
2 | Accepted | 43ms | 76268 KiB | ||||
3 | Accepted | 46ms | 76748 KiB | ||||
subtask3 | 24/24 | ||||||
4 | Accepted | 46ms | 76996 KiB | ||||
5 | Accepted | 43ms | 77504 KiB | ||||
6 | Accepted | 46ms | 77392 KiB | ||||
7 | Accepted | 43ms | 77740 KiB | ||||
subtask4 | 34/34 | ||||||
8 | Accepted | 46ms | 77988 KiB | ||||
9 | Accepted | 43ms | 78024 KiB | ||||
10 | Accepted | 46ms | 78136 KiB | ||||
11 | Accepted | 43ms | 78996 KiB | ||||
subtask5 | 29/29 | ||||||
12 | Accepted | 46ms | 78916 KiB | ||||
13 | Accepted | 46ms | 78744 KiB | ||||
14 | Accepted | 46ms | 79120 KiB | ||||
15 | Accepted | 48ms | 79216 KiB | ||||
16 | Accepted | 48ms | 79116 KiB | ||||
17 | Accepted | 48ms | 79108 KiB | ||||
18 | Accepted | 46ms | 79188 KiB |