結果
問題 |
No.2318 Phys Bone Maker
|
ユーザー |
![]() |
提出日時 | 2023-05-26 22:55:46 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 726 bytes |
コンパイル時間 | 4,505 ms |
コンパイル使用メモリ | 263,180 KB |
最終ジャッジ日時 | 2025-02-13 08:11:03 |
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 TLE * 1 |
other | AC * 37 TLE * 8 |
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include <atcoder/all> #include <bits/stdc++.h> using namespace std; using namespace atcoder; using mint=modint998244353; vector<ll> divisor(ll x){ set<ll> s; for(ll i=1;i*i<=x;i++){ if(x%i==0){ s.insert(i); s.insert(x/i); } } vector<ll> res; for(auto y:s) res.push_back(y); return res; } int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); ll n; cin>>n; map<ll,mint> dp; auto D=divisor(n); dp[1]=1; for(auto a:D){ for(auto d:D){ if(a%d==0) continue; ll l=lcm(a,d); dp[l]+=dp[a]; } } cout<<dp[n].val()<<endl; return 0; }