#include <iostream>
#include <algorithm>
#include <stdio.h>
using namespace std;
int a[10]={2,3,4,5,6,7,8,10,12,14};
int b[9];
int main(){
do{
bool flag = true;
int tmp = 16+a[0]+a[1]+13;
b[0] = a[2]+a[3]+11+a[4];
b[1] = 9+a[5]+a[6]+a[7];
b[2] = a[8]+15+a[9]+1;
b[3] = 16+a[2]+9+a[8];
b[4] = a[0]+a[3]+a[5]+15;
b[5] = a[1]+11+a[6]+a[9];
b[6] = 13+a[4]+a[7]+1;
b[7] = 16+a[3]+a[6]+1;
b[8] = 13+11+a[5]+a[8];
for(int i=0;i<9;i++){
if(b[i] != tmp){
flag = false;
}
}
if(flag) break;
}while(next_permutation(a,a+10));
cout<<a[7]<<endl;
/*for(int i=0;i<10;i++){
cout<<a[i]<<" ";
}*/
return 0;
}
02-26
512
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)