markdown 在线制作ppt json校验和格式化工具

POJ 2336

#include <iostream>
using namespace std;

int main()
{
    //freopen("acm.acm","r",stdin);
    int test;
    int n;
    int t;
    int m;
    int odd;
    int mul;
    int i;
    int j;
    int time;
    int time_1;
    cin>>test;

    while(test --)
    {
        cin>>n;
        cin>>t;
        cin>>m;
        mul = m / n;
        odd = m % n;
        time_1 = 0;
        if(odd != 0)
        {
            for(i = 0; i < odd; ++ i)
            {
                cin>>time;
            }
            time_1 = time + 2*t;
        }
    //    cout<<time_1<<endl;
    //    time_1
        for(i = 0; i < mul; ++ i)
        {
            for(j = 0; j < n; ++ j)
            {
                cin>>time;
            }

            if(time < time_1)
            {
                time_1 = time_1 + 2*t;
            }
            else
            {
                time_1 = time + 2*t;
            }
        }

        cout<<time_1-t<<" "<<mul + !(odd == 0)<<endl;

    }
}

 

posted @ 2015-06-11 10:47  GavinHacker  阅读(152)  评论(0编辑  收藏  举报
markdown 在线制作ppt json校验和格式化工具