結果
| 問題 |
No.507 ゲーム大会(チーム決め)
|
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2021-02-12 05:53:03 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 713 bytes |
| コンパイル時間 | 190 ms |
| コンパイル使用メモリ | 81,920 KB |
| 実行使用メモリ | 65,152 KB |
| 最終ジャッジ日時 | 2024-07-18 15:39:33 |
| 合計ジャッジ時間 | 2,629 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 2 |
| other | RE * 19 |
ソースコード
def solve():
dp = [[0]*w for _ in range(h)]
dp[0][0] = 1
for i in range(h):
for j in range(w):
if i==0==j or b[i][j]==0: continue
if i: dp[i][j] += dp[i-1][j]
if j: dp[i][j] += dp[i][j-1]
return dp[-1][-1]
h,w,k,p = map(int,input().split())
h += 1; w += 1
pos = []
for _ in range(k):
x,y,s = input().split()
pos.append((int(x),int(y),s))
b = [[1]*w for _ in range(h)]
ans = []
val = 0
from itertools import combinations
for lst in combinations(pos,p):
for x,y,s in pos:
b[x][y] = 0
for x,y,s in lst:
b[x][y] = 1
v = solve()
if val < v:
ans = (xys[2] for xys in lst)
val = v
print(val%(10**9+7))
convexineq