Submission #21850

# Submission time Handle Problem Language Result Execution time Memory
21850 2017-04-26T11:08:50 Z mohammad_kilani Gap (APIO16_gap) C++14
0 / 100
139 ms 12420 KB
#include "gap.h"
#include<bits/stdc++.h>
using namespace std;

map<long long,bool> vis;

long long findGap(int T, int N)
{
    long long mn,mx;
    long long ans =1e18+2  ;
    vector<long long> v;
    long long s = 0 , e = 1e18;
    for(int i=0;i<(N+1)/2;i++){
        MinMax(s,e,&mn,&mx);
        if(!vis[mn])
        v.push_back(mn);
        vis[mn] = true;
        if(!vis[mx])
        v.push_back(mx);
        vis[mx] = 1;
        s = mn+1;
        e = mx-1;
    }
    sort(v.begin(),v.end());
    int si = v.size();
    for(int i=0;i<si;i++){
        ans = min(ans,v[i+1]-v[i]);
    }
    return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 5152 KB Output isn't correct
2 Incorrect 0 ms 5152 KB Output isn't correct
3 Incorrect 0 ms 5152 KB Output isn't correct
4 Incorrect 0 ms 5152 KB Output isn't correct
5 Incorrect 0 ms 5152 KB Output isn't correct
6 Incorrect 0 ms 5152 KB Output isn't correct
7 Incorrect 0 ms 5152 KB Output isn't correct
8 Incorrect 0 ms 5152 KB Output isn't correct
9 Incorrect 0 ms 5152 KB Output isn't correct
10 Incorrect 0 ms 5152 KB Output isn't correct
11 Incorrect 0 ms 5284 KB Output isn't correct
12 Incorrect 0 ms 5284 KB Output isn't correct
13 Incorrect 0 ms 5284 KB Output isn't correct
14 Incorrect 0 ms 5284 KB Output isn't correct
15 Incorrect 0 ms 5284 KB Output isn't correct
16 Incorrect 29 ms 7032 KB Output isn't correct
17 Incorrect 26 ms 7032 KB Output isn't correct
18 Incorrect 26 ms 7032 KB Output isn't correct
19 Incorrect 23 ms 7032 KB Output isn't correct
20 Incorrect 23 ms 7032 KB Output isn't correct
21 Incorrect 113 ms 12420 KB Output isn't correct
22 Incorrect 103 ms 12420 KB Output isn't correct
23 Incorrect 109 ms 12420 KB Output isn't correct
24 Incorrect 116 ms 12420 KB Output isn't correct
25 Incorrect 96 ms 12420 KB Output isn't correct
26 Incorrect 139 ms 12420 KB Output isn't correct
27 Incorrect 106 ms 12420 KB Output isn't correct
28 Incorrect 116 ms 12420 KB Output isn't correct
29 Incorrect 106 ms 12420 KB Output isn't correct
30 Incorrect 99 ms 12420 KB Output isn't correct
31 Incorrect 0 ms 5152 KB Output isn't correct
32 Incorrect 0 ms 5152 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 5152 KB Output isn't correct
2 Incorrect 0 ms 5152 KB Output isn't correct
3 Incorrect 0 ms 5152 KB Output isn't correct
4 Incorrect 0 ms 5152 KB Output isn't correct
5 Incorrect 0 ms 5152 KB Output isn't correct
6 Incorrect 0 ms 5152 KB Output isn't correct
7 Incorrect 0 ms 5152 KB Output isn't correct
8 Incorrect 0 ms 5152 KB Output isn't correct
9 Incorrect 0 ms 5152 KB Output isn't correct
10 Incorrect 0 ms 5152 KB Output isn't correct
11 Incorrect 0 ms 5284 KB Output isn't correct
12 Incorrect 0 ms 5284 KB Output isn't correct
13 Incorrect 0 ms 5284 KB Output isn't correct
14 Incorrect 0 ms 5284 KB Output isn't correct
15 Incorrect 0 ms 5284 KB Output isn't correct
16 Incorrect 26 ms 7032 KB Output isn't correct
17 Incorrect 23 ms 7032 KB Output isn't correct
18 Incorrect 23 ms 7032 KB Output isn't correct
19 Incorrect 23 ms 7032 KB Output isn't correct
20 Incorrect 29 ms 7032 KB Output isn't correct
21 Incorrect 113 ms 12420 KB Expected int32, but "2500100000" found
22 Incorrect 103 ms 12420 KB Expected int32, but "2500100000" found
23 Incorrect 106 ms 12420 KB Expected int32, but "2500100000" found
24 Incorrect 116 ms 12420 KB Expected int32, but "2500100000" found
25 Incorrect 99 ms 12420 KB Expected int32, but "2500100000" found
26 Incorrect 109 ms 12420 KB Expected int32, but "2500100000" found
27 Incorrect 109 ms 12420 KB Expected int32, but "2500100000" found
28 Incorrect 106 ms 12420 KB Expected int32, but "2500100000" found
29 Incorrect 119 ms 12420 KB Expected int32, but "2500100000" found
30 Incorrect 129 ms 12420 KB Expected int32, but "2500100000" found
31 Incorrect 0 ms 5152 KB Output isn't correct
32 Incorrect 0 ms 5152 KB Output isn't correct