結果
問題 |
No.29 パワーアップ
|
ユーザー |
![]() |
提出日時 | 2020-08-05 04:18:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 614 bytes |
コンパイル時間 | 1,230 ms |
コンパイル使用メモリ | 99,780 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-15 06:22:39 |
合計ジャッジ時間 | 1,997 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
#pragma GCC optimize("Ofast") #include<iostream> #include<stdio.h> #include<algorithm> #include<vector> #include<string.h> #include<math.h> #include<map> #include<iomanip> #include<queue> using namespace std; int main(){ int n; cin >> n; vector<int> check(11,0); for(int i=0;i<n;i++){ for(int j=0;j<3;j++){ int now; cin >> now; check[now]++; } } int ans=0; for(int i=1;i<=10;i++){ int point=check[i]/2; ans+=point; check[i]-=point*2; } int cnt=0; for(int i=1;i<=10;i++){ if(check[i]==1){ cnt++; } if(cnt==4){ ans++; cnt=0; } } cout << ans << endl; return 0; }