結果
| 問題 | No.736 約比 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-06-17 23:03:55 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 473 bytes | 
| コンパイル時間 | 1,435 ms | 
| コンパイル使用メモリ | 172,052 KB | 
| 実行使用メモリ | 13,752 KB | 
| 最終ジャッジ日時 | 2024-07-03 12:30:16 | 
| 合計ジャッジ時間 | 6,190 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | WA * 42 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;
}
            
            
            
        