結果
問題 |
No.36 素数が嫌い!
|
ユーザー |
|
提出日時 | 2023-01-12 22:24:24 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 442 bytes |
コンパイル時間 | 1,805 ms |
コンパイル使用メモリ | 197,708 KB |
最終ジャッジ日時 | 2025-02-10 01:51:01 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 21 WA * 5 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i,l,r) for(ll i=(l);i<(r);++i) int main(){ ll n; cin>>n; bool flg=false; set<ll> st; for(ll i=2; i*i<=n; i++){ if(n%i==0){ st.insert(n/i); st.insert(i); } } while(!st.empty()){ ll t=*st.begin(); st.erase(st.begin()); for(ll i=2; i*i<=t; i++){ if(n%i==0) flg=true; } if(flg) break; } if(n==1) flg=false; cout<<(flg?"YES":"NO")<<endl; }