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

Ended

Participants:1323

Verdict:Accepted
Score:100 / 100
Submitted:2017-04-02 12:50:18

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
#include <bits/stdc++.h>
using namespace std;
int a[100000000+5];
int main(){
    int n;
    scanf("%d",&n);
    int M=0;
    for (int i=1;i<=n;i++){
        int x,tmp=0,b;
        scanf("%d",&x);
        for (int j=1;j<x;j++){
            scanf("%d",&b);
            tmp+=b;
            a[tmp]++;
            M=max(M,a[tmp]);
        }
        scanf("%d",&b);
    }
    printf("%d\n",n-M);
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX