結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー karinohitokarinohito
提出日時 2021-07-22 16:06:38
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 860 bytes
コンパイル時間 1,855 ms
コンパイル使用メモリ 167,672 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-14 05:38:34
合計ジャッジ時間 17,548 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 624 ms
6,944 KB
testcase_02 AC 625 ms
6,944 KB
testcase_03 AC 627 ms
6,940 KB
testcase_04 AC 622 ms
6,944 KB
testcase_05 AC 616 ms
6,940 KB
testcase_06 AC 624 ms
6,944 KB
testcase_07 AC 628 ms
6,944 KB
testcase_08 AC 639 ms
6,940 KB
testcase_09 AC 623 ms
6,940 KB
testcase_10 AC 252 ms
6,940 KB
testcase_11 AC 268 ms
6,944 KB
testcase_12 AC 272 ms
6,944 KB
testcase_13 AC 283 ms
6,944 KB
testcase_14 AC 271 ms
6,944 KB
testcase_15 AC 272 ms
6,944 KB
testcase_16 AC 285 ms
6,940 KB
testcase_17 AC 274 ms
6,940 KB
testcase_18 AC 277 ms
6,940 KB
testcase_19 AC 5 ms
6,940 KB
testcase_20 AC 5 ms
6,940 KB
testcase_21 AC 5 ms
6,944 KB
testcase_22 AC 5 ms
6,940 KB
testcase_23 AC 5 ms
6,944 KB
testcase_24 AC 5 ms
6,940 KB
testcase_25 AC 5 ms
6,940 KB
testcase_26 AC 4 ms
6,944 KB
testcase_27 AC 4 ms
6,940 KB
testcase_28 AC 2 ms
6,940 KB
testcase_29 AC 2 ms
6,944 KB
testcase_30 AC 2 ms
6,940 KB
testcase_31 AC 2 ms
6,940 KB
testcase_32 AC 2 ms
6,944 KB
testcase_33 AC 2 ms
6,940 KB
testcase_34 AC 2 ms
6,940 KB
testcase_35 AC 2 ms
6,940 KB
testcase_36 AC 2 ms
6,940 KB
testcase_37 AC 2 ms
6,944 KB
testcase_38 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
//using namespace atcoder;
using ll = long long;
#define all(A) A.begin(),A.end()
using vll = vector<ll>;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
using Graph = vector<vector<ll>>;
Graph G;
vll dist;
vector<bool> seen;
ll gcd(ll(a), ll(b)) {
	ll c = a;
	while (a % b != 0) {
		c = a % b;
		a = b;
		b = c;
	}
	return b;
}
int main() {
	ll T;
	cin>>T;
	vll P={2,3,5,7,11,13,17,19,23,29,31};
	ll n=P.size();
	rep(i,T){
		ll N;
		cin>>N;
		rep(i,31){
			ll M=N*(i+2);
			ll an=1;
			ll am=1;
			ll NN=N;
			rep(k,n){
				ll y=0;
				while(M%P[k]==0){
					y++;
					M/=P[k];
				}
				am*=(y+1);
			}
			rep(k,n){
				ll y=0;
				while(NN%P[k]==0){
					y++;
					NN/=P[k];
				}
				an*=(y+1);
			}
			if(am==an*2){
				cout<<N*(i+2)<<endl;
				break;
			}

		}
	}
}
0