結果

問題 No.1811 EQUIV Ten
ユーザー MasKoaTSMasKoaTS
提出日時 2022-01-13 22:15:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 381 ms / 2,000 ms
コード長 1,151 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 12,928 KB
実行使用メモリ 11,776 KB
最終ジャッジ日時 2024-04-30 11:49:10
合計ジャッジ時間 5,110 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
11,776 KB
testcase_01 AC 32 ms
11,648 KB
testcase_02 AC 31 ms
11,648 KB
testcase_03 AC 31 ms
11,776 KB
testcase_04 AC 31 ms
11,776 KB
testcase_05 AC 31 ms
11,648 KB
testcase_06 AC 30 ms
11,648 KB
testcase_07 AC 29 ms
11,648 KB
testcase_08 AC 30 ms
11,648 KB
testcase_09 AC 29 ms
11,648 KB
testcase_10 AC 29 ms
11,776 KB
testcase_11 AC 312 ms
11,648 KB
testcase_12 AC 340 ms
11,776 KB
testcase_13 AC 381 ms
11,776 KB
testcase_14 AC 372 ms
11,648 KB
testcase_15 AC 369 ms
11,776 KB
testcase_16 AC 31 ms
11,648 KB
testcase_17 AC 31 ms
11,776 KB
testcase_18 AC 36 ms
11,648 KB
testcase_19 AC 30 ms
11,776 KB
testcase_20 AC 44 ms
11,648 KB
testcase_21 AC 43 ms
11,776 KB
testcase_22 AC 31 ms
11,648 KB
testcase_23 AC 153 ms
11,776 KB
testcase_24 AC 55 ms
11,648 KB
testcase_25 AC 34 ms
11,776 KB
testcase_26 AC 126 ms
11,648 KB
testcase_27 AC 38 ms
11,648 KB
testcase_28 AC 31 ms
11,648 KB
testcase_29 AC 32 ms
11,648 KB
testcase_30 AC 315 ms
11,648 KB
testcase_31 AC 39 ms
11,648 KB
testcase_32 AC 63 ms
11,776 KB
testcase_33 AC 64 ms
11,648 KB
testcase_34 AC 314 ms
11,648 KB
testcase_35 AC 125 ms
11,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools as iter
import collections as coll
import heapq as hq
import bisect as bis
from decimal import Decimal as dec
from copy import deepcopy as dcopy
import math
import sys
sys.setrecursionlimit(10**6)
def input():
    return sys.stdin.readline().rstrip()
def getN():
	return int(sys.stdin.readline())
def getNs():
	return map(int,sys.stdin.readline().split())
def getList():
	return list(map(int,sys.stdin.readline().split()))
def strinps(n):
	return [sys.stdin.readline().rstrip() for _ in range(n)]
pi = 3.141592653589793
mod = 10**9+7
MOD = 998244353
INF = math.inf
dx = [1,0,-1,0];	dy = [0,1,0,-1]


"""
Main Code
"""

n = getN()

if(n <= 3):
	print(0)
	exit(0)

dp = [1] * 8
for i in range(3,n):
	ndp = [0] * 8
	ndp[0b000] = (dp[0b000] + dp[0b100]) % mod
	ndp[0b001] = (dp[0b000] + dp[0b100]) % mod
	ndp[0b010] = dp[0b001]
	ndp[0b011] = (dp[0b001] + dp[0b101]) % mod
	ndp[0b100] = (dp[0b010] + dp[0b110]) % mod
	ndp[0b101] = (dp[0b010] + dp[0b110]) % mod
	ndp[0b110] = (dp[0b011] + dp[0b111]) % mod
	ndp[0b111] = (dp[0b011] + dp[0b111]) % mod
	dp = list(ndp)

ans = pow(2, n, mod)
for i in dp:
	ans += mod - i
	ans %= mod
print(ans)
0