結果
| 問題 | No.24 数当てゲーム | 
| コンテスト | |
| ユーザー |  遭難者 | 
| 提出日時 | 2022-02-01 22:35:32 | 
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) | 
| 結果 | 
                                RE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 1,186 bytes | 
| コンパイル時間 | 19,107 ms | 
| コンパイル使用メモリ | 235,016 KB | 
| 最終ジャッジ日時 | 2025-01-27 18:18:59 | 
| ジャッジサーバーID (参考情報) | judge1 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 8 RE * 2 | 
ソースコード
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <numeric>
#include <algorithm>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using mint = modint1000000007;
#define rep(i, n) for (int i = 0; i < n; i++)
#define endl '\n'
#define print(n) cout << (n) << endl
void chmax(ll &a, ll b)
{
    if (a < b)
        a = b;
}
void chmin(ll &a, ll b)
{
    if (a > b)
        a = b;
}
int main()
{
    int n;
    cin >> n;
    vector<vector<int>> a(n);
    rep(i, n)
    {
        vector<int> b(5);
        rep(j, 4) cin >> b[j];
        string t;
        cin >> t;
        b[4] = t[0] == 'N';
        a[i] = b;
    }
    for (int ans = 1; ans < 10; ans++)
    {
        bool yes = true;
        for (auto t : a)
        {
            bool to = t[4];
            rep(j, 4) to ^= t[j] == ans;
            yes &= to;
        }
        if (yes)
        {
            print(ans);
            return 0;
        }
    }
    return 1;
}
            
            
            
        