Practice for Microsoft 2015 Online Test register

Ended

Participants:1406

Verdict:Accepted
Score:100 / 100
Submitted:2014-10-18 12:32:28

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 <cstdio>  
#include <cstdlib>
#include <vector>
#include <stack>
using namespace std;
int main()
{
    int t,N,M;
    cin>>t;
    while(t--)
    {
        int A[100];
        cin>>N>>M;
        for(int i=0;i<N;i++)
            cin>>A[i];
        int ans=0;
        if(N<=M)
            ans=100;
        else
        {
            int k;
            for(int j=0;j<N-M-1;j++)
            {
                int tmp;
                if(j==0)
                    tmp=A[j+M];
                else
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX