結果

問題 No.1465 Archaea
ユーザー NoviNovi
提出日時 2021-08-14 23:33:01
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,525 bytes
コンパイル時間 3,955 ms
コンパイル使用メモリ 230,084 KB
実行使用メモリ 21,888 KB
最終ジャッジ日時 2024-04-15 21:23:10
合計ジャッジ時間 5,033 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
12,756 KB
testcase_01 AC 6 ms
12,672 KB
testcase_02 AC 6 ms
12,748 KB
testcase_03 WA -
testcase_04 AC 6 ms
12,672 KB
testcase_05 WA -
testcase_06 AC 7 ms
12,672 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 14 ms
16,128 KB
testcase_10 AC 6 ms
12,576 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 14 ms
15,488 KB
testcase_15 AC 6 ms
12,784 KB
testcase_16 AC 6 ms
12,672 KB
testcase_17 WA -
testcase_18 AC 7 ms
13,188 KB
testcase_19 AC 13 ms
14,800 KB
testcase_20 AC 20 ms
17,960 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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();
      |              ^

ソースコード

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) 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