結果

問題 No.120 傾向と対策:門松列(その1)
ユーザー ki_ki33ki_ki33
提出日時 2015-01-08 23:55:07
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 1,582 bytes
コンパイル時間 2,655 ms
コンパイル使用メモリ 78,684 KB
実行使用メモリ 58,208 KB
最終ジャッジ日時 2023-09-03 22:45:00
合計ジャッジ時間 3,545 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedInputStream;
import java.io.IOException;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;
import java.util.Map.Entry;

public class Main {
	public static final int C =  1000000007;
	//static boolean MAP[][];
	static int N;
	static int Q;
	static int MAX = -1;
	//static int tic[][];
	static boolean NUM[];
	//static int max;
	static int A[];
	static int ST[][];
	//static int p[];
	//static ArrayList<HashSet<Integer>> al;
	static TreeMap<Integer, ArrayList<Integer>> hm;
	//static ArrayList<Integer> al;
	//static int a[][];
	//static char[][] ch;
	//static ArrayList<HashMap<Long, Long>> al;
	//static String a[];
	//static String str;
	//static int[] mach = new int[] {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};

	public static void main(String[] args) {
		StringBuilder sb = new StringBuilder();
		BufferedInputStream bs = new BufferedInputStream(System.in);
		Scanner sc = new Scanner(bs);
		
		
		int T = sc.nextInt();

		int n[] = new int[T];
		int a[][] = new int[T][101];
		for (int t=0; t < T; t++) {
			n[t] = sc.nextInt();
			//a[i] = new int[n[i]];
			for (int i = 0; i < n[t]; i++) {
				a[t][sc.nextInt()]++;
			}
		}
		//N = sc.nextInt();
		
		
		
		int ans[] = new int[T];
		
		for (int t=0; t < T; t++) {
			int num = 0;
			for (int i=1; i <= 100; i++) {
				if (a[t][i] == 0)continue;
				a[t][i]--;
				num++;
				if (num == 3) {
					ans[t]++;
					num = 0;
					i=0;
				}
			}
		}
		
		for (int i=0; i < T; i++) {
			sb.append(ans[i]+ "\n");
		}
		System.out.print(sb);
		


	}
	
	
	

}
0