Practice for Microsoft 2015 Online Test register

Ended

Participants:1406

Verdict:Accepted
Score:100 / 100
Submitted:2014-10-18 12:55:38

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>
using namespace std;
struct datatype
{
    int N;
    int M;
    vector<int> data;
};
int continueDay(vector<int> data, int N, int M)
{
    if(M >= N)
    {
        return 100;
    }
    data.push_back(100);
    int max = data[M] - 1;
    for(int i = M+1; i < N+1; i++)
    {
        if(max < (data[i] - data[i-M-1] - 1))
            max = data[i] - data[i-M-1] - 1;
    }
    return max;
}
int main()
{
    int T;
    vector< struct datatype > Tdata;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX