結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー monnumonnu
提出日時 2021-07-21 22:00:44
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,095 bytes
コンパイル時間 4,269 ms
コンパイル使用メモリ 225,212 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-14 05:17:06
合計ジャッジ時間 21,701 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 720 ms
6,940 KB
testcase_02 AC 706 ms
6,944 KB
testcase_03 AC 710 ms
6,944 KB
testcase_04 AC 706 ms
6,940 KB
testcase_05 AC 709 ms
6,944 KB
testcase_06 AC 711 ms
6,940 KB
testcase_07 AC 703 ms
6,940 KB
testcase_08 AC 712 ms
6,940 KB
testcase_09 AC 728 ms
6,940 KB
testcase_10 AC 312 ms
6,944 KB
testcase_11 AC 331 ms
6,940 KB
testcase_12 AC 337 ms
6,940 KB
testcase_13 AC 333 ms
6,940 KB
testcase_14 AC 323 ms
6,940 KB
testcase_15 AC 326 ms
6,944 KB
testcase_16 AC 330 ms
6,944 KB
testcase_17 AC 323 ms
6,940 KB
testcase_18 AC 331 ms
6,944 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,940 KB
testcase_24 AC 5 ms
6,944 KB
testcase_25 AC 5 ms
6,940 KB
testcase_26 AC 5 ms
6,940 KB
testcase_27 AC 5 ms
6,940 KB
testcase_28 AC 2 ms
6,944 KB
testcase_29 AC 2 ms
6,944 KB
testcase_30 AC 2 ms
6,948 KB
testcase_31 AC 2 ms
6,940 KB
testcase_32 AC 2 ms
6,940 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,944 KB
testcase_37 AC 2 ms
6,940 KB
testcase_38 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll=long long;
using Graph=vector<vector<int>>;
#define MAX 100
#define MOD 1000000007
#define INF 1000000000000000000

vector<int> p;
vector<bool> p_table(MAX+1,true);
void prime(){
  p_table.at(0)=false,p_table.at(1)=false;
  for(int i=2;i<=MAX;i++){
    if(p_table.at(i)){
      p.push_back(i);
      for(int j=2;i*j<=MAX;j++){
        p_table.at(i*j)=false;
      }
    }
  }
}

int main(){
  prime();
  int T;
  cin>>T;
  int n=p.size();
  for(int i=0;i<T;i++){
    ll X;
    cin>>X;
    for(ll num=2;;num++){
      vector<int> cnt1(n,0),cnt2(n,1);
      ll tmp=num;
      ll x=X;
      for(int j=0;j<n;j++){
        while(tmp%p[j]==0){
          tmp/=p[j];
          cnt1[j]++;
        }
        while(x%p[j]==0){
          x/=p[j];
          cnt2[j]++;
        }
      }
      int bunsi=1;
      int bunbo=1;
      for(int j=0;j<n;j++){
        bunsi*=cnt1[j]+cnt2[j];
        bunbo*=cnt2[j];
      }
      if(bunsi==2*bunbo){
        cout<<num*X<<endl;
        break;
      }
    }
  }
}
0