結果
問題 | No.29 パワーアップ |
ユーザー |
![]() |
提出日時 | 2014-11-02 17:51:10 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 595 bytes |
コンパイル時間 | 722 ms |
コンパイル使用メモリ | 65,080 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-30 16:22:52 |
合計ジャッジ時間 | 1,574 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
#include<iostream> #include<cstdio> #include<string> #include<vector> #include<queue> #include<set> #include<sstream> #include<algorithm> using namespace std; #define ALL(x) (x).begin(),(x).end() #define RALL(x) (x).rbegin(), (x).rend() #define rep(i,n) for(int i=0;i<n;i++) #define rev(j,m) for(int j=1;j<m;j++) typedef vector<pair<int,int> > pii; int main(){ int n,x,A[10]={0},sum=0,ans=0; cin >> n; rep(i,n){ rep(j,3){ cin >> x; A[x-1]++; } } rep(i,10){ ans+=A[i]/2; A[i]%=2; sum+=A[i]; } cout << ans+sum/4 << endl; return 0; }