hiho week 252 register

Ended

Participants:94

Verdict:Accepted
Score:100 / 100
Submitted:2019-05-02 19:53:42

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
#include <iostream>
#include <cstdio>
using namespace std;
int wall[100000005]={0};
int main()
{
    int n,width,maxedge=0;
    cin >> n;
    char c;
    for(int i=0,edge,k;i<n;++i){
        cin >> k;
        edge=0;
        for(int j=0,tmp;j<k;++j){
            cin >> tmp;
            edge+=tmp;
            if(j<k-1) wall[edge]++;
        }
        width=edge;
    }
    for(int i=1;i<=width;++i)
        if(wall[i]>maxedge) maxedge=wall[i];
    cout << n-maxedge << endl;
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX