結果
| 問題 | No.24 数当てゲーム |
| コンテスト | |
| ユーザー |
遭難者
|
| 提出日時 | 2022-02-01 22:36:16 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 5,000 ms |
| コード長 | 1,164 bytes |
| コンパイル時間 | 19,776 ms |
| コンパイル使用メモリ | 234,884 KB |
| 最終ジャッジ日時 | 2025-01-27 18:19:20 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
#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;
}
rep(ans, 10)
{
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;
}
遭難者