首页 > 其他 > 详细

codevs 3022 西天收费站

时间:2017-04-14 22:31:59      阅读:142      评论:0      收藏:0      [点我收藏+]

3022 西天收费站

 
题目描述 Description

唐僧师徒四人终于发现西天就在眼前,但猴子突然发现前面有n个收费站(如来佛太可恶),在每个收费站用不同的方式要交的钱不同,输入每个收费站的每种方法收的钱,输出最少花的钱。

输入描述 Input Description

参见样例

输出描述 Output Description

参见样例

样例输入 Sample Input

样例输入:

4              //四个地点a,b,c,d

3 3 2 2     //3种方法分别是3元,2元,2元,下同

3 100 50 50

1 10000

2 30000 50

样例输出 Sample Output

样例输出:10102

#include<cstdio>
#include<cmath>
#include<cstring>
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
long long int a;
long long int n,m,minn;
long long int tot;
int main()
{
    ios::sync_with_stdio(false);
    cin>>n;
    for(int i=0;i<n;i++)
    {
        minn=99999999999;
        cin>>m;
        for(int j=0;j<m;j++)
        {
            cin>>a;
            if(minn>a)
                minn=a;
        }
        tot+=minn;
    }
    cout<<tot;
    return 0;
}
/*
4
3 3 2 2
3 100 50 50
1 10000
2 30000 50
*/

 

codevs 3022 西天收费站

原文:http://www.cnblogs.com/kuaileyongheng/p/6710984.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!