結果

問題 No.1299 Random Array Score
ユーザー universatouniversato
提出日時 2020-11-27 23:11:12
言語 Crystal
(1.11.2)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 535 bytes
コンパイル時間 17,498 ms
コンパイル使用メモリ 262,068 KB
実行使用メモリ 31,744 KB
最終ジャッジ日時 2023-09-13 12:49:12
合計ジャッジ時間 21,697 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,844 KB
testcase_01 AC 3 ms
4,640 KB
testcase_02 AC 3 ms
4,800 KB
testcase_03 AC 107 ms
31,744 KB
testcase_04 AC 105 ms
30,560 KB
testcase_05 AC 80 ms
26,084 KB
testcase_06 AC 69 ms
24,716 KB
testcase_07 AC 73 ms
24,544 KB
testcase_08 AC 105 ms
31,308 KB
testcase_09 AC 6 ms
5,724 KB
testcase_10 AC 41 ms
16,560 KB
testcase_11 AC 13 ms
7,504 KB
testcase_12 AC 67 ms
21,224 KB
testcase_13 AC 100 ms
30,524 KB
testcase_14 AC 70 ms
24,256 KB
testcase_15 AC 70 ms
24,044 KB
testcase_16 AC 70 ms
24,848 KB
testcase_17 AC 16 ms
9,212 KB
testcase_18 AC 47 ms
17,828 KB
testcase_19 AC 52 ms
17,748 KB
testcase_20 AC 29 ms
12,040 KB
testcase_21 AC 4 ms
5,476 KB
testcase_22 AC 18 ms
9,088 KB
testcase_23 AC 70 ms
24,516 KB
testcase_24 AC 81 ms
24,348 KB
testcase_25 AC 70 ms
24,132 KB
testcase_26 AC 4 ms
5,396 KB
testcase_27 AC 21 ms
9,948 KB
testcase_28 AC 15 ms
8,344 KB
testcase_29 AC 24 ms
10,212 KB
testcase_30 AC 70 ms
22,832 KB
testcase_31 AC 25 ms
11,536 KB
testcase_32 AC 100 ms
31,092 KB
testcase_33 AC 111 ms
31,400 KB
testcase_34 AC 56 ms
25,276 KB
testcase_35 AC 111 ms
31,400 KB
testcase_36 AC 56 ms
25,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

lib C;fun strtoll(s: UInt8*,p: UInt8**,b: Int32): Int64;end
class String;def to_i64;C.strtoll(self,nil,10);end;end

require "big"

struct Int
  def pow(n : Int, mod = nil ) : Int
    a = to_i64
    res = 1_i64
    while n > 0
      if (n & 1) != 0
        res *= a
        res %= mod if mod
      end
      a *= a
      a %= mod if mod
      n >>= 1
    end
    res
  end
end

mod = 998244353i64

n, k = gets.to_s.split.map{ |e| e.to_big_i }
a    = gets.to_s.split.map{ |e| e.to_big_i }

p a.sum.to_big_i * 2.to_big_i.pow(k, mod) % mod
0