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> 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator