結果

問題 No.24 数当てゲーム
ユーザー ninoinui
提出日時 2020-07-23 09:52:57
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 464 bytes
コンパイル時間 1,985 ms
コンパイル使用メモリ 194,628 KB
最終ジャッジ日時 2025-01-12 04:10:10
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> V(10);
  for (int i = 0; i < N; i++) {
    vector<int> tmp(4);
    for (int i = 0; i < 4; i++) cin >> tmp.at(i);
    string s;
    cin >> s;
    if (s == "NO") for (auto t : tmp) V.at(t)--;
    else for (auto t : tmp) V.at(t)++; 
  }
  int mx = *max_element(V.begin(), V.end());
  for (int i = 0; i < 10; i++) {
    if (V.at(i) == mx) return cout << i << "\n", 0;
  }
}
0