結果
| 問題 |
No.1465 Archaea
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-04-05 02:13:56 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 614 bytes |
| コンパイル時間 | 1,763 ms |
| コンパイル使用メモリ | 176,096 KB |
| 実行使用メモリ | 15,744 KB |
| 最終ジャッジ日時 | 2024-12-29 13:49:58 |
| 合計ジャッジ時間 | 3,264 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 RE * 1 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
static const ll INF=1000000000000000;
using Graph=vector<vector<ll>>;
ll N,K;
ll d[200005];
void bfs(const Graph &G,ll s){
fill(d,d+N+1,INF);d[s]=0;
queue<ll>que;que.push(s);
while(!que.empty()){
ll v=que.front();que.pop();
for(auto u:G[v]){
if(d[u]!=INF)continue;
d[u]=d[v]+1;que.push(u);
}
}
}
int main(){
cin>>N>>K;
Graph G(N+1);G[2].push_back(1);
for(ll i=3;i<=N;i++){
G[i].push_back(i-3);
if(i%2==0)G[i].push_back(i/2);
}bfs(G,N);
if(d[1]<=K)cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
return 0;
}