結果
| 問題 | No.24 数当てゲーム | 
| コンテスト | |
| ユーザー |  tetsuzuki1115 | 
| 提出日時 | 2017-09-09 17:51:00 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 948 bytes | 
| コンパイル時間 | 874 ms | 
| コンパイル使用メモリ | 80,976 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-07 09:54:10 | 
| 合計ジャッジ時間 | 1,187 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <limits.h>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <functional>
#include <stdio.h>
using namespace std;
long long MOD = 1000000007;
int main() {
    
    int A[10] = {0};
    int N;
    cin >> N;
    for ( int i = 0; i < N; i++ ) {
        vector<int> a(4);
        for ( int j = 0; j < 4; j++ ) {
            cin >> a[j];
        }
        string s;
        cin >> s;
        
        for ( auto& x : a ) {
            if ( s == "YES" && A[x] >= 0 ) {
                A[x]++;
            }
            else {
                A[x] = -1;
            }
        }
        
        
    }
    
    int m = 0;
    int ans = 0;
    for ( int i = 0; i < 10; i++ ) {
        if ( m <= A[i] ) {
            ans = i;
            m = A[i];
        }
    }
    cout << ans << endl;
    
    return 0;
}
            
            
            
        