結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー umezoumezo
提出日時 2021-07-21 23:50:44
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 686 bytes
コンパイル時間 2,062 ms
コンパイル使用メモリ 205,752 KB
実行使用メモリ 8,760 KB
最終ジャッジ日時 2023-09-24 20:00:17
合計ジャッジ時間 23,004 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 1,000 ms
4,376 KB
testcase_02 AC 1,131 ms
4,380 KB
testcase_03 AC 1,131 ms
4,380 KB
testcase_04 AC 1,132 ms
4,380 KB
testcase_05 AC 1,134 ms
4,380 KB
testcase_06 AC 1,130 ms
4,380 KB
testcase_07 AC 1,143 ms
4,376 KB
testcase_08 AC 1,128 ms
4,376 KB
testcase_09 AC 1,134 ms
4,380 KB
testcase_10 AC 412 ms
4,376 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内:
main.cpp:43:13: 警告: ‘c’ may be used uninitialized [-Wmaybe-uninitialized]
   43 |     cout<<c*x<<endl;
      |             ^
main.cpp:36:8: 備考: ‘c’ はここで定義されています
   36 |     ll c;
      |        ^

ソースコード

diff #

#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 prime_factor(ll x){
  map<ll,int> res;
  
  for(ll i=2;i*i<=x;i++){
    while(x%i==0){
      res[i]++;
      x/=i;
    }
  }
  if(x!=1) res[x]++;
  
  int ans=1;
  for(auto t:res) ans*=t.second+1;
  
  return ans;
}

int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  int t;
  cin>>t;
  while(t--){
    ll x;
    cin>>x;
    int tmp=prime_factor(x);
    
    ll c;
    for(int i=2;i<=31;i++){
      if(prime_factor(i*x)==2*tmp){
        c=i;
        break;
      }
    }
    cout<<c*x<<endl;
  }
  
  return 0;
}
0