hiho week 252 register

Ended

Participants:94

Verdict:Accepted
Score:100 / 100
Submitted:2019-05-03 11:06:52

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
int main() {
    int n, ans = 0;
    map<int, int> count;
    cin >> n;
    for (int i = 0; i < n; i++) {
        int k, sum = 0;
        cin >> k;
        for (int j = 0; j < k; j++) {
            int x;
            cin >> x;
            if (j == k-1) break;
            sum += x;
            count[sum]++;
            ans = max(ans, count[sum]);
        }
    }
    cout << n - ans << endl;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX