結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,404 KB
testcase_01 AC 2 ms
4,688 KB
testcase_02 AC 3 ms
4,496 KB
testcase_03 AC 2 ms
4,536 KB
testcase_04 AC 2 ms
4,584 KB
testcase_05 AC 2 ms
4,492 KB
testcase_06 AC 2 ms
4,448 KB
testcase_07 AC 28 ms
4,516 KB
testcase_08 AC 2 ms
4,588 KB
testcase_09 AC 8 ms
4,392 KB
testcase_10 AC 2 ms
4,436 KB
testcase_11 AC 40 ms
4,392 KB
testcase_12 AC 2 ms
4,604 KB
testcase_13 TLE -
testcase_14 AC 15 ms
4,404 KB
testcase_15 AC 2 ms
4,728 KB
testcase_16 AC 3 ms
4,408 KB
testcase_17 AC 3 ms
4,636 KB
testcase_18 AC 3 ms
4,636 KB
testcase_19 AC 2 ms
4,640 KB
testcase_20 AC 2 ms
4,712 KB
testcase_21 TLE -
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] <= k)cout << "YES" << endl;
    else cout << "NO" << endl;
}
0