結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,092 KB
testcase_01 AC 79 ms
15,088 KB
testcase_02 AC 78 ms
15,080 KB
testcase_03 AC 78 ms
15,036 KB
testcase_04 AC 79 ms
15,028 KB
testcase_05 AC 78 ms
15,032 KB
testcase_06 AC 82 ms
15,244 KB
testcase_07 AC 78 ms
15,164 KB
testcase_08 AC 79 ms
15,028 KB
testcase_09 AC 78 ms
15,248 KB
testcase_10 AC 101 ms
19,068 KB
testcase_11 AC 118 ms
21,868 KB
testcase_12 AC 136 ms
25,552 KB
testcase_13 AC 105 ms
19,860 KB
testcase_14 AC 103 ms
19,604 KB
testcase_15 AC 101 ms
19,304 KB
testcase_16 AC 128 ms
23,688 KB
testcase_17 AC 138 ms
26,048 KB
testcase_18 AC 110 ms
21,332 KB
testcase_19 AC 133 ms
24,984 KB
testcase_20 AC 157 ms
29,436 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).sum
a=a.map(&:to_i).sum
p (o=='+'?m*a+n*b:a*b)%k
0