結果
問題 | No.736 約比 |
ユーザー |
![]() |
提出日時 | 2019-09-30 13:00:04 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 433 bytes |
コンパイル時間 | 1,665 ms |
コンパイル使用メモリ | 168,264 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-03 05:10:41 |
合計ジャッジ時間 | 2,942 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 65 |
ソースコード
#include <bits/stdc++.h>using namespace std;typedef unsigned long long ull;typedef long long ll;ll gcd(ll a, ll b){if(a<b) swap(a,b);if(b==0) return a;return gcd(b, a%b);}int main(){int n;cin >> n;ll a[n];for(int i=0; i<n; i++) cin >> a[i];ll g=gcd(a[0], a[1]);for(int i=2; i<n; i++) g=gcd(g, a[i]);for(int i=0; i<n; i++){cout << a[i]/g;if(i!=n-1) cout << ":";}cout << endl;return 0;}