結果

問題 No.29 パワーアップ
ユーザー lrf141
提出日時 2017-03-25 22:52:08
言語 Scala(Beta)
(3.6.2)
結果
AC  
実行時間 971 ms / 5,000 ms
コード長 484 bytes
コンパイル時間 8,896 ms
コンパイル使用メモリ 271,184 KB
実行使用メモリ 64,252 KB
最終ジャッジ日時 2024-06-30 00:54:52
合計ジャッジ時間 31,174 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

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:Array[Int] = Array.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