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 Notforsell at 2010-03-26 23:02:26 on Problem 1017
#include <stdio.h>
#include <string.h>

int main()
{
    int pro[6] = {0};
    int count = 0;
    while(1)
    {
        scanf("%d%d%d%d%d%d", &pro[0], &pro[1], &pro[2],
                              &pro[3], &pro[4], &pro[5]);
            if(pro[0]+pro[1]+pro[2]+pro[3]+pro[4]+pro[5] == 0)
                break;
            else
                {
                    int t = 0;
                    int box[6][6] = {0};
                    count = pro[5]+pro[4]+pro[3]+(pro[2]+3)/4;
                    t = 20*pro[3] - 4*pro[1];
                    pro[1] = t >= 0 ? 0 : pro[1] - 5*pro[3];
                    pro[0] = pro[0] <= 11 * pro[4] ? 0 : pro[0] - 11*pro[4];
                    if(t > 0)
                        pro[0] = pro[0] <= t ? 0 : pro[0] - t;
                    pro[2] = pro[2]%4;
                    switch(pro[2])
                    {
                        case 0: count += (4*pro[1]+pro[1]+35) / 36; break;
                        case 1: if(pro[1] > 5) {
                                    pro[1] -= 5;
                                    pro[0] = pro[0] <= 7 ? 0 : pro[0]-7;
                                    count += (4*pro[1]+pro[0]+35) / 36;
                                }
                                else{
                                    if(pro[0] > 27 - 4*pro[1]){
                                        pro[0] = pro[0] - (27 - 4*pro[1]);
                                        count += (pro[0]+35) / 36;
                                    }
                                }
                                break;
                        case 2: if(pro[1] > 3){
                                    pro[1] -= 3;
                                    pro[0] = pro[0] <= 6 ? 0 : pro[0] - 6;
                                    count += (4*pro[1]+pro[0]+35) / 36;
                                }
                                else {
                                    if(pro[0] > 18 - 4*pro[1]){
                                        pro[0] = pro[0] - (18 - 4*pro[1]);
                                        count += (pro[0]+35) / 36;
                                    }
                                }
                                break;
                        case 3: if(pro[1] > 1) {
                                    pro[1] -= 1;
                                    pro[0] = pro[0] <= 5 ? 0 : pro[0] - 5;
                                    count += (4*pro[1]+pro[0]+35) / 36;
                                }
                                else {
                                    if(pro[0] > 9 - 4*pro[1]){
                                        pro[0] = pro[0] - (9 - 4*pro[1]);
                                        count += (pro[0]+35) / 36;
                                    }
                                }
                                break;
                        default : break;
                    }
                    printf("%d\n", count);
                }
    }
    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