andmej / acm

My solutions for problems from the UVa Online Judge (Valladolid).

This URL has Read+Write access

acm / 10300 - Ecological Premium / 10300.cpp
100644 18 lines (16 sloc) 0.264 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
using namespace std;
 
int main(){
  int casos;
  cin >> casos;
  while (casos--){
    unsigned long long r=0, a, c;
    unsigned i;
    cin >> i;
    while (i--){
      cin >> a >> c >> c;
      r += a*c;
    }
    cout << r << endl;
  }
}