| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
哪位大哥好心给组wa的数据吧#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator