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 on_pku at 2009-03-20 17:35:09 on Problem 1017
#include<iostream>

using namespace std;
int size[7];
int i,parcels,remain1,remain2,more2;
int more[4] = {0,5,3,1};

int main()
{
    
    while(1){
             for(i = 1; i < 7; i++)
                   cin >> size[i];
             int count = 0;
             for(i = 1; i < 7; i++)
                   if(size[i] == 0)   count ++;
             if(count == 6)   break;
             parcels = size[6] + size[5] + size[4] + size[3] / 4;
             remain2 = 5 * size[4] + more[size[3] % 4];
             if(size[2] > remain2){
                        more2 = size[2] - remain2;
                        parcels += (more2 + 8) / 9;
             }
             remain1 = 36 * parcels - 36 * size[6] - 25 * size[5] - 16 * size[4] - 9 * size[3] - 4 * size[2];
             if(size[1] > remain1){
                        size[1] -= remain1;
                        parcels += (size[1] + 35) / 36;
             }
             cout << parcels << endl;
    }
    return 0;
}
             

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