結果
問題 | No.1136 Four Points Tour |
ユーザー | tonnnura172 |
提出日時 | 2020-08-10 20:03:40 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 612 ms / 2,000 ms |
コード長 | 1,027 bytes |
コンパイル時間 | 211 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 180,992 KB |
最終ジャッジ日時 | 2024-04-17 01:52:52 |
合計ジャッジ時間 | 7,005 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 79 ms
65,536 KB |
testcase_01 | AC | 89 ms
69,120 KB |
testcase_02 | AC | 78 ms
65,664 KB |
testcase_03 | AC | 77 ms
65,536 KB |
testcase_04 | AC | 78 ms
65,792 KB |
testcase_05 | AC | 77 ms
65,536 KB |
testcase_06 | AC | 80 ms
65,664 KB |
testcase_07 | AC | 320 ms
124,288 KB |
testcase_08 | AC | 85 ms
68,736 KB |
testcase_09 | AC | 87 ms
69,120 KB |
testcase_10 | AC | 448 ms
150,144 KB |
testcase_11 | AC | 92 ms
71,424 KB |
testcase_12 | AC | 141 ms
87,168 KB |
testcase_13 | AC | 84 ms
68,992 KB |
testcase_14 | AC | 140 ms
86,272 KB |
testcase_15 | AC | 98 ms
71,936 KB |
testcase_16 | AC | 140 ms
86,784 KB |
testcase_17 | AC | 148 ms
88,448 KB |
testcase_18 | AC | 365 ms
134,016 KB |
testcase_19 | AC | 612 ms
180,992 KB |
testcase_20 | AC | 120 ms
81,536 KB |
testcase_21 | AC | 368 ms
134,528 KB |
01_Sample03_evil.txt | WA | - |
04_Rnd_large_evil1.txt | WA | - |
04_Rnd_large_evil2.txt | WA | - |
04_Rnd_large_evil3.txt | WA | - |
04_Rnd_large_evil4.txt | WA | - |
04_Rnd_large_evil5.txt | WA | - |
04_Rnd_large_evil6.txt | WA | - |
04_Rnd_large_evil7.txt | WA | - |
04_Rnd_large_evil8.txt | WA | - |
04_Rnd_large_evil9.txt | WA | - |
04_Rnd_large_evil10.txt | WA | - |
05_Rnd_huge_evil1.txt | WA | - |
05_Rnd_huge_evil2.txt | WA | - |
05_Rnd_huge_evil3.txt | WA | - |
05_Rnd_huge_evil4.txt | WA | - |
05_Rnd_huge_evil5.txt | WA | - |
05_Rnd_huge_evil6.txt | WA | - |
05_Rnd_huge_evil7.txt | WA | - |
99_evil_01.txt | WA | - |
ソースコード
import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd, log2 from itertools import accumulate, permutations, combinations, product from operator import itemgetter, mul, add from copy import deepcopy from string import ascii_lowercase, ascii_uppercase, digits from bisect import bisect, bisect_left from heapq import heappush, heappop from functools import reduce, lru_cache def input(): return sys.stdin.buffer.readline()[:-1] def INT(): return int(input()) def MAP(): return map(int, input().split()) def LIST(): return list(map(int, input().split())) def ZIP(n): return zip(*(MAP() for _ in range(n))) sys.setrecursionlimit(10 ** 9) INF = float('inf') mod = 10 ** 9 + 7 N = INT() if N > 10**6: exit() dp = [[0]*4 for _ in range(N+1)] dp[0][0] = 1 for i in range(1, N+1): for j in range(4): for k in range(4): if j != k: dp[i][k] += dp[i-1][j] dp[i][k] %= mod print(dp[N][0])