Codeforces Round #313 (Div. 2) C Gerald ' s hexagon//count//key is a length of 1 parallel to the A1 of how many, the middle of these, plus a1//and A4, is the sum of triangles//is quite simple, pay attention to the increment Initial value, and change, AC up # include <cstdio> #include <algorithm> #include <iostream> #include <cstring> Using namespace Std;int a[8];int flag;void input () {for (int i=2;i<=6;i++) { cin >> a[i];} } int add (int l,int r,int t) { if (l<r) swap (l,r); int x = 0; for (int i=1;i<=r;i++) { x+= i+t; } x + = (r+t) * (l-r); cout << "x =" << x << Endl; return x*2;} void Solve () { flag = 0; int x = min (a[3],a[5]); int sum = a[1] + a[4]; Sum + = Add (A[2],a[6],a[1]); Sum + = Add (X,x,a[4]); Sum-= (x+a[4]) * *; cout << sum << Endl;} int main () { //freopen ("1.txt", "R", stdin); while (Cin >> a[1]) { input (); Solve (); }}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Codeforces Round #313 (Div. 2) C Gerald ' s Hexagon count