結果
問題 | No.29 パワーアップ |
ユーザー |
|
提出日時 | 2024-04-26 13:55:24 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 356 bytes |
コンパイル時間 | 1,692 ms |
コンパイル使用メモリ | 194,252 KB |
最終ジャッジ日時 | 2025-02-21 09:06:38 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<int> items(10,0); while(n--){ for(int i=0;i<3;i++){ int a; cin >> a; items[a-1]++; } } int power_up=0; int residue=0; for(int i=0;i<10;i++){ power_up+=items[i]/2; residue+=items[i]%2; } power_up+=residue/4; cout << power_up << endl; return 0; }