結果

問題 No.29 パワーアップ
ユーザー Suunn
提出日時 2018-11-20 05:16:53
言語 Java
(openjdk 23)
結果
AC  
実行時間 141 ms / 5,000 ms
コード長 428 bytes
コンパイル時間 2,260 ms
コンパイル使用メモリ 74,268 KB
実行使用メモリ 41,848 KB
最終ジャッジ日時 2024-12-24 15:22:51
合計ジャッジ時間 5,729 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
	

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