結果

問題 No.29 パワーアップ
コンテスト
ユーザー mosmos_21
提出日時 2016-02-14 16:56:28
言語 C90
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 26 ms / 5,000 ms
コード長 332 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 223 ms
コンパイル使用メモリ 29,768 KB
最終ジャッジ日時 2026-02-23 20:35:45
ジャッジサーバーID
(参考情報)
judge1 / judge4
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 #
raw source code

#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