結果
問題 | No.36 素数が嫌い! |
ユーザー | kureha |
提出日時 | 2024-04-16 21:27:21 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,298 bytes |
コンパイル時間 | 2,308 ms |
コンパイル使用メモリ | 195,884 KB |
実行使用メモリ | 81,536 KB |
最終ジャッジ日時 | 2024-04-16 21:27:46 |
合計ジャッジ時間 | 23,979 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 695 ms
81,536 KB |
testcase_01 | AC | 661 ms
81,408 KB |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | AC | 700 ms
81,408 KB |
testcase_09 | AC | 640 ms
81,328 KB |
testcase_10 | AC | 704 ms
81,408 KB |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | AC | 699 ms
81,280 KB |
testcase_15 | AC | 631 ms
81,280 KB |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | AC | 715 ms
81,536 KB |
testcase_19 | AC | 654 ms
81,336 KB |
testcase_20 | AC | 686 ms
81,536 KB |
testcase_21 | AC | 629 ms
81,504 KB |
testcase_22 | AC | 701 ms
81,408 KB |
testcase_23 | AC | 624 ms
81,412 KB |
testcase_24 | AC | 716 ms
81,408 KB |
testcase_25 | AC | 628 ms
81,408 KB |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
ソースコード
#include<bits/stdc++.h> using namespace std; using uint = unsigned int; using ll = long long; using ull = unsigned long long; template<class T> using V = vector<T>; template<class T> using VV = V<V<T>>; template<class T> using VVV = V<VV<T>>; template<class T> using VVVV = VV<VV<T>>; #define rep(i,n) for(ll i=0ll;i<n;i++) #define REP(i,a,n) for(ll i=a;i<n;i++) const long long INF = (1LL << 60); const long long mod99 = 998244353; const long long mod107 = 1000000007; const long long mod = mod99; #define eb emplace_back #define pb eb #define be(v) (v).begin(),(v).end() #define all(i,v) for(auto& i : v) #define all2(i,j,v) for(auto& [i,j] : v) template<class T, class U> void chmin(T& t, const U& u) { if (t > u) t = u; } template<class T, class U> void chmax(T& t, const U& u) { if (t < u) t = u; } // cin.tie(nullptr); // ios::sync_with_stdio(false); // cout << fixed << setprecision(20); void solve(){ ll n; cin >> n; V<ll> v(10001000, 0); v[0] = 1; v[1] = 1; rep(i,10001000) if(!v[i]){ for(ll j=2*i; j<10001000;j+=i) v[j] = 1; } v[1] = 0; v[0] = 0; string ans = "NO"; rep(i,10001000) if(v[i]) if(n%v[i]==0) ans = "YES"; cout << ans << endl; } int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int t=1; // cin >> t; rep(i,t) solve(); }