結果
問題 | No.736 約比 |
ユーザー |
![]() |
提出日時 | 2020-08-11 10:37:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 447 bytes |
コンパイル時間 | 2,058 ms |
コンパイル使用メモリ | 170,020 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-09 11:14:40 |
合計ジャッジ時間 | 3,703 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 65 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;int main(){ios::sync_with_stdio(false);cin.tie(nullptr);int n;cin >> n;vector<ll> va(n);for (int i = 0; i < n; ++i)cin >> va[i];ll g{ va[0] };for (int i = 1; i < n; ++i)g = __gcd(g, va[i]);for (int i = 0; i < n - 1; ++i)cout << va[i] / g << ":";cout << va[n - 1] / g << "\n";return 0;}