結果
問題 | No.339 何人が回答したのか |
ユーザー |
![]() |
提出日時 | 2025-03-26 14:07:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 294 bytes |
コンパイル時間 | 1,635 ms |
コンパイル使用メモリ | 161,368 KB |
実行使用メモリ | 7,328 KB |
最終ジャッジ日時 | 2025-03-26 14:07:32 |
合計ジャッジ時間 | 4,056 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 61 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;#define rep(i, n) for(int i = 0; i < n; i++)int main() {int N;cin >> N;vector<int> a(N);rep(i, N) cin >> a[i];int d = 0, ans = 0;rep(i, N) d = __gcd(d, a[i]);rep(i, N) ans += a[i] / d;cout << ans << endl;}