結果

問題 No.1465 Archaea
ユーザー shiomusubi496shiomusubi496
提出日時 2021-04-02 22:24:57
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 290 bytes
コンパイル時間 1,655 ms
コンパイル使用メモリ 169,624 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 01:20:45
合計ジャッジ時間 2,577 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
    int N,K;cin>>N>>K;
    vector<int>dp(N+1,1e18);
    dp[1]=0;
    for(int i=2;i<=N;i++){
        if(i>3)dp[i]=dp[i-3]+1;
        if(i%2==0)dp[i]=min(dp[i],dp[i/2]+1);
    }
    puts(dp[N]<=K?"YES":"NO");
}
0