結果

問題 No.1239 Multiplication -2
ユーザー tailstails
提出日時 2020-09-28 19:37:44
言語 Bash
(Bash 5.1.16)
結果
TLE  
実行時間 -
コード長 236 bytes
コンパイル時間 356 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 27,072 KB
最終ジャッジ日時 2023-09-15 05:04:59
合計ジャッジ時間 9,425 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,752 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 42 ms
4,376 KB
testcase_04 AC 41 ms
4,376 KB
testcase_05 AC 47 ms
4,376 KB
testcase_06 AC 16 ms
4,380 KB
testcase_07 AC 14 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 3 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 1,434 ms
9,168 KB
testcase_16 TLE -
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

m=998244353
b=1
q=1
r='m+1>>1'
read a
read a
for a in $a;{((
	b+=q, b-=b<m?0:m,
	q+=q, q-=q<m?0:m,
	r=r*(m+1>>1)%m,
	a || (b=c=d=e=0),
	a<0 && (t=b,b=c,c=t,t=d,d=e,e=t),
	(a&3)==2 && (d=b,e=c,b=c=0),
	z=(z+e*r)%m
));}
echo $[(z+e*r)%m]
0