結果

問題 No.2783 4-33 Easy
ユーザー vwxyzvwxyz
提出日時 2024-07-03 04:01:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 750 bytes
コンパイル時間 107 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-03 04:01:53
合計ジャッジ時間 33,599 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
10,880 KB
testcase_01 AC 81 ms
10,880 KB
testcase_02 AC 68 ms
10,880 KB
testcase_03 AC 52 ms
10,752 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 1,410 ms
10,880 KB
testcase_07 AC 1,506 ms
10,880 KB
testcase_08 AC 1,378 ms
10,752 KB
testcase_09 AC 1,191 ms
10,880 KB
testcase_10 WA -
testcase_11 AC 1,236 ms
10,880 KB
testcase_12 AC 1,277 ms
10,880 KB
testcase_13 AC 1,259 ms
10,880 KB
testcase_14 AC 1,270 ms
10,752 KB
testcase_15 AC 1,258 ms
10,880 KB
testcase_16 AC 1,240 ms
10,752 KB
testcase_17 AC 1,236 ms
10,880 KB
testcase_18 WA -
testcase_19 AC 1,228 ms
10,752 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 1,214 ms
10,880 KB
testcase_24 WA -
testcase_25 AC 1,220 ms
10,880 KB
testcase_26 AC 1,220 ms
10,752 KB
testcase_27 AC 1,223 ms
10,880 KB
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
B=input().split()
mod=998244353
dp=[[[0]*34 for U in range(5)] for c in range(10)]
dp[0][0][0]=1
for a,b in zip(A,B):
    if "X" in b:
        continue
    b=int(b)
    for c in range(9,0,-1):
        for U in range(4,a-1,-1):
            for D in range(33,b-1,-1):
                dp[c][U][D]+=dp[c-1][U-a][D-b]
                dp[c][U][D]%=mod
ans=0
for a,b in zip(A,B):
    if "X" in b:
        if b=="X":
            d=0
        else:
            d=int(b.replace("X",""))
        for U in range(5):
            for D in range(34):
                if (U+a,D+d)==(4,33):
                    if d==0 or U+a>=D+d-4:
                        ans+=dp[8][U+a][D]
                        ans%=mod
print(ans)
0