結果
| 問題 | 
                            No.24 数当てゲーム
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2014-11-23 16:37:41 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,146 bytes | 
| コンパイル時間 | 848 ms | 
| コンパイル使用メモリ | 72,484 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2025-01-02 20:20:30 | 
| 合計ジャッジ時間 | 1,419 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 6 WA * 4 | 
ソースコード
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#define MAX_N 10
int point_table[MAX_N];
int main(){
  int n;
  int* a;
  int* b;
  int* c;
  int* d;
  std::cin >> n;
  a =(int*)malloc(sizeof(int)*n);
  b =(int*)malloc(sizeof(int)*n);
  c =(int*)malloc(sizeof(int)*n);
  d =(int*)malloc(sizeof(int)*n);
  std::vector<std::string> r;
  std::string str;
  for(register int i = 0; i < n; i++){
    std::cin >> a[i] >> b[i] >> c[i] >> d[i] >> str;
    r.push_back(str);
  }
  for(register int i =0; i < MAX_N; i++){
    point_table[i] = 0;
  }
  //init
  for(register int i = 0; i < n; i++){
   if(r[i] == "NO"){
      point_table[a[i]]--;
      point_table[b[i]]--;
      point_table[c[i]]--;
      point_table[d[i]]--;
    }
    else{
      point_table[a[i]]++;
      point_table[b[i]]++;
      point_table[c[i]]++;
      point_table[d[i]]++;
    }
  }
  int tmp = -1;
  for(register int i =0; i < MAX_N; i++){
      if(point_table[i] > tmp){
        tmp = i;
      }
  }
  std::cout << tmp << std::endl;
}