結果

問題 No.1343 Dividing Digit
ユーザー maguroflymagurofly
提出日時 2021-01-16 13:10:39
言語 Ruby
(3.3.0)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 114 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 11,456 KB
実行使用メモリ 21,464 KB
最終ジャッジ日時 2023-08-18 09:18:11
合計ジャッジ時間 4,483 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,236 KB
testcase_01 AC 80 ms
15,112 KB
testcase_02 AC 80 ms
15,272 KB
testcase_03 AC 133 ms
21,096 KB
testcase_04 AC 85 ms
15,376 KB
testcase_05 AC 95 ms
16,660 KB
testcase_06 AC 89 ms
15,796 KB
testcase_07 AC 98 ms
17,144 KB
testcase_08 AC 116 ms
19,628 KB
testcase_09 AC 119 ms
20,412 KB
testcase_10 AC 87 ms
15,536 KB
testcase_11 AC 98 ms
17,064 KB
testcase_12 AC 111 ms
19,304 KB
testcase_13 AC 108 ms
19,056 KB
testcase_14 AC 86 ms
15,500 KB
testcase_15 AC 96 ms
16,904 KB
testcase_16 AC 86 ms
15,652 KB
testcase_17 AC 116 ms
20,192 KB
testcase_18 AC 129 ms
21,176 KB
testcase_19 AC 110 ms
19,096 KB
testcase_20 AC 102 ms
17,812 KB
testcase_21 AC 118 ms
20,116 KB
testcase_22 AC 118 ms
20,020 KB
testcase_23 AC 130 ms
21,464 KB
testcase_24 AC 129 ms
20,992 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N, K = gets.split.map(&:to_i)
A = gets.split.map(&:to_i)
M = A.sum
puts A.inject(0) { |sum, x| (sum * K + x) % M }
0