hiho week 252 register

Ended

Participants:94

Verdict:Accepted
Score:100 / 100
Submitted:2019-04-28 20:06:35

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
25
26
27
#include<bits/stdc++.h>
using namespace std;
int main(){
    unordered_map<long long,int> mp;
    int n;
    long long m,x;
     cin>>n;
    for(int i=0;i<n;i++){
        cin>>m;
        long long s=0;
        for(int j=0;j<m;j++){
            cin>>x;
            mp[s]++;
            s+=x;
        }
    }
    long long mx=0;
    int ans=n;
    for(auto &it:mp){
        if(it.first!=0&&it.second>mx){
            mx = it.second;
            ans = n-mx;
        }
    }
    cout<<ans<<endl;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX