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

Ended

Participants:1323

Verdict:Accepted
Score:100 / 100
Submitted:2017-04-02 12:22:10

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
29
30
31
                                            
  //File Name: B.cpp
  //Created Time: 20170402  121320
                                   
#include <bits/stdc++.h>
#define LL long long
using namespace std;
const int MAXN = 100000 + 5;
vector<int> a[MAXN];
int num[MAXN];
map<int,int> rem;
int solve(int n){
    for(int i=0;i<n;++i){
        int cur = 0;
        for(int j=0;j<(int)a[i].size() - 1;++j){
            cur += a[i][j];
            ++rem[cur];
        }
    }
    int ans = 0;
    for(auto u:rem){
        if((u.second) > ans){
            ans = u.second;
        }
    }
    return n - ans;
}
int main(){
    int n;
    scanf("%d",&n);
    for(int i=0,u;i<n;++i){
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX