Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

哪位大哥好心给组wa的数据吧

Posted by 00448143 at 2005-03-31 20:48:18 on Problem 1017
#include <iostream.h>
#include <math.h>

void main()
{
	int a1, a2, a3, a4, a5, a6, count, temp;
	double area;
	while(1){
		cin>>a1>>a2>>a3>>a4>>a5>>a6;
		count = 0;
		area = 36 * a6 + 25 * a5 + 16 * a4 + 9 * a3 + 4 * a2 + a1;
		if ( area == 0 )
			return;
		count += a4 + a5 + a6;
		count += ( int )ceil( ( double ) a3 / 4 );
		temp = a2 > a4 * 5 ? a2 - a4 * 5 : 0;
		if ( temp ){
			switch ( a3 % 4 ){
			case 1:
				temp = temp > 5 ? temp - 5 : 0;
				break;
			case 2:
				temp = temp > 3 ? temp - 3 : 0;
				break;
			case 3:
				temp -= 1;
				break;
			}
			count += ( int )ceil ( ( double ) temp / 9 );
		}
		count += area > 36 * count ? ( int ) ceil ( ( area - 36 * count ) / 36 ) : 0;
		cout<<count<<endl;
	}
	return;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator