Croc Champ 2013 - Round 2 (Div. 2 Edition) A. Ksusha and Array

#include 
#include 
#include 

using namespace std;

int main(){
    int n;
    cin >> n;
    vector a(n);
    long long minv = 1<<30;
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        minv = min(a[i],minv);
    }
    int i = 0;
    for( i = 0; i < n; i ++ ){
        if(a[i]%minv != 0) break;
    }
    if(i < n) cout<<-1<

  

转载于:https://www.cnblogs.com/xiongqiangcs/archive/2013/04/23/3037005.html

你可能感兴趣的:(Croc Champ 2013 - Round 2 (Div. 2 Edition) A. Ksusha and Array)