結果
| 問題 | No.153 石の山 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-09-01 01:27:21 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 1,646 bytes |
| コンパイル時間 | 3,187 ms |
| コンパイル使用メモリ | 262,720 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-01 01:27:26 |
| 合計ジャッジ時間 | 4,447 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 27 |
ソースコード
#ifdef ONLINE_JUDGE
#define NDEBUG
#endif
#if defined(__GNUC__) && !defined(__clang__)
// #pragma GCC optimize("O3")
// #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#pragma GCC optimize("unroll-loops")
#endif
#include <bits/stdc++.h>
using namespace std;
#if __cplusplus >= 202002L
namespace R = ranges;
namespace V = views;
#endif
using i64 = long long;
using u64 = unsigned long long;
using f64 = double;
using uz = size_t;
using u32 = uint32_t;
using itn = int;
template <typename T> using ve = vector<T>;
template <typename T> using a2 = array<T, 2>;
template <typename K, typename V> using HashMap = unordered_map<K, V>;
template <typename T> using HashSet = unordered_set<T>;
template <typename T, typename C = less<T>>
using PQ = std::priority_queue<T, vector<T>, C>;
template <typename T, typename C = greater<T>>
using miPQ = std::priority_queue<T, vector<T>, C>;
#define mt make_tuple
#define mp make_pair
#ifdef LOCAL
#include "debug_template.cpp"
#else
#define debug(...)
#define debugArr(...)
#endif
// constexpr array<int, 5> dirs{-1, 0, 1, 0, -1};
// constexpr char nesw[4]{'N', 'E', 'S', 'W'};
// constexpr int M = 1e9 + 7;
void cln() { cout << '\n'; }
constexpr char ln = '\n';
array<int, 101> dp;
int main() {
#ifndef LOCAL
ios::sync_with_stdio(0), cin.tie(0);
#endif
//
dp[2] = 1;
for (unsigned int i = 3; i < 101; ++i) {
bitset<10> in(UINT_MAX);
in.reset(dp[i / 3 + (i % 3 == 1)]);
int futatsuwake = 0;
if (i & 1) {
futatsuwake = dp[i / 2] ^ dp[i / 2 + 1];
}
in.reset(futatsuwake);
dp[i] = in._Find_first();
}
int n;
cin >> n;
cout << (dp[n] ? 'A' : 'B') << ln;
}