結果

問題 No.516 赤と青の風船
ユーザー R_FR_F
提出日時 2017-12-02 17:04:02
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 320 ms / 2,000 ms
コード長 435 bytes
コンパイル時間 11,753 ms
コンパイル使用メモリ 418,600 KB
実行使用メモリ 53,684 KB
最終ジャッジ日時 2023-08-12 21:29:34
合計ジャッジ時間 15,514 ms
ジャッジサーバーID
(参考情報)
judge12 / judge7
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 320 ms
53,620 KB
testcase_01 AC 308 ms
53,484 KB
testcase_02 AC 319 ms
53,684 KB
testcase_03 AC 317 ms
53,680 KB
testcase_04 AC 312 ms
53,448 KB
testcase_05 AC 314 ms
53,288 KB
testcase_06 AC 312 ms
53,424 KB
testcase_07 AC 309 ms
53,544 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:19:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

import java.util.Scanner

data class Count(var red: Int, var blue: Int)

class No516() {
	val input = Scanner(System. `in`)
	val count = Count(0, 0)

	fun colorCount(): String {
		for (i in 0..2) {
			val color = input.next()
			if (color == "RED") count.red++ else count.blue++
		}
		if (count.red < count.blue) return "BLUE" else return "RED"
	}

}

fun main(args: Array<String>) {
	val no516 = No516()
	println(no516.colorCount())
}
0