結果
| 問題 |
No.736 約比
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-14 12:52:41 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 475 bytes |
| コンパイル時間 | 1,512 ms |
| コンパイル使用メモリ | 167,480 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-01 16:56:53 |
| 合計ジャッジ時間 | 2,971 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 WA * 58 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
using ll = long long ;
using P = pair<int,int> ;
const int INF = 1e9;
const int MOD = 1000000007;
ll gcd(ll i,ll j){
if(j == 0) return i;
return gcd(j,i%j);
}
int main(){
int n;
cin >> n;
vector<int> a(n);
rep(i,n) cin >> a[i];
ll p = 0;
rep(i,n) p = gcd(p,a[i]);
rep(i,n){
cout << a[i]/p << (i==n-1 ? '\n' : ':');
}
return 0;
}