結果
問題 |
No.339 何人が回答したのか
|
ユーザー |
![]() |
提出日時 | 2018-06-13 15:41:31 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 548 bytes |
コンパイル時間 | 1,476 ms |
コンパイル使用メモリ | 166,804 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-30 14:07:03 |
合計ジャッジ時間 | 3,493 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 61 |
ソースコード
#include "bits/stdc++.h" #define REP(i,n,N) for(ll i=(n); i<(N); i++) #define RREP(i,n,N) for(ll i=(N-1); i>=n; i--) #define CK(n,a,b) (a)<=(n)&&(n)<(b) #define p(s) cout<<(s)<<endl #define first F #define second S typedef long long ll; using namespace std; const ll inf =1e9+7; ll N; ll A[110]; int main(){ while(cin>>N){ cin>>A[0]; ll g=A[0]; ll ans=0; REP(i,1,N){ cin>>A[i]; g = __gcd(g, A[i]); } REP(i,0,N){ ans+=A[i]/g; } p(ans); } }