結果

問題 No.24 数当てゲーム
ユーザー IndianeagleowlIndianeagleowl
提出日時 2017-06-26 01:23:20
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 625 bytes
コンパイル時間 578 ms
コンパイル使用メモリ 66,640 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-14 23:52:54
合計ジャッジ時間 1,095 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 1 ms
6,940 KB
testcase_09 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>

using namespace std;

int main() {
  int n;
  int a, b, c, d;
  string s;
  int i;
  int array[10] = {0};
  int max = -1;
  int index = 0;

  cin >> n;

  for ( i = 0; i < n; i++ ) {
    cin >> a >> b >> c >> d >> s;
    if ( s == "YES" ) {
      array[a] += 1;
      array[b] += 1;
      array[c] += 1;
      array[d] += 1;
    } else {
      array[a] -= 10;
      array[b] -= 10;
      array[c] -= 10;
      array[d] -= 10;
    }
  }

  for ( i = 0; i < 10; i++ ) {
    if ( max < array[i] ) {
      max = array[i];
      index = i;
    }
  }

  cout << index << endl;

  return 0;
}
0