結果

問題 No.29 パワーアップ
ユーザー A63295A63295
提出日時 2016-01-03 16:26:27
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 577 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 21,856 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 14:40:24
合計ジャッジ時間 1,801 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 0 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 0 ms
4,348 KB
testcase_08 AC 0 ms
4,348 KB
testcase_09 AC 0 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 0 ms
4,348 KB
testcase_13 AC 0 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 0 ms
4,348 KB
testcase_16 AC 0 ms
4,348 KB
testcase_17 AC 0 ms
4,348 KB
testcase_18 AC 1 ms
4,348 KB
testcase_19 AC 0 ms
4,348 KB
testcase_20 AC 0 ms
4,348 KB
testcase_21 AC 0 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 | scanf ("%d", &N);
      | ^~~~~~~~~~~~~~~~
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         scanf ("%d%d%d", &a[i][0], &a[i][1], &a[i][2]);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
int main(void){
int N;
int a[100][3] = {};
int i, j = 0, k = 0, goukei = 0, hanntei[10] = {};
scanf ("%d", &N);
for ( i = 0; i < N; i++)
	scanf ("%d%d%d", &a[i][0], &a[i][1], &a[i][2]);

for ( i = 0; i < N; i++){
	hanntei[a[i][0] - 1] += 1;
	hanntei[a[i][1] - 1] += 1;
	hanntei[a[i][2] - 1] += 1;

}
for ( i = 0; i < 10; i++){
	if ( hanntei[i] > 1){
		goukei += hanntei[i] / 2;
		hanntei[i] -= hanntei[i] / 2 * 2;

	}
}
for ( i = 0; i < 10; i++){
	if ( hanntei[i] == 1)
		j += 1;
	if ( j == 4){
		goukei += 1;
		j = 0;
	}
}
printf ("%d", goukei);
	return 0;
}
0