[Offer收割]编程练习赛12 register

Ended

Participants:1323

Verdict:Accepted
Score:100 / 100
Submitted:2017-04-02 12:39:09

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
28
#include<iostream>
#define Max 100000005
using namespace std;
unsigned short a[Max];
int main(){
#ifdef WFX
    freopen("B.txt","r",stdin);
#endif
    int N,n,sum=0;
    scanf("%d",&N);
    for(int i=0;i<N;++i){
        scanf("%d",&n);
        int len;
        sum = 0;
        for(int j=0;j<n;++j){
            scanf("%d",&len);
            sum += len;
            ++a[sum];
        }
    }
    int max = a[1];
    for(int i=2;i<sum;++i) if(max<a[i]) max = a[i];
    cout<<(N-max)<<endl;
    
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX