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

Ended

Participants:1323

Verdict:Accepted
Score:100 / 100
Submitted:2017-04-02 12:26:01

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
#include <iostream>
#include <cstdio>
#include <map>
using namespace std;
int n = 0;
map<int, int> mp;
int main()
{
    int m = 0;
    int temp = 0;
    int sum = 0;
    map<int, int>::iterator it;
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        sum = 0;
        scanf("%d", &m);
        for (int j = 0; j < m; j++)
        {
            scanf("%d", &temp);
            sum += temp;
            mp[sum]++;
        }
    }
    it = mp.end();
    it--;
    mp.erase(it);
    int max = 0;
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX