結果
| 問題 | No.736 約比 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-01-24 02:11:15 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| + 815µs | |
| コード長 | 455 bytes |
| 記録 | |
| コンパイル時間 | 353 ms |
| コンパイル使用メモリ | 78,848 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-25 22:48:48 |
| 合計ジャッジ時間 | 3,382 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 65 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
long long gcd(long long a,long long b){
if(a%b)return gcd(b,a%b);
else return b;
}
int main(){
int n;cin>>n;
vector<long long> a(n);
long long nw;
for(int i = 0; n > i; i++){
cin>>a[i];
if(!i)nw = a[i];
else nw = gcd(a[i],nw);
}
for(int i = 0; n > i; i++){
cout << a[i]/nw;
if(i+1 != n)cout << ":";
}
cout << endl;
}