結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,380 KB
testcase_01 AC 38 ms
52,676 KB
testcase_02 AC 38 ms
52,464 KB
testcase_03 AC 37 ms
52,160 KB
testcase_04 AC 1,071 ms
193,224 KB
testcase_05 AC 37 ms
52,196 KB
testcase_06 AC 38 ms
52,628 KB
testcase_07 AC 37 ms
52,400 KB
testcase_08 AC 1,069 ms
193,272 KB
testcase_09 AC 1,127 ms
193,260 KB
testcase_10 AC 1,138 ms
192,896 KB
testcase_11 AC 1,142 ms
192,844 KB
testcase_12 AC 1,148 ms
192,988 KB
testcase_13 AC 1,122 ms
193,160 KB
testcase_14 AC 1,126 ms
193,104 KB
testcase_15 AC 619 ms
134,700 KB
testcase_16 AC 1,085 ms
184,496 KB
testcase_17 AC 1,146 ms
187,304 KB
testcase_18 AC 1,032 ms
183,012 KB
testcase_19 AC 635 ms
136,056 KB
testcase_20 AC 1,018 ms
181,100 KB
testcase_21 AC 861 ms
162,148 KB
testcase_22 AC 606 ms
135,240 KB
testcase_23 AC 471 ms
119,008 KB
testcase_24 AC 1,095 ms
187,236 KB
testcase_25 AC 117 ms
78,180 KB
testcase_26 AC 884 ms
161,820 KB
testcase_27 AC 1,065 ms
186,568 KB
testcase_28 AC 38 ms
53,632 KB
testcase_29 AC 37 ms
52,344 KB
testcase_30 AC 1,051 ms
193,224 KB
testcase_31 AC 1,054 ms
192,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

I,R=input,range
Q=998244353
N=int(I())
C=[I().split()for n in R(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