Monday, March 31, 2014

Codeforces Round #239 (Div. 2), problem: (A) Line to Cashier solution

Codeforces Round #239 (Div. 2), problem: (A) Line to Cashier: http://codeforces.com/contest/408/problem/A

Codeforces Round #239 (Div. 2), problem: (A) Line to Cashier editorial: http://codeforces.com/blog/entry/11333

Codeforces Round #239 (Div. 2), problem: (A) Line to Cashier solution: 

#include <iostream>
#include <cstdio>
#include <climits>
using namespace std;

int main() {
    int n, k[105], m, cnt, min;
    min=INT_MAX;
    scanf("%d", &n);
    for(int i=0; i<n; i++) scanf("%d", &k[i]);
    for(int i=0; i<n; i++) {
        cnt=0;
        for(int j=0; j<k[i]; j++) {
            scanf("%d", &m);
            cnt+=m*5;
            cnt+=15;
        }
        if(cnt<min) min=cnt;
    }
    printf("%d", min);
    return 0;
}

No comments:

Post a Comment