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

Ended

Participants:1323

Verdict:Accepted
Score:100 / 100
Submitted:2017-04-02 13:58:32

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<cstring>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
int height[100000000] = { 0 };
int main() {
    int n;
    while (scanf("%d", &n) != EOF) {
        vector<int> ceng(n);
        vector<int> width;
        for (int i = 0; i < n; i++) {
            scanf("%d", &ceng[i]);
            int th, tmpheight = 0;
            for (int j = 0; j < ceng[i]; j++) {
                scanf("%d", &th);
                tmpheight += th;
                if (j < ceng[i] - 1) {
                    width.push_back(tmpheight);
                }
            }
        }
        sort(width.begin(), width.end());
        int maxceng = 0, tmpmax = 1;
        for (int i = 1; i < width.size(); i++) {
            if (width[i] == width[i - 1])tmpmax++;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX