#include <iostream>
#include <algorithm>
#include <vector>
#include <numeric> using namespace std; int main(){
int n;
cin >> n;
vector<int> x(n,);
for(int i = ; i < n; ++ i ){
cin >> x[i];
}
bool flag = true;
while(flag){
flag = false;
sort(x.begin(),x.end());
for(int i = n - ; i >=; i -- ){
if(x[i]-x[i-] > ){
x[i]-=x[i-];
flag = true;
}
}
}
cout<<accumulate(x.begin(),x.end(),)<<endl;
return ;
}
相关文章
- Educational Codeforces Round 78 (Rated for Div. 2) A. Shuffle Hashing
- Codeforces Round #248 (Div. 2) A. Kitahara Haruki's Gift
- Codeforces Round #340 (Div. 2) E. XOR and Favorite Number
- Codeforces Round #340 (Div. 2) E. XOR and Favorite Number (莫队)
- Codeforces Round #340 (Div. 2) E. XOR and Favorite Number —— 莫队算法
- Codeforces Round #340 (Div. 2) E XOR and Favorite Number 莫队板子
- Codeforces Round #497 (Div. 2) A. Romaji
- Codeforces Round #419 (Div. 2) C. Karen and Game
- Codeforces Round #325 (Div. 2) A. Alena's Schedule 水题
- Codeforces Round #192 (Div. 2) (330A) A. Cakeminator