結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
mono1977
|
| 提出日時 | 2016-12-01 12:05:32 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| + 253µs | |
| コード長 | 568 bytes |
| 記録 | |
| コンパイル時間 | 87 ms |
| コンパイル使用メモリ | 40,192 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-15 21:46:49 |
| 合計ジャッジ時間 | 1,287 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#include<stdio.h>
int main(){
int n;
scanf("%d",&n);
int item[11]={0};
int total=0,i;
int a,b,c;
for(i=0;i<n;i++){
scanf("%d %d %d",&a,&b,&c);
item[a]++;
item[b]++;
item[c]++;
total += 3;
}
int min=total/4; //最低でもこれだけパワーアップできる
int temp=0;
for(i=1;i<=10;i++){//各アイテムを二個使うパワーアップ
a=item[i]/2;
temp += a;
total-=2*a;
}
temp += total/4;//残りアイテム4個使うパワーアップ
if(temp>min){
printf("%d\n",temp);
}else{
printf("%d\n",min);
}
return 0;
}
mono1977