結果
| 問題 | No.3776 Magic Square of Product |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-10-23 21:51:03 |
| 言語 | C++23(gcc16) (gcc 16.2.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 457 ms / 2,500 ms |
| + 213µs | |
| コード長 | 919 bytes |
| 記録 | |
| コンパイル時間 | 3,129 ms |
| コンパイル使用メモリ | 352,004 KB |
| 実行使用メモリ | 9,864 KB |
| 最終ジャッジ日時 | 2026-10-23 21:51:30 |
| 合計ジャッジ時間 | 9,374 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 25 |
ソースコード
#include<bits/stdc++.h>
#define CSP2026 using
#define RP namespace
#define PLUSPLUS std
CSP2026 RP PLUSPLUS;
#define debug(x) cout<<"clock="<<clock()<<' '<<#x<<'='<<(x)<<'\n'
//#define getchar getchar_unlocked
using ll=long long;
inline int rd(){int x=0,f=1;char ch=getchar();for(;!isdigit(ch);ch=getchar())if(ch=='-')f=-1;for(;isdigit(ch);ch=getchar())x=(x<<3)+(x<<1)+(ch^48);return x*f;}
inline ll rdll(){ll x=0;int f=1;char ch=getchar();for(;!isdigit(ch);ch=getchar())if(ch=='-')f=-1;for(;isdigit(ch);ch=getchar())x=(x<<3)+(x<<1)+(ch^48);return x*f;}
constexpr int P=998244353;
int biao[]={1,6,21,55,120,231,406,666,1035,1540,2211,3081,4186,5565,7260,9316,11781,14706,18145,22155,26796};
void solve(){
int n=rd(),ans=1;
for(int i=2;i*i<=n;++i){
int cnt=0;
while(n%i==0)n/=i,++cnt;
ans=1ll*ans*biao[cnt]%P;
}if(n!=1)ans=1ll*ans*biao[1]%P;
cout<<ans<<'\n';
}signed main(){
int T=rd();
while(T--)solve();
}