結果

問題 No.29 パワーアップ
ユーザー mosmos_21mosmos_21
提出日時 2016-02-14 16:56:28
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 332 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 21,388 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-22 05:15:13
合計ジャッジ時間 1,593 ms
ジャッジサーバーID
(参考情報)
judge9 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 0 ms
4,348 KB
testcase_03 AC 0 ms
4,348 KB
testcase_04 AC 0 ms
4,348 KB
testcase_05 AC 0 ms
4,348 KB
testcase_06 AC 0 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 0 ms
4,348 KB
testcase_09 AC 0 ms
4,348 KB
testcase_10 AC 0 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 0 ms
4,348 KB
testcase_13 AC 1 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 1 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:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%d", &N);
      |         ^~~~~~~~~~~~~~~
main.c:11:25: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |                         scanf("%d", &t);
      |                         ^~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(){
	int N,item[11] = {0}, sum = 0;
	int i, j, t, s = 0;

	scanf("%d", &N);

	for(i = 0; i < N; i++){
		for(j = 0; j < 3; j++){
			scanf("%d", &t);
			item[t] ++;
			if(item[t] == 2){
				item[t] = 0;
				sum++;
			}
		}
	}
	for(i = 1; i < 11; i++)
		s += item[i];
	sum += s / 4;

	printf("%d\n", sum);
}
0