結果

問題 No.1465 Archaea
ユーザー chocoruskchocorusk
提出日時 2021-04-02 21:33:49
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 24 ms / 2,000 ms
コード長 1,117 bytes
コンパイル時間 3,718 ms
コンパイル使用メモリ 187,440 KB
実行使用メモリ 18,412 KB
最終ジャッジ日時 2023-08-25 16:10:09
合計ジャッジ時間 4,654 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
15,672 KB
testcase_01 AC 4 ms
15,696 KB
testcase_02 AC 4 ms
15,848 KB
testcase_03 AC 4 ms
15,700 KB
testcase_04 AC 4 ms
15,688 KB
testcase_05 AC 4 ms
15,672 KB
testcase_06 AC 4 ms
15,700 KB
testcase_07 AC 7 ms
16,344 KB
testcase_08 AC 4 ms
15,704 KB
testcase_09 AC 8 ms
16,744 KB
testcase_10 AC 4 ms
15,712 KB
testcase_11 AC 8 ms
16,556 KB
testcase_12 AC 4 ms
15,796 KB
testcase_13 AC 17 ms
17,520 KB
testcase_14 AC 7 ms
16,436 KB
testcase_15 AC 5 ms
15,828 KB
testcase_16 AC 4 ms
15,792 KB
testcase_17 AC 20 ms
17,928 KB
testcase_18 AC 5 ms
16,016 KB
testcase_19 AC 10 ms
16,740 KB
testcase_20 AC 14 ms
17,088 KB
testcase_21 AC 22 ms
18,412 KB
testcase_22 AC 24 ms
18,200 KB
testcase_23 AC 4 ms
15,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>
#include <atcoder/all>
#define popcount __builtin_popcount
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef pair<int, int> P;

int main()
{
    int n, k; cin>>n>>k;
  const int INF=1e9;
  int dp[19][200020];
  for(int i=0; i<19; i++) fill(dp[i],dp[i]+n+1,INF);
  dp[0][1]=0;
  for(int i=1; i<=n; i++){
    for(int j=0; j<19; j++){
      if(2*i<=n && j+1<19){
        dp[j+1][2*i]=min(dp[j+1][2*i], dp[j][i]);
      }
      if(i+3<=n){
        dp[j][i+3]=min(dp[j][i+3],dp[j][i]+1);
      }
    }
  }
  int mn=INF;
  for(int i=0; i<19; i++){
    mn=min(mn,i+dp[i][n]);
  }
  if(mn<=k) cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
    return 0;
}
0