結果

問題 No.29 パワーアップ
ユーザー Mcpu3Mcpu3
提出日時 2018-07-05 17:20:33
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 451 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 28,496 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-13 17:54:33
合計ジャッジ時間 1,014 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,376 KB
testcase_01 AC 0 ms
4,376 KB
testcase_02 AC 0 ms
4,376 KB
testcase_03 AC 0 ms
4,380 KB
testcase_04 AC 0 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 0 ms
4,380 KB
testcase_10 AC 0 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 0 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 0 ms
4,376 KB
testcase_15 AC 0 ms
4,376 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 1 ms
4,504 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 0 ms
4,376 KB
testcase_20 AC 1 ms
4,380 KB
testcase_21 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/*

1 2 3 4 5 6 7 8 9 10

2 2 2 2 2 1 1 1 1 1


1 2 3 4 5 6 7 8 9 10

9 0 0 0 0 0 0 0 0 0


1 2 3 4 5 6 7 8 9 10

3 2 1 1 1 0 0 0 1 0

*/

#include <stdio.h>

int main(void)
{
	int n,i,j,a[10]={0},b,c,d,t=0,s=0;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d%d%d",&b,&c,&d);
		a[b-1]++;
		a[c-1]++;
		a[d-1]++;
	}
	for(j=0;j<10;j++){
		while(a[j]>1){
			a[j]-=2;
			s++;
		}
	}
	for(i=0;i<10;i++){
		t+=a[i];
	}
	s+=t/4;
	printf("%d",s);
	return 0;
}
0