結果

問題 No.29 パワーアップ
コンテスト
ユーザー 🐧しゅんチャマ🌸
提出日時 2023-09-21 21:53:45
言語 Java
(openjdk 23)
結果
AC  
実行時間 135 ms / 5,000 ms
コード長 463 bytes
コンパイル時間 2,027 ms
コンパイル使用メモリ 77,272 KB
実行使用メモリ 46,780 KB
最終ジャッジ日時 2025-10-24 21:20:01
合計ジャッジ時間 5,538 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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