結果
| 問題 | No.8130 プラチナバッハ問題 |
| コンテスト | |
| ユーザー |
ZeriToki
|
| 提出日時 | 2026-04-01 22:57:56 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,410 bytes |
| 記録 | |
| コンパイル時間 | 1,920 ms |
| コンパイル使用メモリ | 337,364 KB |
| 実行使用メモリ | 345,204 KB |
| 最終ジャッジ日時 | 2026-04-01 22:58:32 |
| 合計ジャッジ時間 | 10,276 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| サブタスク | 配点 | 結果 |
|---|---|---|
| small | 10 % | AC * 8 WA * 4 |
| large | 90 % | AC * 10 TLE * 1 -- * 7 |
| 合計 | 2.5 * 0% = 0 点 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, s, n) for (int i = (s); i < (int)(n); i++)
template<typename T> bool chmin(T& a, T b){if(a > b){a = b; return true;} return false;}
template<typename T> bool chmax(T& a, T b){if(a < b){a = b; return true;} return false;}
const long long mod=998244353;
const long long mod2=469762049;
const long long mod100=1000000007;
vector<pair<long long,int>>PF(long long A){
if(A<=0){
cerr<<"PFエラー:0以下の値が入力されました"<<endl;
}
vector<pair<long long,int>>res;
for(int i=2;i*i<=A;i++){
if(A%i!=0) continue;
res.emplace_back(i,0);
while(A%i==0){
A/=i;
res.back().second++;
}
}
if(A!=1) res.push_back({A,1});
return res;
}
void solve(){
ll N;cin>>N;
if(N%2==1){
if(N==1){
cout<<"No\n";
return;
}
vector<pair<ll,int>>pf1=PF(N),pf2=PF(N-2);
if(pf1.size()==1 || pf2.size()==1){
cout<<"Yes\n";
return;
}
cout<<"No\n";
return;
}
else{
if(N==4 || N==6){
cout<<"No\n";
return;
}
cout<<"Yes\n";
}
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T;cin>>T;
while(T--) solve();
}
ZeriToki