aiheshan

有多自律,才能有多自由

导航

UVa 10300 - Ecological Premium

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=show_problem&problem=1241

思路:求premium值,就是面积*环境友好度;其中动物个数和每个动物所占size为多余信息。

 1 #include<iostream>
 2 using namespace std;
 3 
 4 int main()
 5 {
 6   int a,b,c;
 7   int sum;
 8   int t,m;
 9   cin>>t;
10   while(t--)
11   {
12     cin>>m;
13     sum=0;
14     while(m--)
15      {
16        cin>>a>>b>>c;
17        sum+=a*c;
18       }
19      cout<<sum<<endl;
20    }
21    return 0;
22 }

 

posted on 2016-08-03 16:55  aiheshan  阅读(188)  评论(0编辑  收藏  举报