結果

問題 No.29 パワーアップ
ユーザー ミドリムシミドリムシ
提出日時 2017-10-14 15:09:51
言語 C++11
(gcc 13.3.0)
結果
RE  
実行時間 -
コード長 401 bytes
コンパイル時間 417 ms
コンパイル使用メモリ 54,576 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-17 14:37:03
合計ジャッジ時間 3,391 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 RE * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
 
int main(){
	int N;
	cin >> N;
	int items[10];
	for(int i = 0; i < 10; i++){
		items[i] = 0;
	}
	for(int i = 0; i < N * 3; i++){
		int input;
		cin >> input;
		items[input]++;
	}
	int ans = 0;
	int any_item_can_use = 0;
	for(int i = 0; i < 10; i++){
		ans += items[i] / 2;
		any_item_can_use += items[i] % 2;
	}
	cout << ans + any_item_can_use / 4 << endl;
}
0