結果
| 問題 | No.1465 Archaea |
| コンテスト | |
| ユーザー |
C
|
| 提出日時 | 2026-09-30 15:24:52 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 481µs | |
| コード長 | 888 bytes |
| 記録 | |
| コンパイル時間 | 6,875 ms |
| コンパイル使用メモリ | 390,148 KB |
| 実行使用メモリ | 9,916 KB |
| 最終ジャッジ日時 | 2026-09-30 15:25:02 |
| 合計ジャッジ時間 | 7,429 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace atcoder;
using namespace __gnu_pbds;
using ll=long long;
using ld=long double;
using vll=vector<ll>;
using vvll=vector<vll>;
using pll=pair<ll,ll>;
// using mint=modint;
// template<class K,class V>
// using ordered_map=tree<K,V,less<K>,rb_tree_tag,tree_order_statistics_node_update>;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll N,K;
cin>>N>>K;
//2倍の操作回数をd回として(ここは全探索)
for(ll d=0;;d++){
ll p=1LL<<d;
if(p>N)break;
if((N-p)%3!=0)continue;
ll T=(N-p)/3;
ll q=T/p,r=T%p;
if(d+q+__builtin_popcountll(r)<=K){
cout<<"YES"<<endl;
return 0;
}
}
cout<<"NO"<<endl;
}
C