結果
| 問題 | No.612 Move on grid |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-12-12 23:05:03 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 881 bytes |
| 記録 | |
| コンパイル時間 | 221 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 321,756 KB |
| 最終ジャッジ日時 | 2026-05-25 00:38:23 |
| 合計ジャッジ時間 | 8,201 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | TLE * 1 -- * 3 |
| other | -- * 18 |
ソースコード
#!/usr/bin/env python
#t = int(input().strip())
#indat = [int(x) for x in input().split()]
t = 120
indat = [12, -1, 2, -1212, 1212]
points = {(0, 0, 0):1}
moves = [(1, 0, 0), (0, 1, 0), (0, 0, 1)]
moves = set(moves)
for i in range(t):
tmp = {}
for point, times in points.items():
for move in moves:
a = tuple([x + y for (x, y) in zip(point, move)])
if tmp.get(a) == None:
tmp[a] = times
else:
tmp[a] += times
a = tuple([x - y for (x, y) in zip(point, move)])
if tmp.get(a) == None:
tmp[a] = times
else:
tmp[a] += times
points = tmp
p = 0
for point, times in points.items():
eqs = sum([a * x for (a, x) in zip(indat[:3], point)])
if eqs >= indat[3] and eqs <= indat[4]:
p += times
print(p % (10**9 + 7))