結果

問題 No.2318 Phys Bone Maker
ユーザー otoshigootoshigo
提出日時 2023-05-26 22:57:23
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,072 bytes
コンパイル時間 1,407 ms
コンパイル使用メモリ 96,552 KB
実行使用メモリ 8,760 KB
最終ジャッジ日時 2023-08-26 13:18:58
合計ジャッジ時間 5,751 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
8,760 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<numeric>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
template<class T> bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;}
template<class T> bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;}

const ll MOD=998244353;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll N;
    cin>>N;
    ll x=1;
    vector<ll>C;
    while(x*x<=N){
        if(N%x==0){
            C.push_back(x);
            if(x*x<N)C.push_back(N/x);
        }
        x++;
    }
    sort(all(C));
    int l=C.size();
    map<ll,int>mp;
    rep(i,l)mp[C[i]]=i;
    vector<ll>dp(l);
    dp[0]=1;
    ll ans=0;
    rep(i,l){
        rep(j,l){
            int m=mp[C[i]/gcd(C[i],C[j])*C[j]];
            if(m==i)continue;
            dp[m]+=dp[i];
            dp[m]%=MOD;
        }
    }
    cout<<dp[l-1]<<"\n";
}
0