Submission #923323

# Submission time Handle Problem Language Result Execution time Memory
923323 2024-02-07T06:19:18 Z hasan2006 Gap (APIO16_gap) C++17
30 / 100
30 ms 5112 KB
#include <bits/stdc++.h>
#include "gap.h"
using namespace std;

#define TL ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define rall(s) s.rbegin(),s.rend()
#define all(s) s.begin(),s.end()
#define pb push_back
#define se second
#define fi first
#define ll long long
#define ld long double
#define YES cout<<"YES\n"
#define Yes cout<<"Yes\n"
#define yes cout<<"yes\n"
#define NO cout<<"NO\n"
#define No cout<<"No\n"
#define no cout<<"no\n"


const int N = 5e5 + 9 , mod = 1e9 + 7;
ll a[N] ;

ll findGap(int t , int n){
    ll ans = 0;
    if(t == 1){
        ll mx = 1e18;
        ll mn = 1;
        ll l , r;
        vector<int>v;
        for(int i = 1; i <= (n + 1) / 2; i++){
            MinMax(mn , mx , &l , &r);
            a[i] = l;
            if(l != r)
                a[n - i + 1] = r;
            mn = l + 1;
            mx = r - 1;
        }
        for(int i = 1; i < n; i++){
            ans = max(ans , a[i + 1] - a[i]);
        }
    }
    return ans;
}
/*
void solve()
{
    ll n , q , i , j ,l ,r , x , y , s = 0 , f , k , m , mx = 0 , mn = 1e18;

}

int main(){
    TL;
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
int t = 1;
cin>>t;
while(t--)
     {
     solve();
     }
}
// Author : حسن
*/
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 2492 KB Output is correct
3 Correct 1 ms 2392 KB Output is correct
4 Correct 1 ms 2392 KB Output is correct
5 Correct 1 ms 2392 KB Output is correct
6 Correct 1 ms 2392 KB Output is correct
7 Correct 1 ms 2392 KB Output is correct
8 Correct 0 ms 2392 KB Output is correct
9 Correct 0 ms 2392 KB Output is correct
10 Correct 0 ms 2496 KB Output is correct
11 Correct 1 ms 2392 KB Output is correct
12 Correct 1 ms 2392 KB Output is correct
13 Correct 1 ms 2392 KB Output is correct
14 Correct 1 ms 2392 KB Output is correct
15 Correct 1 ms 2392 KB Output is correct
16 Correct 8 ms 4756 KB Output is correct
17 Correct 8 ms 4596 KB Output is correct
18 Correct 8 ms 4592 KB Output is correct
19 Correct 8 ms 4588 KB Output is correct
20 Correct 6 ms 4584 KB Output is correct
21 Correct 29 ms 4856 KB Output is correct
22 Correct 29 ms 4860 KB Output is correct
23 Correct 29 ms 5020 KB Output is correct
24 Correct 29 ms 4856 KB Output is correct
25 Correct 26 ms 5040 KB Output is correct
26 Correct 30 ms 4852 KB Output is correct
27 Correct 29 ms 4848 KB Output is correct
28 Correct 28 ms 5112 KB Output is correct
29 Correct 29 ms 4852 KB Output is correct
30 Correct 23 ms 4840 KB Output is correct
31 Correct 1 ms 2392 KB Output is correct
32 Correct 1 ms 2392 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2392 KB Output isn't correct
2 Incorrect 1 ms 2392 KB Output isn't correct
3 Incorrect 1 ms 2392 KB Output isn't correct
4 Incorrect 1 ms 2392 KB Output isn't correct
5 Incorrect 1 ms 2644 KB Output isn't correct
6 Incorrect 0 ms 2392 KB Output isn't correct
7 Incorrect 1 ms 2392 KB Output isn't correct
8 Incorrect 1 ms 2392 KB Output isn't correct
9 Incorrect 0 ms 2392 KB Output isn't correct
10 Incorrect 1 ms 2404 KB Output isn't correct
11 Incorrect 1 ms 2392 KB Output isn't correct
12 Incorrect 1 ms 2392 KB Output isn't correct
13 Incorrect 1 ms 2392 KB Output isn't correct
14 Incorrect 1 ms 2392 KB Output isn't correct
15 Incorrect 1 ms 2392 KB Output isn't correct
16 Incorrect 4 ms 2540 KB Output isn't correct
17 Incorrect 4 ms 2548 KB Output isn't correct
18 Incorrect 4 ms 2544 KB Output isn't correct
19 Incorrect 4 ms 2544 KB Output isn't correct
20 Incorrect 2 ms 2648 KB Output isn't correct
21 Incorrect 22 ms 2732 KB Output isn't correct
22 Incorrect 13 ms 2808 KB Output isn't correct
23 Incorrect 13 ms 2808 KB Output isn't correct
24 Incorrect 14 ms 2804 KB Output isn't correct
25 Incorrect 10 ms 2796 KB Output isn't correct
26 Incorrect 13 ms 2808 KB Output isn't correct
27 Incorrect 13 ms 2808 KB Output isn't correct
28 Incorrect 13 ms 2812 KB Output isn't correct
29 Incorrect 13 ms 2696 KB Output isn't correct
30 Incorrect 8 ms 2800 KB Output isn't correct
31 Incorrect 1 ms 2392 KB Output isn't correct
32 Incorrect 0 ms 2392 KB Output isn't correct