結果
| 問題 |
No.1465 Archaea
|
| コンテスト | |
| ユーザー |
Novi
|
| 提出日時 | 2021-08-14 23:34:41 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,529 bytes |
| コンパイル時間 | 3,846 ms |
| コンパイル使用メモリ | 236,132 KB |
| 実行使用メモリ | 813,852 KB |
| 最終ジャッジ日時 | 2024-10-06 02:30:42 |
| 合計ジャッジ時間 | 7,259 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 4 WA * 1 MLE * 1 -- * 14 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:42:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
42 | auto [np, nk] = q.front();
| ^
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ll = long long;
#define int ll
#define rng(i, a, b) for (int i = int(a); i < int(b); i++)
#define rep(i, b) rng(i, 0, b)
#define ALL(a) (a).begin(), (a).end()
template <class t, class u> void chmax(t& a, u b) {
if (a < b) a = b;
}
template <class t, class u> void chmin(t& a, u b) {
if (b < a) a = b;
}
template <class t> using vc = vector<t>;
template <class t> using vvc = vc<vc<t>>;
using pi = pair<int, int>;
using vi = vc<int>;
using uint = unsigned;
using ull = unsigned long long;
int popcount(signed t) { return __builtin_popcount(t); }
int popcount(ll t) { return __builtin_popcountll(t); }
bool ispow2(int i) { return i && (i & -i) == i; }
ll mask(int i) { return (ll(1) << i) - 1; }
int lcm(int a, int b) { return a / __gcd(a, b) * b; }
vvc<int> g(400400);
bool ok = false;
signed main() {
cin.tie(0);
ios::sync_with_stdio(0);
cout << fixed << setprecision(20);
int n, k;
cin >> n >> k;
for (int i = 1; i <= n; i++) {
g[i].push_back(i + 3);
g[i].push_back(2 * i);
}
queue<pi> q;
q.push(make_pair(1, k));
while (!q.empty()) {
auto [np, nk] = q.front();
q.pop();
if (np > n * 2) break;
if (np == n && nk > 0) {
cout << "YES" << endl;
return 0;
}
for (const auto x : g[np]) {
if (nk - 1 > 0) {
q.push(make_pair(x, nk - 1));
}
}
}
cout << "NO" << endl;
}
Novi