Submission #560960

# Submission time Handle Problem Language Result Execution time Memory
560960 2022-05-12T05:47:32 Z Huy Gap (APIO16_gap) C++17
Compilation error
0 ms 0 KB
#include "gap.h"
#include<bits/stdc++.h>
//#define int long long
#define pii pair<int,int>
#define fi first
#define se second
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ldb = long double;
const int N = (int)5e5;
const int maxN = (int)5e5 + 5;
const int mod = 1e9 + 7;
//const int mod = 998244353;
const ll infty = 1e18;
const ll logn = 18;
const int base = 311;
const int Block_size = 500;
const int ep = 'a';

int cu[] = {0,0,1,-1};
int cv[] = {-1,1,0,0};

int du[] = {-1,-1,+1,1};
int dv[] = {-1,+1,-1,1};

int cled[] = {6,2,5,5,4,5,6,3,7,6};

void InputFile()
{
    freopen(".inp","r",stdin);
    freopen(".out","w",stdout);
    //freopen("test.out","r",stdin);
}

void FastInput()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
}

/*void MinMax(int L,int R,int x,int y)
{
    return;
}*/

ll findGap(int T, int n)
{
    ll res = 0;
    ll mini,maxi;
    MinMax(0, oo, &mini, &maxi);
    ll pre = a[1];
    ll h = (maxi - mini + n - 2) / (n - 1);
    h--;
    ll now = a[1] + 1;
    while(true)
    {
        ll p, q;
        MinMax(now, now + h, &p, &q);
        res = max(res, p - pre);
        pre = max(pre, q);
        now += h + 1;
        if(q == maxi) break;
    }
    return res;
}

/*void Read()
{

}

void Solve()
{

}

void Debug()
{
    //Main_sub();
    //Naive();
}


signed main()
{
    FastInput();
    //InputFile();
    //int sub_type;
    //cin >> sub_type;
    //Sieve();
    int test;
    //cin >> test;
    test = 1;
    while(test--)
        //for(int prc = 1; prc <= test; prc++)
    {
        Read();
        Solve();
        //Debug();
    }
}*/







Compilation message

gap.cpp:8: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    8 | #pragma GCC optimization ("O3")
      | 
gap.cpp:9: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    9 | #pragma GCC optimization ("unroll-loops")
      | 
gap.cpp: In function 'll findGap(int, int)':
gap.cpp:56:15: error: 'oo' was not declared in this scope
   56 |     MinMax(0, oo, &mini, &maxi);
      |               ^~
gap.cpp:57:14: error: 'a' was not declared in this scope
   57 |     ll pre = a[1];
      |              ^
gap.cpp: In function 'void InputFile()':
gap.cpp:36:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   36 |     freopen(".inp","r",stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~
gap.cpp:37:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   37 |     freopen(".out","w",stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~