結果

問題 No.1465 Archaea
ユーザー SotaUNSotaUN
提出日時 2021-04-02 22:10:14
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 484 bytes
コンパイル時間 1,435 ms
コンパイル使用メモリ 163,604 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-25 12:23:04
合計ジャッジ時間 2,453 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 WA -
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 WA -
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 WA -
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
bool can[300000];
ll n,k;
void dfs(ll now,ll ka){
    if(now > n)return;
    if(ka > k)return;
    if(can[now])return;
    //cout << now << " " << ka << endl;
    can[now] = true;
    if(ka >= k)return;
    dfs(2*now,ka+1);
    dfs(now+3,ka+1);
}
int main(){
    cin >> n >> k;
    dfs(7,2);
    dfs(5,2);
    dfs(4,1);
    dfs(2,1);
    dfs(1,0);
    if(can[n])cout << "YES" << endl;
    else cout << "NO" << endl;
}
0