結果
問題 | No.736 約比 |
ユーザー |
|
提出日時 | 2020-04-01 04:49:10 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 414 bytes |
コンパイル時間 | 492 ms |
コンパイル使用メモリ | 55,220 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-25 21:32:35 |
合計ジャッジ時間 | 2,748 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 65 |
ソースコード
#include <iostream> using namespace std; using ull = unsigned long long; ull GCD(ull x,ull y){ if(y==0)return x; else return GCD(y,x%y); } int main(){ int N; ull a[100],gcd; cin >> N; for(int i=0;i<N;i++){ cin >> a[i]; if(i==0)gcd=a[i]; else gcd=GCD(a[i],gcd); } for(int i=0;i<N;i++){ if(i>0)cout << ":"; cout << a[i]/gcd; }cout << endl; }