結果

問題 No.988 N×Mマス計算(総和)
ユーザー c-yanc-yan
提出日時 2020-07-31 01:08:54
言語 Ruby
(3.3.0)
結果
AC  
実行時間 153 ms / 2,000 ms
コード長 133 bytes
コンパイル時間 39 ms
コンパイル使用メモリ 11,360 KB
実行使用メモリ 29,216 KB
最終ジャッジ日時 2023-09-20 12:44:46
合計ジャッジ時間 3,317 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,044 KB
testcase_01 AC 79 ms
15,176 KB
testcase_02 AC 78 ms
15,292 KB
testcase_03 AC 77 ms
15,284 KB
testcase_04 AC 78 ms
15,144 KB
testcase_05 AC 78 ms
15,120 KB
testcase_06 AC 79 ms
15,252 KB
testcase_07 AC 78 ms
15,148 KB
testcase_08 AC 79 ms
15,288 KB
testcase_09 AC 81 ms
15,244 KB
testcase_10 AC 102 ms
19,032 KB
testcase_11 AC 123 ms
21,904 KB
testcase_12 AC 141 ms
25,544 KB
testcase_13 AC 104 ms
19,768 KB
testcase_14 AC 104 ms
19,600 KB
testcase_15 AC 103 ms
19,052 KB
testcase_16 AC 129 ms
23,672 KB
testcase_17 AC 137 ms
25,836 KB
testcase_18 AC 108 ms
21,340 KB
testcase_19 AC 134 ms
25,248 KB
testcase_20 AC 153 ms
29,216 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a=$<.read.split
n,m,k=a.shift(3).map &:to_i
o=a.shift
b=a.shift(m).map &:to_i
a=a.map &:to_i
s=a.sum
t=b.sum
p (o=='+'?m*s+n*t:s*t)%k
0