結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
A63635985
|
| 提出日時 | 2018-03-04 09:41:38 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| + 328µs | |
| コード長 | 898 bytes |
| 記録 | |
| コンパイル時間 | 399 ms |
| コンパイル使用メモリ | 84,312 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-15 22:02:25 |
| 合計ジャッジ時間 | 1,622 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#include <iostream>
#include <map>
using namespace std;
int main(){
int N;
cin >> N;
map<int,int> item;
int counter=0;
for(int i=0 ; i<N ; i++ ){
int x;
cin >> x;item[x]++;
if(item[x]>1){
counter++;
item[x]-=2;
}
cin >> x;item[x]++;
if(item[x]>1){
counter++;
item[x]-=2;
}
cin >> x;item[x]++;
if(item[x]>=2){
counter++;
item[x]-=2;
}
}
// cout << N*3 << " "<<counter << endl;
if((2*counter)<(N*3))
cout << counter+((N*3)-(2*counter))/4 << endl;
else
cout<<counter << endl;
return 0;
}
A63635985