結果

問題 No.29 パワーアップ
ユーザー pto8913
提出日時 2020-02-20 22:45:11
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 657 bytes
コンパイル時間 541 ms
コンパイル使用メモリ 63,616 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-08 19:20:19
合計ジャッジ時間 1,396 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#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];
  int a, b, c;
  int count = 0;
  rep(i, 0, n)
  {
    cin >> a >> b >> c;
    --a; --b; --c;

    ++items[a];
    if (items[a] % 2 == 0)
    {
      ++count;
      items[a] = 0;
    }
    ++items[b];
    if (items[b] % 2 == 0) 
    {
      ++count;
      items[b] = 0;
    }
    ++items[c];
    if (items[c] % 2 == 0)
    {
      ++count;
      items[c] = 0;
    }
  }

  int tmp = 0;
  rep(i, 0, 10)
  {
    ++tmp;
    if (tmp % 4 == 0)
    {
      tmp %= 4;
      ++count;
    }
  }
  cout << count << endl;
}
0