結果

問題 No.29 パワーアップ
ユーザー Mcpu3
提出日時 2018-07-05 18:47:00
言語 Java
(openjdk 23)
結果
AC  
実行時間 150 ms / 5,000 ms
コード長 429 bytes
コンパイル時間 2,057 ms
コンパイル使用メモリ 74,364 KB
実行使用メモリ 41,884 KB
最終ジャッジ日時 2024-07-01 02:40:03
合計ジャッジ時間 5,990 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class no29{
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int n=stdIn.nextInt(),i,j,t,a[]=new int[10],s=0;
		for(i=0;i<n;i++) {
			for(j=0;j<3;j++) {
				t=stdIn.nextInt();
				a[t-1]++;
			}
		}
		for(i=0;i<10;i++) {
			while(a[i]>1) {
				a[i]-=2;
				s++;
			}
		}
		t=0;
		for(i=0;i<10;i++) t+=a[i];
		s+=t/4;
		System.out.print(s);
	}
}
0