87242024-01-26 18:00:45NagyLeoKiváló számok 2pypy3Time limit exceeded 37/1001.067s89692 KiB
from math import comb

MOD = 10**9 + 7
def count_excellent():
    _ = int(input().strip())

    for __ in range(_):
        N = int(input().strip())
        valasz = 0
        for i in range(N+1):
            if ((N-i)*5 + i) % 3 == 0:
                valasz += comb(N, i)

        print(valasz % MOD)

count_excellent()
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted71ms85824 KiB
subtask213/13
2Accepted41ms77452 KiB
3Accepted41ms77380 KiB
subtask324/24
4Accepted321ms89516 KiB
5Accepted528ms89692 KiB
6Accepted300ms89044 KiB
7Accepted374ms89524 KiB
subtask40/34
8Time limit exceeded1.049s31068 KiB
9Time limit exceeded1.054s31328 KiB
10Time limit exceeded1.047s31964 KiB
11Time limit exceeded1.054s31856 KiB
subtask50/29
12Time limit exceeded1.034s36076 KiB
13Time limit exceeded1.059s36316 KiB
14Time limit exceeded1.05s36280 KiB
15Time limit exceeded1.046s36372 KiB
16Time limit exceeded1.062s36716 KiB
17Time limit exceeded1.067s36964 KiB
18Time limit exceeded1.062s37100 KiB