結果

問題 No.216 FAC
ユーザー javyjavy
提出日時 2015-11-13 01:52:27
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 328 ms / 1,000 ms
コード長 1,327 bytes
コンパイル時間 13,809 ms
コンパイル使用メモリ 435,724 KB
実行使用メモリ 57,168 KB
最終ジャッジ日時 2024-04-30 07:14:34
合計ジャッジ時間 23,168 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 311 ms
56,808 KB
testcase_01 AC 315 ms
56,804 KB
testcase_02 AC 312 ms
56,952 KB
testcase_03 AC 315 ms
56,996 KB
testcase_04 AC 313 ms
56,656 KB
testcase_05 AC 311 ms
56,820 KB
testcase_06 AC 311 ms
56,976 KB
testcase_07 AC 314 ms
56,972 KB
testcase_08 AC 312 ms
56,828 KB
testcase_09 AC 314 ms
56,812 KB
testcase_10 AC 312 ms
56,828 KB
testcase_11 AC 315 ms
56,912 KB
testcase_12 AC 313 ms
56,900 KB
testcase_13 AC 315 ms
56,812 KB
testcase_14 AC 317 ms
56,912 KB
testcase_15 AC 316 ms
56,852 KB
testcase_16 AC 320 ms
56,992 KB
testcase_17 AC 320 ms
57,156 KB
testcase_18 AC 321 ms
56,960 KB
testcase_19 AC 322 ms
56,996 KB
testcase_20 AC 325 ms
57,068 KB
testcase_21 AC 328 ms
57,168 KB
testcase_22 AC 321 ms
57,108 KB
testcase_23 AC 323 ms
57,044 KB
testcase_24 AC 320 ms
56,984 KB
testcase_25 AC 319 ms
57,060 KB
testcase_26 AC 320 ms
56,948 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:6:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

package Yukicoder

/**
 * Created by hichikawa on 2015/11/12.
 */
fun main(args: Array<String>) {
    fun readLineLongArray() : List<Long> {
        val str = readLine() as String
        val arrStr = str.split(" ")
        val ret = arrStr.map { it.toLong() }
        return ret
    }
    fun readLineLong() : Long {
        val str = readLine() as String
        return str.toLong()
    }
    fun readLineInt() : Int {
        val str = readLine() as String
        return str.toInt()
    }
    fun readLineIntArray() : List<Int> {
        val str = readLine() as String
        val arrStr = str.split(" ")
        val ret = arrStr.map { it.toInt() }
        return ret
    }

    val num = readLineInt()
    var numArrPorsonPoint = Array(100, {0})
    val pointArr = readLineIntArray()
    val answerPerson = readLineIntArray()
    var maxPoint = 0
    var gattablePoint = 0
    for (i in 0..(num-1)) {
        if (answerPerson[i] == 0) {
            gattablePoint += pointArr[i]
        } else {
            numArrPorsonPoint[answerPerson[i]-1] += pointArr[i]
            if (numArrPorsonPoint[answerPerson[i]-1] > maxPoint) {
                maxPoint = numArrPorsonPoint[answerPerson[i]-1]
            }
        }
    }
    if (gattablePoint >= maxPoint) {
        println("YES")
    } else {
        println("NO")
    }
}
0