結果
| 問題 |
No.736 約比
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-17 23:06:48 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 473 bytes |
| コンパイル時間 | 1,809 ms |
| コンパイル使用メモリ | 171,812 KB |
| 実行使用メモリ | 13,756 KB |
| 最終ジャッジ日時 | 2024-07-03 12:30:25 |
| 合計ジャッジ時間 | 6,911 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 WA * 15 TLE * 1 -- * 22 |
ソースコード
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
typedef long long ll;
int main(){
int n; cin>>n;
vector<ll> v(n);
ll mn=1e18;
rep(i,n){cin>>v[i]; mn=min(mn,v[i]);}
vector<ll> w;
bool flg=true;
for(ll i=2; i<sqrt(mn); i++){
for(auto x:v){
if(x%i!=0) flg=false;
}
if(flg)w.push_back(i);
}
ll ans=1;
for(auto x:w) ans*=x;
rep(i,n){
if(i) cout << ":";
cout << v[i]/ans;
}
cout << endl;
}