結果
問題 | No.736 約比 |
ユーザー |
|
提出日時 | 2019-03-01 17:33:58 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 434 bytes |
コンパイル時間 | 1,802 ms |
コンパイル使用メモリ | 169,064 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-23 12:07:43 |
合計ジャッジ時間 | 3,579 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 65 |
ソースコード
#include <bits/stdc++.h>using namespace std;typedef long long ll;ll gcd(ll x, ll y){if(x%y == 0) return y;return gcd(y, x%y);}int main(){int n;cin >> n;ll ans = 0;vector<ll> v(n);for(int i=0; i<n; i++){cin >> v[i];ans = gcd(ans, v[i]);}for(int i=0; i<n; i++){cout << ll(v[i]/ans);if(i != n-1) cout << ":";}cout << endl;return 0;}