标签:
/*
ID: awsd1231
PROG: combo
LANG: C++
*/
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int n, num[2][3];
int one() {
int a[3] = {0};
for(int i = 0; i != 3; ++i) {
if(abs(num[0][i] - num[1][i]) < 5)
a[i] = 5 - abs(num[0][i] - num[1][i]);
else if(n-abs(num[0][i] - num[1][i]) < 5)
a[i] = 5 - n + abs(num[0][i] - num[1][i]);
}
return a[0] * a[1] * a[2];
}
int main() {
freopen("combo.in", "r", stdin);
freopen("combo.out", "w", stdout);
cin >> n;
for(int i = 0; i != 3; ++i) //农夫
cin >> num[0][i];
for(int i = 0; i != 3; ++i) //预设
cin >> num[1][i];
if(n < 6)
cout << n*n*n << endl;
else
cout << 250 - one() << endl;
return 0;
}
标签:
原文地址:http://www.cnblogs.com/liangyongrui/p/4541870.html