結果

問題 No.1299 Random Array Score
ユーザー horiesiniti
提出日時 2023-02-09 08:02:22
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 166 bytes
コンパイル時間 237 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 26,240 KB
最終ジャッジ日時 2024-07-06 13:34:19
合計ジャッジ時間 6,723 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

n,m=gets.split(" ").map{|e| e.to_i}
m1=998244353
s1=gets.split(" ").map{|e| e.to_i}.sum
ans=s1
r=2
m.digits(2).each{|e|
	ans=(ans*r)%m1 if e==1
	r=(r*r)%m1
}
puts ans
0