結果

問題 No.1465 Archaea
ユーザー NoviNovi
提出日時 2021-08-14 23:34:41
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,529 bytes
コンパイル時間 4,026 ms
コンパイル使用メモリ 233,936 KB
実行使用メモリ 814,024 KB
最終ジャッジ日時 2023-07-28 12:40:31
合計ジャッジ時間 8,839 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
12,516 KB
testcase_01 AC 5 ms
12,092 KB
testcase_02 AC 1,154 ms
42,680 KB
testcase_03 AC 5 ms
12,456 KB
testcase_04 AC 5 ms
12,488 KB
testcase_05 WA -
testcase_06 AC 5 ms
12,608 KB
testcase_07 AC 37 ms
32,376 KB
testcase_08 AC 6 ms
12,544 KB
testcase_09 MLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内:
main.cpp:42:14: 警告: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
   42 |         auto [np, nk] = q.front();
      |              ^

ソースコード

diff #

#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;
}
0