結果

問題 No.1465 Archaea
ユーザー SotaUNSotaUN
提出日時 2021-04-02 22:23:18
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 505 bytes
コンパイル時間 1,521 ms
コンパイル使用メモリ 165,888 KB
実行使用メモリ 9,056 KB
最終ジャッジ日時 2023-08-25 12:33:58
合計ジャッジ時間 5,543 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<ll> can(200000,1000000000);
ll n,k;
void dfs(ll now,ll ka){
    if(now > n)return;
    if(ka > k)return;
    if(can[now] <= ka)return;
    //cout << now << " " << ka << endl;
    can[now] = ka;
    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