結果
問題 | No.736 約比 |
ユーザー | Pachicobue |
提出日時 | 2018-09-28 22:50:21 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 47 ms / 2,000 ms |
コード長 | 489 bytes |
コンパイル時間 | 1,720 ms |
コンパイル使用メモリ | 195,452 KB |
最終ジャッジ日時 | 2025-01-06 13:58:33 |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 65 |
ソースコード
//================================= // Created on: 2018/09/28 22:47:29 //================================= #include <bits/stdc++.h> using ll = long long; int main() { int N; std::cin >> N; std::vector<ll> a(N); ll g = -1; for (int i = 0; i < N; i++) { std::cin >> a[i], g = (i == 0 ? a[i] : std::gcd(g, a[i])); } for (int i = 0; i < N; i++) { if (i > 0) { std::cout << ":"; } std::cout << a[i] / g; } std::cout << std::endl; return 0; }