結果
問題 |
No.1611 Minimum Multiple with Double Divisors
|
ユーザー |
![]() |
提出日時 | 2021-07-21 23:58:35 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1,258 ms / 2,000 ms |
コード長 | 626 bytes |
コンパイル時間 | 1,917 ms |
コンパイル使用メモリ | 193,508 KB |
最終ジャッジ日時 | 2025-01-23 05:22:54 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 37 |
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include <bits/stdc++.h> using namespace std; int B[11]={2,3,5,7,11,13,17,19,23,29,31}; int f(ll x){ int res=1; rep(i,11){ int cnt=0; ll a=x; while(a%B[i]==0){ cnt++; a/=B[i]; } res*=cnt+1; } return res; } int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int t; cin>>t; while(t--){ ll x; cin>>x; int tmp=2*f(x); for(int i=2;i<=31;i++){ if(tmp==f(i*x)){ cout<<i*x<<endl; break; } } } return 0; }