結果
問題 | No.29 パワーアップ |
ユーザー |
|
提出日時 | 2020-02-20 23:16:32 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 438 bytes |
コンパイル時間 | 874 ms |
コンパイル使用メモリ | 63,744 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-08 19:22:46 |
合計ジャッジ時間 | 1,868 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
#include <iostream> using namespace std; #define rep(i, a, n) for(int i = a; i < (n); ++i) int main(){ int n; cin >> n; int items[10] = {0}; int a, b, c; int count = 0; rep(i, 0, n) { cin >> a >> b >> c; --a; --b; --c; ++items[a]; ++items[b]; ++items[c]; } int tmp = 0; rep(i, 0, 10) { count += (int)(items[i]/2); tmp += (items[i]%2); } printf("%d\n", count + (int)(tmp / 4)); }