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

Ended

Participants:1323

Verdict:Accepted
Score:100 / 100
Submitted:2017-04-02 12:15:29

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 <algorithm>
#include <cstring>
#include <vector>
#include <queue>
using namespace std;
int n;
int tpa[100000010];
int main()
{
    scanf("%d",&n);
    int tmax=0;
    for(int i = 0; i < n; i++)
    {
        int num;
        scanf("%d",&num);
        int tot = 0;
        int t;
        for(int j=0; j<num; j++)
        {
            scanf("%d",&t);
            tot += t;
            tpa[tot]++;
        }
        tmax=max(tmax,tot);
    }
    sort(tpa,tpa+tmax);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX