标签:reg while type pac for using etc cpp tps
[题目链接] https://www.luogu.org/problemnew/show/P4549
// luogu-judger-enable-o2
#include<bits/stdc++.h>
#include<tr1/unordered_map>
using namespace std;
typedef long long LL;
const int INF=1e9+7;
inline LL read(){
register LL x=0,f=1;register char c=getchar();
while(c<48||c>57){if(c==‘-‘)f=-1;c=getchar();}
while(c>=48&&c<=57)x=(x<<3)+(x<<1)+(c&15),c=getchar();
return f*x;
}
int n,ans,x;
inline int gcd(int a,int b){return (!b)?a:gcd(b,a%b);}
int main(){
n=read();
ans=0;
for(int i=1;i<=n;i++){
int x=abs(read());
ans=gcd(ans,x);
}
printf("%d\n",ans);
}
标签:reg while type pac for using etc cpp tps
原文地址:https://www.cnblogs.com/lizehon/p/10423814.html