結果
問題 | No.988 N×Mマス計算(総和) |
ユーザー | gemmaro |
提出日時 | 2020-02-14 22:15:08 |
言語 | Ruby (3.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 597 bytes |
コンパイル時間 | 507 ms |
コンパイル使用メモリ | 11,440 KB |
実行使用メモリ | 93,316 KB |
最終ジャッジ日時 | 2023-09-20 11:58:49 |
合計ジャッジ時間 | 5,513 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 82 ms
19,628 KB |
testcase_01 | AC | 82 ms
15,260 KB |
testcase_02 | AC | 84 ms
15,092 KB |
testcase_03 | AC | 82 ms
15,164 KB |
testcase_04 | AC | 81 ms
15,088 KB |
testcase_05 | AC | 82 ms
15,184 KB |
testcase_06 | AC | 81 ms
15,092 KB |
testcase_07 | AC | 82 ms
15,248 KB |
testcase_08 | AC | 81 ms
15,164 KB |
testcase_09 | AC | 81 ms
15,136 KB |
testcase_10 | TLE | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
コンパイルメッセージ
Syntax OK
ソースコード
# frozen_string_literal: true N, M, K = gets.chomp.split.map(&:to_i) ROW = gets.chomp.split OP = ROW[0].intern BS = ROW[1..-1].map(&:to_i) AS = N.times.map do gets.to_i end puts(case OP when :+ AS.map do |a| BS.map do |b| (a + b) % K end.sum % K end.sum % K when :* AS.map do |a| if (a % K).zero? 0 else BS.map do |b| if (b % K).zero? 0 else (a * b) % K end end.sum % K end end.sum % K end)