結果

問題 No.1465 Archaea
ユーザー 沙耶花
提出日時 2021-04-02 21:40:32
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 462 bytes
コンパイル時間 3,798 ms
コンパイル使用メモリ 249,672 KB
最終ジャッジ日時 2025-01-20 08:38:03
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 11 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000001

int main(){
	
	long long N,K;
	cin>>N>>K;
	
	for(int i=0;i<=K;i++){
		long long m = 1LL<<i;
		if(m>N)break;
		long long M = (1LL+(K-i))<<i;
		if(M>N)continue;
		if(N%3==m%3){
			cout<<"YES"<<endl;
			return 0;
		}
	}
	
	cout<<"NO"<<endl;
	
    return 0;
}

0