結果

問題 No.29 パワーアップ
ユーザー 🐧しゅんチャマ🌸
提出日時 2023-09-21 21:53:45
言語 Java
(openjdk 23)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 463 bytes
コンパイル時間 2,154 ms
コンパイル使用メモリ 74,428 KB
実行使用メモリ 41,924 KB
最終ジャッジ日時 2024-07-07 15:06:06
合計ジャッジ時間 4,991 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Y29{
    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int[] item=new int[11];
        for(int i=0;i<n*3;i++){
            item[sc.nextInt()]++;
        }
        int count=0;
        int ans=0;
        for(int i=1;i<=10;i++){
            ans+=item[i]/2;
            count+=item[i]%2;
        }
        ans+=count/4;
        System.out.println(ans);
    }
}
0