結果
| 問題 |
No.988 N×Mマス計算(総和)
|
| ユーザー |
horiesiniti
|
| 提出日時 | 2023-02-05 15:58:11 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 202 ms / 2,000 ms |
| コード長 | 210 bytes |
| コンパイル時間 | 86 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 23,552 KB |
| 最終ジャッジ日時 | 2024-07-04 04:42:22 |
| 合計ジャッジ時間 | 3,938 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 19 |
コンパイルメッセージ
Syntax OK
ソースコード
n,m,k=gets.split(" ").map{|e| e.to_i}
xs=gets.chomp.split(" ")
op=xs.shift
s1=xs.map{|e| e.to_i}.sum
ans=0
if op=="+" then
n.times{
ans+=s1+gets.to_i*m
}
else
n.times{
ans+=gets.to_i*s1
}
end
puts ans%k
horiesiniti