Practice for Microsoft 2015 Online Test register

Ended

Participants:1406

Verdict:Runtime Error
Score:0 / 100
Submitted:2014-10-18 12:52:46

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
#include<iostream>
using namespace std;
int main(void)
{
    int t;
    cin>>t;
    int i = 1;
    int n,m;
    while(i <= t)
    {
        cin>>n>>m;
        cout<<endl;
        int k[100];
        for(int j = 0;j < n; j++)
        {
            cin>>k[j];
        }
        cout<<endl;
        if(m>=n)
        {
            cout<<100<<endl;
        }
        else
        {
            cout<<k[m]-1<<endl;
        
        }
    }
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX