hiho week 196 register

Ended

Participants:153

Verdict:Wrong Answer
Score:0 / 100
Submitted:2018-04-05 18:50:56

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 <vector>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <memory>
#include <cmath>
#include <list>
#include <iterator>
#include <tuple>
#include <algorithm>
using namespace std;
constexpr int MAXN = 1e5 + 8;
using ll = long long;
int M, N;
int widths[MAXN], heights[MAXN];
tuple<int, int, int> H[MAXN], F[MAXN];
int Solution() {
    memset(H, 0, sizeof H);
    memset(F, 0, sizeof F);
    int curLine = 0;
    int curHeight = 0, totHeight = 0, preHeight = 0;
    int leftWidth = M;
    get<2>(H[0]) = leftWidth;
    for (int i = 0; i < N; i++) {
        if (widths[i] <= leftWidth) {
            curHeight = max(curHeight, heights[i]);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX