結果
問題 | No.1136 Four Points Tour |
ユーザー | tonnnura172 |
提出日時 | 2020-08-10 20:03:40 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 520 ms / 2,000 ms |
コード長 | 1,027 bytes |
コンパイル時間 | 232 ms |
コンパイル使用メモリ | 82,428 KB |
実行使用メモリ | 180,976 KB |
最終ジャッジ日時 | 2024-10-08 10:45:24 |
合計ジャッジ時間 | 5,953 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 61 ms
67,136 KB |
testcase_01 | AC | 61 ms
69,552 KB |
testcase_02 | AC | 56 ms
66,480 KB |
testcase_03 | AC | 57 ms
65,892 KB |
testcase_04 | AC | 59 ms
67,060 KB |
testcase_05 | AC | 56 ms
67,388 KB |
testcase_06 | AC | 58 ms
66,188 KB |
testcase_07 | AC | 271 ms
124,316 KB |
testcase_08 | AC | 60 ms
69,544 KB |
testcase_09 | AC | 61 ms
69,816 KB |
testcase_10 | AC | 381 ms
149,964 KB |
testcase_11 | AC | 66 ms
73,076 KB |
testcase_12 | AC | 109 ms
87,008 KB |
testcase_13 | AC | 62 ms
70,984 KB |
testcase_14 | AC | 105 ms
86,104 KB |
testcase_15 | AC | 66 ms
72,524 KB |
testcase_16 | AC | 107 ms
86,868 KB |
testcase_17 | AC | 112 ms
88,536 KB |
testcase_18 | AC | 314 ms
134,264 KB |
testcase_19 | AC | 520 ms
180,976 KB |
testcase_20 | AC | 83 ms
81,928 KB |
testcase_21 | AC | 313 ms
134,296 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])