P4549 【模板】裴蜀定理
作者:互联网
1 #include <bits/stdc++.h> 2 using namespace std; 3 int main() { 4 int n; scanf("%d",&n); 5 int ans; 6 for (int i = 1; i <= n; ++i) { 7 int x; scanf("%d",&x); 8 x = abs(x); 9 if (i == 1) ans = x; 10 else ans = __gcd(ans,x); 11 } 12 printf("%d\n",ans); 13 return 0; 14 }
标签:std,P4549,int,定理,裴蜀,模板 来源: https://www.cnblogs.com/wstong/p/11778742.html