Practice for Microsoft 2015 Online Test register

Ended

Participants:1406

Verdict:Accepted
Score:100 / 100
Submitted:2014-10-18 12:39:48

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<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
const int MAXN = 100;
const int totaln = 100;
int main(){
    int T;
    scanf("%d", &T);
    while (T--){
        int n, m;
        scanf("%d%d", &n, &m);
        vector<int>absent;
        int tmp;
        int i;
        for (i = 0; i < n; ++i){
            scanf("%d", &tmp);
            absent.push_back(tmp - 1);
        }
        if (m >= n){
            puts("100");
            continue;
        }
        absent.push_back(-1);
        absent.push_back(totaln);
        sort(absent.begin(), absent.end());
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX