結果
| 問題 | No.1465 Archaea | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2021-04-15 12:58:10 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 3 ms / 2,000 ms | 
| コード長 | 394 bytes | 
| コンパイル時間 | 1,523 ms | 
| コンパイル使用メモリ | 166,092 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-01 18:35:05 | 
| 合計ジャッジ時間 | 2,533 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 20 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
   ios::sync_with_stdio(false);
   cin.tie(0);
   int n, k;
   cin >> n >> k;
   if (n % 3 == 0) {
      cout << "NO" << endl;
      return 0;
   }
   int ans = 0;
   while(n > 1) {
      if (n & 1 || n == 4) {
         n -= 3;
      } else {
         n /= 2;
      }
      ans++;
   }
   cout << (ans <= k ? "YES" : "NO") << endl;
}
            
            
            
        