結果

問題 No.988 N×Mマス計算(総和)
ユーザー cielciel
提出日時 2020-02-22 01:20:55
言語 Ruby
(3.3.0)
結果
AC  
実行時間 154 ms / 2,000 ms
コード長 150 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 11,432 KB
実行使用メモリ 29,384 KB
最終ジャッジ日時 2023-09-20 12:09:16
合計ジャッジ時間 3,330 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,156 KB
testcase_01 AC 78 ms
15,132 KB
testcase_02 AC 78 ms
15,252 KB
testcase_03 AC 77 ms
15,004 KB
testcase_04 AC 81 ms
15,092 KB
testcase_05 AC 77 ms
15,080 KB
testcase_06 AC 80 ms
15,048 KB
testcase_07 AC 78 ms
15,148 KB
testcase_08 AC 77 ms
15,136 KB
testcase_09 AC 78 ms
15,204 KB
testcase_10 AC 101 ms
19,028 KB
testcase_11 AC 119 ms
21,740 KB
testcase_12 AC 137 ms
25,736 KB
testcase_13 AC 105 ms
19,848 KB
testcase_14 AC 104 ms
19,592 KB
testcase_15 AC 102 ms
19,196 KB
testcase_16 AC 128 ms
23,440 KB
testcase_17 AC 138 ms
25,760 KB
testcase_18 AC 111 ms
21,076 KB
testcase_19 AC 133 ms
25,244 KB
testcase_20 AC 154 ms
29,384 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a=ARGF.read.split
n,m,k=a.shift(3).map(&:to_i)
op=a.shift
b=a.shift(m).map(&:to_i)
a=a.map(&:to_i)
sa=a.sum
sb=b.sum
p (op=='+' ? m*sa+n*sb : sa*sb)%k
0