結果
問題 | No.1136 Four Points Tour |
ユーザー | Theta |
提出日時 | 2022-10-20 18:12:46 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,901 bytes |
コンパイル時間 | 118 ms |
コンパイル使用メモリ | 12,928 KB |
実行使用メモリ | 21,760 KB |
最終ジャッジ日時 | 2024-06-30 10:10:25 |
合計ジャッジ時間 | 67,387 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 32 ms
17,824 KB |
testcase_01 | AC | 33 ms
21,760 KB |
testcase_02 | AC | 33 ms
17,820 KB |
testcase_03 | AC | 31 ms
21,504 KB |
testcase_04 | AC | 33 ms
17,948 KB |
testcase_05 | AC | 31 ms
21,632 KB |
testcase_06 | AC | 30 ms
17,824 KB |
testcase_07 | AC | 1,006 ms
21,632 KB |
testcase_08 | AC | 31 ms
17,696 KB |
testcase_09 | AC | 32 ms
21,504 KB |
testcase_10 | AC | 1,592 ms
17,820 KB |
testcase_11 | AC | 46 ms
21,632 KB |
testcase_12 | AC | 219 ms
17,696 KB |
testcase_13 | AC | 32 ms
21,632 KB |
testcase_14 | AC | 198 ms
17,824 KB |
testcase_15 | AC | 47 ms
21,504 KB |
testcase_16 | AC | 215 ms
17,820 KB |
testcase_17 | AC | 256 ms
21,632 KB |
testcase_18 | AC | 1,216 ms
17,820 KB |
testcase_19 | TLE | - |
testcase_20 | AC | 111 ms
17,820 KB |
testcase_21 | AC | 1,226 ms
21,504 KB |
01_Sample03_evil.txt | TLE | - |
04_Rnd_large_evil1.txt | TLE | - |
04_Rnd_large_evil2.txt | TLE | - |
04_Rnd_large_evil3.txt | TLE | - |
04_Rnd_large_evil4.txt | TLE | - |
04_Rnd_large_evil5.txt | TLE | - |
04_Rnd_large_evil6.txt | TLE | - |
04_Rnd_large_evil7.txt | TLE | - |
04_Rnd_large_evil8.txt | TLE | - |
04_Rnd_large_evil9.txt | TLE | - |
04_Rnd_large_evil10.txt | TLE | - |
05_Rnd_huge_evil1.txt | TLE | - |
05_Rnd_huge_evil2.txt | TLE | - |
05_Rnd_huge_evil3.txt | TLE | - |
05_Rnd_huge_evil4.txt | TLE | - |
05_Rnd_huge_evil5.txt | TLE | - |
05_Rnd_huge_evil6.txt | TLE | - |
05_Rnd_huge_evil7.txt | TLE | - |
99_evil_01.txt | TLE | - |
ソースコード
class Modint: MOD = int(1e9+7) def __init__(self, value: int) -> None: self.num = int(value) % self.MOD def __str__(self) -> str: return str(self.num) __repr__ = __str__ def __add__(self, __x): if isinstance(__x, Modint): return Modint((self.num + __x.num)) return Modint(self.num + __x) def __sub__(self, __x): if isinstance(__x, Modint): return Modint(self.num - __x.num) return Modint(self.num - __x) def __mul__(self, __x): if isinstance(__x, Modint): return Modint(self.num * __x.num) return Modint(self.num * __x) __radd__ = __add__ __rmul__ = __mul__ def __rsub__(self, __x): if isinstance(__x, Modint): return Modint(__x.num - self.num) return Modint(__x - self.num) def __pow__(self, __x): if isinstance(__x, Modint): return Modint(pow(self.num, __x.num, self.MOD)) return Modint(pow(self.num, __x, self.MOD)) def __rpow__(self, __x): if isinstance(__x, Modint): return Modint(pow(__x.num, self.num, self.MOD)) return Modint(pow(__x, self.num, self.MOD)) def __truediv__(self, __x): if isinstance(__x, Modint): return Modint(self.num * pow(__x.num, self.MOD - 2, self.MOD)) return Modint(self.num * pow(__x, self.MOD - 2, self.MOD)) def __rtruediv__(self, __x): if isinstance(__x, Modint): return Modint(__x.num * pow(self.num, self.MOD - 2, self.MOD)) return Modint(__x * pow(self.num, self.MOD - 2, self.MOD)) def main(): N = int(input()) A_patterns = Modint(1) other_patterns = Modint(0) for second in range(N): A_patterns, other_patterns = other_patterns*3, A_patterns + other_patterns*2 print(A_patterns) if __name__ == "__main__": main()