結果

問題 No.2356 Back Door Tour in Four Seasons
ユーザー 👑 p-adicp-adic
提出日時 2023-07-27 10:04:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,155 ms / 2,000 ms
コード長 250 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 82,520 KB
実行使用メモリ 193,332 KB
最終ジャッジ日時 2024-04-14 22:39:19
合計ジャッジ時間 23,980 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,500 KB
testcase_01 AC 36 ms
52,124 KB
testcase_02 AC 36 ms
52,372 KB
testcase_03 AC 37 ms
52,460 KB
testcase_04 AC 1,069 ms
193,108 KB
testcase_05 AC 38 ms
53,012 KB
testcase_06 AC 38 ms
52,472 KB
testcase_07 AC 38 ms
52,644 KB
testcase_08 AC 1,076 ms
193,188 KB
testcase_09 AC 1,134 ms
193,140 KB
testcase_10 AC 1,132 ms
193,224 KB
testcase_11 AC 1,140 ms
193,056 KB
testcase_12 AC 1,134 ms
193,164 KB
testcase_13 AC 1,139 ms
192,980 KB
testcase_14 AC 1,138 ms
193,332 KB
testcase_15 AC 614 ms
134,852 KB
testcase_16 AC 1,092 ms
184,436 KB
testcase_17 AC 1,155 ms
187,300 KB
testcase_18 AC 1,039 ms
182,864 KB
testcase_19 AC 632 ms
135,560 KB
testcase_20 AC 1,002 ms
181,032 KB
testcase_21 AC 856 ms
161,992 KB
testcase_22 AC 601 ms
136,044 KB
testcase_23 AC 465 ms
119,104 KB
testcase_24 AC 1,087 ms
187,240 KB
testcase_25 AC 112 ms
78,012 KB
testcase_26 AC 869 ms
161,872 KB
testcase_27 AC 1,060 ms
186,664 KB
testcase_28 AC 37 ms
51,880 KB
testcase_29 AC 36 ms
52,616 KB
testcase_30 AC 1,053 ms
193,284 KB
testcase_31 AC 1,045 ms
193,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

I=input
Q=998244353
N=int(I())
C=[I().split()for n in range(N)]
C=[c+[pow(N-1,int(c[1]),Q),1-pow(N-2,int(c[1]),Q)*pow(N-1,-int(c[1]),Q)*(c[0]!="P")]for c in C]
S="UFWP"
a=1
for c in C:a=a*c[2]%Q
for s in S:a=a*sum((s==c[0])*c[3]for c in C)%Q
print(a)
0