結果
| 問題 | No.29 パワーアップ | 
| コンテスト | |
| ユーザー |  piyoko_212 | 
| 提出日時 | 2015-12-28 23:56:33 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1 ms / 5,000 ms | 
| コード長 | 287 bytes | 
| コンパイル時間 | 206 ms | 
| コンパイル使用メモリ | 42,316 KB | 
| 実行使用メモリ | 7,716 KB | 
| 最終ジャッジ日時 | 2025-10-24 20:55:29 | 
| 合計ジャッジ時間 | 1,084 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 22 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:20: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         int a;scanf("%d",&a);
      |               ~~~~~^~~~~~~~~
main.cpp:8:28: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |                 int t;scanf("%d",&t);t--;
      |                       ~~~~~^~~~~~~~~
            
            ソースコード
#include<stdio.h>
#include<algorithm>
using namespace std;
int s[20];
int main(){
	int a;scanf("%d",&a);
	for(int i=0;i<a*3;i++){
		int t;scanf("%d",&t);t--;
		s[t]++;
	}
	int cnt=0;
	int ret=0;
	for(int i=0;i<10;i++){
		ret+=s[i]/2;
		cnt+=s[i]%2;
	}
	ret+=cnt/4;
	printf("%d\n",ret);
}
            
            
            
        