結果

問題 No.1465 Archaea
ユーザー saxofone111saxofone111
提出日時 2021-04-04 21:59:45
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,086 bytes
コンパイル時間 1,997 ms
コンパイル使用メモリ 199,940 KB
実行使用メモリ 8,760 KB
最終ジャッジ日時 2023-08-28 08:50:20
合計ジャッジ時間 6,062 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,760 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 10 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 WA -
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
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"

#define MOD 1000000007
#define rep(i, n) for(ll i=0; i < (n); i++)
#define rrep(i, n) for(ll i=(n)-1; i >=0; i--)
#define ALL(v) v.begin(),v.end()
#define rALL(v) v.rbegin(),v.rend()
#define FOR(i, j, k) for(ll i=j;i<k;i++)
#define debug_print(var) cerr << #var << "=" << var <<endl;
#define DUMP(i, v)for(ll i=0;i<v.size();i++)cerr<<v[i]<<" "
#define fi first
#define se second

using namespace std;
typedef long long int ll;
typedef vector<ll> llvec;
typedef vector<double> dvec;
typedef pair<ll, ll> P;
typedef long double ld;
struct edge{ll x, c;};


ll N, K;
llvec dp;

ll dpf(ll n){
  if(n<=0)return 1e18;
  if(n==1)return 1;
  if(dp[n]!=1e18){

  }else{
    if(n%2==0){
      dp[n] = min(dp[n], dpf(n/2)+1);
    }
    dp[n] = min(dp[n], dpf(n-3));
  }
  return dp[n];
}

/**************************************
** A main function starts from here  **
***************************************/
int main(){
  cin >> N >> K;
  dp = llvec(N+1, 1e18);
  ll t = dpf(N);
  if(t<=K){
    cout << "YES"<<endl;
  }else{
    cout << "NO" << endl;
  }
  return 0;
}
0