結果

問題 No.736 約比
ユーザー ninoinui
提出日時 2020-01-31 08:24:30
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 348 bytes
コンパイル時間 1,558 ms
コンパイル使用メモリ 168,200 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-17 06:44:50
合計ジャッジ時間 3,555 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 65
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
  long N, M;
  cin >> N;
  vector<long> A(N);
  cin >> A.at(0) >> A.at(1);
  M = __gcd(A.at(0), A.at(1));
  for (long i = 2; i < N; i++) {
    cin >> A.at(i);
    M = __gcd(M, A.at(i));
  }
  for (int i = 0; i < N - 1; i++) cout << A.at(i) / M << ":";
  cout << A.at(N - 1) / M << "\n";
}
0