結果

問題 No.29 パワーアップ
ユーザー lrf141lrf141
提出日時 2017-03-25 16:44:38
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 1,024 ms / 5,000 ms
コード長 494 bytes
コンパイル時間 9,815 ms
コンパイル使用メモリ 246,028 KB
実行使用メモリ 63,560 KB
最終ジャッジ日時 2023-09-12 12:30:55
合計ジャッジ時間 34,124 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,010 ms
62,900 KB
testcase_01 AC 1,004 ms
62,880 KB
testcase_02 AC 1,001 ms
62,904 KB
testcase_03 AC 997 ms
63,208 KB
testcase_04 AC 1,002 ms
62,996 KB
testcase_05 AC 1,024 ms
62,948 KB
testcase_06 AC 1,011 ms
63,016 KB
testcase_07 AC 1,012 ms
63,384 KB
testcase_08 AC 1,002 ms
63,124 KB
testcase_09 AC 1,002 ms
62,808 KB
testcase_10 AC 1,015 ms
62,952 KB
testcase_11 AC 1,017 ms
63,560 KB
testcase_12 AC 1,001 ms
63,052 KB
testcase_13 AC 1,019 ms
63,252 KB
testcase_14 AC 1,024 ms
62,912 KB
testcase_15 AC 1,016 ms
62,968 KB
testcase_16 AC 1,003 ms
63,132 KB
testcase_17 AC 997 ms
63,092 KB
testcase_18 AC 1,018 ms
63,052 KB
testcase_19 AC 1,020 ms
62,868 KB
testcase_20 AC 998 ms
63,336 KB
testcase_21 AC 991 ms
63,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner
import scala.collection.mutable.ListBuffer
object no29{
    def main(args:Array[String]):Unit={
        val scan:Scanner = new Scanner(System.in)
        val list:ListBuffer[Int] = ListBuffer.fill(10)(0)
        val n:Int = scan.nextInt
        for(i <- 1 to 3*n){
            list(scan.nextInt-1)+=1
        }
        var res:Int = 0
        for(i <- 1 to 10){
            res += list(i-1)/2
            list(i-1) %= 2
        }
        println(res+list.sum/4)
    }
}
0