結果

問題 No.3651 K-th Sum of Divisors
コンテスト
ユーザー yaaya
提出日時 2026-08-29 05:33:36
言語 C++23
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 2,118 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,232 ms
コンパイル使用メモリ 337,072 KB
実行使用メモリ 8,376 KB
最終ジャッジ日時 2026-08-29 05:33:42
合計ジャッジ時間 5,191 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 9 WA * 46
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,a,b) for(ll i=a-1;i>=b;i--)
#define ll long long
#define ull unsigned ll
#define ld long double
#define bl __int128_t
#define fi first
#define se second
#define vel vector<ll>
#define vvel vector<vel>
#define pll pair<ll,ll>
#define vepll vector<pll>
#define vvepll vector<vepll>
#define ves vector<string>
#define vem vector<mint>
#define vvem vector<vem>
#define pmm pair<mint,mint>
#define cleout(i) cout<<fixed<<setprecision(i)
template<class T>using PQ=priority_queue<T,vector<T>,greater<T>>;
//               上  右 下 左
vector<int> di={-1, 0, 1, 0};
vector<int> dj={ 0, 1, 0,-1};

vector<int> dx={ 0, 1, 0,-1};
vector<int> dy={ 1, 0,-1, 0};


vector<int> ddx={ 1, 1, 1, 0, -1, -1, -1, 0 };
vector<int> ddy={ 1, 0, -1, -1, -1, 0, 1, 1 };

ll inf=1000000000000000000;//1e18
// LLONG_MAX

mt19937_64 rng((ull)chrono::steady_clock::now().time_since_epoch().count());

template<typename T,typename F>
T POW(T id,T a,ll K,F op){
    T res=id;
    while(K){
        if(1&K){
            res=op(res,a);
        }
        a=op(a,a);
        K/=2;
    }
    return res;
}

ll m=100003;

vel ans(100003,0);

void _solve(){
    ll N,K;
    cin>>N>>K;
    if(K==1){
        cout<<N<<"\n";
        return ;
    }
    rep(i,1,m){
        ll now=1;
        while(now*i<m){
            ans[now*i]+=i;
            ans[now*i]%=m;
            now++;
        }
    }
    auto f=[&](vel &a,vel &b){
        vel res(m);
        rep(i,0,m)res[i]=a[b[i]];
        return res;
    };
    auto g=[&](ll N){
        ll cnt=0;
        for(ll i=1;i*i<=N;i++){
            if(N%i==0){
                cnt+=i;
                if(i*i!=N){
                    cnt+=N/i;
                }
                cnt%=100003;
            }
        }
        return cnt;
    };
    vel id(m);
    rep(i,0,m)id[i]=i;
    cout<<POW(id,ans,K-1,f)[g(N)]<<"\n";
}


int main(){
    cin.tie(nullptr);
 	ios_base::sync_with_stdio(false);

    
    ll _;
    bool multitest=0;
    if(multitest)cin>>_;
    else _=1;
    rep(__,0,_){
        _solve();
    }
}
0