結果
問題 | No.29 パワーアップ |
ユーザー |
![]() |
提出日時 | 2014-11-16 23:07:21 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 434 bytes |
コンパイル時間 | 242 ms |
コンパイル使用メモリ | 23,040 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-31 21:19:02 |
合計ジャッジ時間 | 1,177 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:7:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d", &N); | ~~~~~^~~~~~~~~~ main.cpp:11:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | scanf("%d %d %d", &a, &b, &c); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <cstdio>int counter[11];int main(){int N;scanf("%d", &N);for(int i=0;i<N;i++){int a, b, c;scanf("%d %d %d", &a, &b, &c);counter[a] += 1;counter[b] += 1;counter[c] += 1;}int res = 0, sum = 0;for(int i=1;i<=10;i++){res += counter[i] / 2;sum += counter[i] % 2;}printf("%d\n", res + sum/4);}