結果

問題 No.29 パワーアップ
ユーザー ococonomy1
提出日時 2018-12-22 01:10:36
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 510 bytes
コンパイル時間 542 ms
コンパイル使用メモリ 54,336 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-25 09:51:36
合計ジャッジ時間 1,201 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#define test cout << "test";
using namespace std;

int main(void){
  int item[9],temp;
  cin >> temp;
  const int num = temp;
  for(int i = 0; i < 9; i++)item[i] = 0;
  for(int i = 0; i < num; i++){
    for(int j = 0; j < 3; j++){
      cin >> temp;
      item[temp - 1]++;
    }
  }
  int count = 0;
  temp = 0;
  for(int i = 0; i < 9; i++){
    while(item[i] >= 2){
      count++;
      item[i] -= 2;
    }
    if(item[i] == 1)temp++;
  }
  cout << count + temp / 4 << endl;
  return 0;
}
0