結果

問題 No.988 N×Mマス計算(総和)
ユーザー cielciel
提出日時 2020-02-16 18:51:09
言語 Ruby
(3.3.0)
結果
AC  
実行時間 194 ms / 2,000 ms
コード長 145 bytes
コンパイル時間 38 ms
コンパイル使用メモリ 11,556 KB
実行使用メモリ 29,188 KB
最終ジャッジ日時 2023-09-20 12:06:02
合計ジャッジ時間 3,840 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
外部呼び出し有り
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
15,156 KB
testcase_01 AC 89 ms
15,312 KB
testcase_02 AC 88 ms
15,308 KB
testcase_03 AC 86 ms
15,136 KB
testcase_04 AC 87 ms
15,264 KB
testcase_05 AC 88 ms
15,128 KB
testcase_06 AC 88 ms
15,076 KB
testcase_07 AC 88 ms
15,256 KB
testcase_08 AC 86 ms
15,172 KB
testcase_09 AC 87 ms
15,348 KB
testcase_10 AC 120 ms
19,268 KB
testcase_11 AC 144 ms
21,972 KB
testcase_12 AC 171 ms
25,764 KB
testcase_13 AC 125 ms
19,888 KB
testcase_14 AC 122 ms
19,516 KB
testcase_15 AC 120 ms
19,292 KB
testcase_16 AC 162 ms
23,860 KB
testcase_17 AC 174 ms
25,864 KB
testcase_18 AC 133 ms
21,116 KB
testcase_19 AC 164 ms
25,040 KB
testcase_20 AC 194 ms
29,188 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a=`dd`.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