結果
| 問題 | No.339 何人が回答したのか |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-02-06 19:58:07 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 387 bytes |
| 記録 | |
| コンパイル時間 | 875 ms |
| コンパイル使用メモリ | 173,736 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-10 02:34:20 |
| 合計ジャッジ時間 | 2,646 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 61 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100 + 1;
int a[MAXN];
int main(){
int n; scanf("%d", &n);
for(int i = 0; i < n; ++i)
scanf("%d", &a[i]);
int gcd = a[0];
for(int i = 1; i < n; ++i)
gcd = __gcd( gcd, a[i] );
int ans = 0;
for(int i = 0; i < n; ++i)
ans += a[i] / gcd;
printf("%d\n", ans);
return 0;
}