結果

問題 No.29 パワーアップ
コンテスト
ユーザー bal4u
提出日時 2019-04-08 21:16:27
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 389 bytes
コンパイル時間 127 ms
コンパイル使用メモリ 27,084 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-24 21:10:10
合計ジャッジ時間 831 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:12:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |         scanf("%d", &N);
      |         ^~~~~~~~~~~~~~~
main.c:14:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   14 |                 scanf("%d%d%d", &a, &b, &c);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

// yukicoder: No.29 パワーアップ
// 2019.4.8 bal4u

#include <stdio.h>

int f[11];

int main()
{
	int i, k, N, a, b, c, ans;
	
	scanf("%d", &N);
	while (N--) {
		scanf("%d%d%d", &a, &b, &c);
		f[a]++, f[b]++, f[c]++;
	}
	ans = 0;
	for (i = 1; i <= 10; i++) ans += f[i] / 2, f[i] &= 1;
	k = 0; for (i = 1; i <= 10; i++) if (f[i]) k++;
	ans += k / 4;
	printf("%d\n", ans);
	return 0;
}
0