結果

問題 No.988 N×Mマス計算(総和)
ユーザー rhincodon66rhincodon66
提出日時 2020-02-14 21:38:58
言語 Kotlin
(1.9.23)
結果
TLE  
実行時間 -
コード長 490 bytes
コンパイル時間 12,932 ms
コンパイル使用メモリ 421,292 KB
実行使用メモリ 55,100 KB
最終ジャッジ日時 2023-09-20 11:39:50
合計ジャッジ時間 21,064 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 284 ms
55,100 KB
testcase_01 AC 283 ms
53,012 KB
testcase_02 AC 291 ms
53,092 KB
testcase_03 AC 287 ms
53,128 KB
testcase_04 AC 289 ms
53,108 KB
testcase_05 AC 300 ms
53,004 KB
testcase_06 AC 294 ms
52,912 KB
testcase_07 AC 296 ms
52,992 KB
testcase_08 AC 293 ms
52,920 KB
testcase_09 AC 290 ms
53,216 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:3:10: warning: parameter 'args' is never used
fun main(args:Array<String>){
         ^

ソースコード

diff #

import java.util.*

fun main(args:Array<String>){
    val (n,m,k) = readLine()!!.split(" ").map{it.toInt()}
    val tmp = readLine()!!.split(" ")
    val op = tmp[0]
    val b = tmp.drop(1).map{it.toLong()}
    val a = LongArray(n)
    for(i in 0 until n){
        a[i] = readLine()!!.toLong()
    }
    var ans = 0L
    for(i in 0 until n){
        for(j in 0 until m) {
            ans += if (op == "+") a[i] + b[j] else a[i] * b[j]
            ans %= k
        }
    }
    println(ans)
}
0