错误原因是这个
20pts,AC点2,3,hack过了
玄关
#include <bits/stdc++.h>
#define int long long
using namespace std;
int a[7],k,sum;
void darksea(int sum, int k) {
for(int i1 = 0; i1 <= a[1]; i1++)
for(int i2 = 0; i2 <= a[2]; i2++)
for(int i3 = 0; i3 <= a[3]; i3++)
for(int i4 = 0; i4 <= a[4]; i4++)
for(int i5 = 0; i5 <= a[5]; i5++)
for(int i6 = 0; i6 <= a[6]; i6++){
int mid = i1+2*i2+3*i3+4*i4+5*i5+6*i6;
if(mid == sum/2){
cout<<"Collection #"<<k<<':'<<endl;
cout<<"Can be divided."<<endl;
return;
}
}
cout<<"Collection #"<<k<<':'<<endl;
cout<<"Can't be divided."<<endl;
}
signed main() {
bool first = true;
while(true){
k++;
sum = 0;
int tmp = 0;
for(int i = 1; i <= 6; i++){
cin>>a[i];
sum += i*a[i];
if(!a[i]) tmp++;
}
if(tmp == 6) break;
if(!first) cout << endl;
first = false;
darksea(sum,k);
}
return 0;
}