MSBOP 2015 Round3 register

Ended

Participants:978

Verdict:AC | TLE
Submitted:2015-05-09 14:12:50

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 <algorithm>
#include <string>
#include <cstring>
#include <vector>
using namespace std;
#define N 200010
int a[N], n, m;
int find(int x, int y, int k)
{
    int ans = 1000000001;
    for (int i=x; i<=y; i++)
        if (abs(k-a[i])<ans)
        {
            ans = abs(k-a[i]);
        }
    return ans;
}
int main()
{
    std::ios::sync_with_stdio(false);
    int T, i;
    cin>>T;
    long long ans;
    for (i=1; i<=T; i++)
    {
        ans = 0;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX