結果
| 問題 | No.736 約比 | 
| コンテスト | |
| ユーザー |  merom686 | 
| 提出日時 | 2018-09-28 21:36:04 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 590 bytes | 
| コンパイル時間 | 762 ms | 
| コンパイル使用メモリ | 75,752 KB | 
| 実行使用メモリ | 6,824 KB | 
| 最終ジャッジ日時 | 2024-10-12 05:42:15 | 
| 合計ジャッジ時間 | 2,324 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 7 WA * 58 | 
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;
int gcd(int n, int m) {
    if (n < m) swap(n, m);
    while (m != 0) {
        int r = n % m;
        n = m;
        m = r;
    }
    return n;
}
int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    ll t = 0;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        t = gcd(t, a[i]);
    }
    for (int i = 0; i < n; i++) {
        cout << a[i] / t << ":\n"[i == n - 1];
    }
    return 0;
}
            
            
            
        