結果

問題 No.2279 OR Insertion
ユーザー 👑 p-adicp-adic
提出日時 2023-07-16 16:10:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 663 ms / 2,000 ms
コード長 317 bytes
コンパイル時間 227 ms
コンパイル使用メモリ 81,676 KB
実行使用メモリ 201,404 KB
最終ジャッジ日時 2023-10-17 14:58:42
合計ジャッジ時間 19,060 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,524 KB
testcase_01 AC 40 ms
53,524 KB
testcase_02 AC 129 ms
90,512 KB
testcase_03 AC 94 ms
82,144 KB
testcase_04 AC 584 ms
189,212 KB
testcase_05 AC 64 ms
70,500 KB
testcase_06 AC 257 ms
120,712 KB
testcase_07 AC 270 ms
125,304 KB
testcase_08 AC 132 ms
91,196 KB
testcase_09 AC 339 ms
140,812 KB
testcase_10 AC 564 ms
185,984 KB
testcase_11 AC 123 ms
88,068 KB
testcase_12 AC 449 ms
161,972 KB
testcase_13 AC 86 ms
80,248 KB
testcase_14 AC 93 ms
81,772 KB
testcase_15 AC 285 ms
129,700 KB
testcase_16 AC 57 ms
66,316 KB
testcase_17 AC 249 ms
119,744 KB
testcase_18 AC 392 ms
151,048 KB
testcase_19 AC 513 ms
174,632 KB
testcase_20 AC 269 ms
125,704 KB
testcase_21 AC 212 ms
112,140 KB
testcase_22 AC 40 ms
53,524 KB
testcase_23 AC 39 ms
53,524 KB
testcase_24 AC 39 ms
53,524 KB
testcase_25 AC 39 ms
53,524 KB
testcase_26 AC 39 ms
53,524 KB
testcase_27 AC 39 ms
53,524 KB
testcase_28 AC 39 ms
53,524 KB
testcase_29 AC 39 ms
53,524 KB
testcase_30 AC 39 ms
53,524 KB
testcase_31 AC 39 ms
53,524 KB
testcase_32 AC 652 ms
201,244 KB
testcase_33 AC 655 ms
201,244 KB
testcase_34 AC 654 ms
201,244 KB
testcase_35 AC 658 ms
201,248 KB
testcase_36 AC 642 ms
201,308 KB
testcase_37 AC 663 ms
201,248 KB
testcase_38 AC 642 ms
201,404 KB
testcase_39 AC 655 ms
201,248 KB
testcase_40 AC 643 ms
201,312 KB
testcase_41 AC 641 ms
201,308 KB
testcase_42 AC 623 ms
201,160 KB
testcase_43 AC 623 ms
201,160 KB
testcase_44 AC 628 ms
201,252 KB
testcase_45 AC 646 ms
201,108 KB
testcase_46 AC 642 ms
201,104 KB
testcase_47 AC 650 ms
201,104 KB
testcase_48 AC 593 ms
201,080 KB
testcase_49 AC 610 ms
201,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

I,R=input,range
N=int(I())
M=R(N)
A=[[0]*N for i in R(N+1)]
B=[0]*N
S=I()
P=998244353
p=[pow(2,i,P)for i in R(N)]
for i in R(1,N+1):
	s=S[N-i]>"0"
	for j in R(i):A[i][j]=B[j]=(B[j]+(S[N-i]>"0" and j>0)*(p[max(0,i-j-2)]-A[i-j-1][j])+[A[i-1][j],p[max(0,i-2)]][1>j and S[N-i]>"0"])%P
print(sum(p[j]*A[N][j]for j in M)%P)
0