hiho week 196 register

Ended

Participants:153

Verdict:Wrong Answer
Score:50 / 100
Submitted:2018-04-03 12:19:11

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 <algorithm>
#include <limits.h>
using namespace std;
const int maxCount = 100000 + 1;
int w[maxCount] = { 0 }, h[maxCount] = { 0 };
int first[maxCount] = { 0 };
int Next[maxCount] = { 0 };
int partSum[maxCount] = { 0 };
int posRow[maxCount] = { 0 };
int M, N;
class tryReturn {
public:
    int maxhei;
    int latter;
};
tryReturn oneTry(int front)
{
    int  tail = front;
    int sum = 0, maxh = 0;
    while (sum < M && tail<N)
    {
        if (sum + w[tail] <= M)
        {
            maxh = (maxh < h[tail]) ? h[tail] : maxh;
            sum += w[tail];
        }
        else
        {
            double ratio = double(M - sum) / double(w[tail]);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX