CodeForces 560A-Currency System in Geraldion
题目大意:看钱是否能凑成全部数字
解题思路:只有有1的情况下才能凑出全部数字。。。。。
#include <stdio.h>
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int x;
int r = 0;
while(n--) {
cin >> x;
if(x == 1)
r = 1;
}
if(r == 1)
printf("-1\n");
else
printf("1\n");
return 0;
}