結果

問題 No.736 約比
ユーザー uw_yu1rabbit
提出日時 2020-04-16 14:41:46
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 367 bytes
コンパイル時間 2,178 ms
コンパイル使用メモリ 194,040 KB
最終ジャッジ日時 2025-01-09 19:27:11
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 65
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
    int n;
    cin >> n;
    vector<ll> a(n);
    for(int i = 0; i < n; i++)
        cin >> a[i];
    ll k = a[0];
    for(int i = 0; i < n; i++){
        k = gcd(k,a[i]);
    }
    for(int i = 0; i < n; i++){
        a[i] /= k;
        cout << a[i] << (i == n - 1 ? "\n" : ":");
    }

}
0