Submission #1003710

# Submission time Handle Problem Language Result Execution time Memory
1003710 2024-06-20T16:01:15 Z MarwenElarbi Gap (APIO16_gap) C++17
0 / 100
68 ms 1500 KB
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define fi first
#define se second
#define ll long long
#define pb push_back
#define ii pair<int,int>
const int nax=2e3+5;
void MinMax(long long, long long, long long*, long long*);
long long findGap(int T, int N)
{
    long long lst,mx;
    MinMax(0,1e18,&lst,&mx);
    long long ans=1;
    long long q=lst;
    while(mx>lst){
        cout <<lst<<" "<<ans<<" "<<mx<<endl;
        //return ;
        long long a,b;
        MinMax(q+1,q+ans,&a,&b);
        if(a==-1){
            while(a==-1){
                ans*=2;
                MinMax(q+1,q+ans,&a,&b);
            }
            ans=a-lst;
            q=ans+lst;
            lst=b;
        }else{
            lst=b;
            q=lst;
        }
    }
    return ans;
}

# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Expected EOLN
2 Incorrect 0 ms 344 KB Expected EOLN
3 Incorrect 0 ms 344 KB Expected EOLN
4 Incorrect 0 ms 344 KB Expected EOLN
5 Incorrect 0 ms 344 KB Expected EOLN
6 Incorrect 0 ms 344 KB Expected EOLN
7 Incorrect 0 ms 344 KB Expected EOLN
8 Incorrect 0 ms 344 KB Expected EOLN
9 Incorrect 0 ms 344 KB Expected EOLN
10 Incorrect 0 ms 344 KB Expected EOLN
11 Incorrect 1 ms 344 KB Expected EOLN
12 Incorrect 1 ms 344 KB Expected EOLN
13 Incorrect 1 ms 344 KB Expected EOLN
14 Incorrect 1 ms 344 KB Expected EOLN
15 Incorrect 1 ms 344 KB Expected EOLN
16 Incorrect 8 ms 664 KB Expected EOLN
17 Incorrect 8 ms 600 KB Expected EOLN
18 Incorrect 5 ms 680 KB Expected EOLN
19 Incorrect 6 ms 600 KB Expected EOLN
20 Incorrect 8 ms 600 KB Expected EOLN
21 Incorrect 19 ms 1112 KB Expected EOLN
22 Incorrect 28 ms 1112 KB Expected EOLN
23 Incorrect 19 ms 1112 KB Expected EOLN
24 Incorrect 21 ms 1256 KB Expected EOLN
25 Incorrect 68 ms 1112 KB Expected EOLN
26 Incorrect 21 ms 1112 KB Expected EOLN
27 Incorrect 31 ms 1500 KB Expected EOLN
28 Incorrect 20 ms 1112 KB Expected EOLN
29 Incorrect 19 ms 1112 KB Expected EOLN
30 Incorrect 37 ms 1112 KB Expected EOLN
31 Incorrect 1 ms 344 KB Expected EOLN
32 Incorrect 0 ms 344 KB Expected EOLN
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Expected EOLN
2 Incorrect 0 ms 344 KB Expected EOLN
3 Incorrect 0 ms 344 KB Expected EOLN
4 Incorrect 0 ms 344 KB Expected EOLN
5 Incorrect 0 ms 344 KB Expected EOLN
6 Incorrect 0 ms 344 KB Expected EOLN
7 Incorrect 0 ms 344 KB Expected EOLN
8 Incorrect 0 ms 344 KB Expected EOLN
9 Incorrect 0 ms 344 KB Expected EOLN
10 Incorrect 0 ms 344 KB Expected EOLN
11 Incorrect 1 ms 344 KB Expected EOLN
12 Incorrect 1 ms 344 KB Expected EOLN
13 Incorrect 1 ms 344 KB Expected EOLN
14 Incorrect 1 ms 344 KB Expected EOLN
15 Incorrect 1 ms 344 KB Expected EOLN
16 Incorrect 7 ms 600 KB Expected EOLN
17 Incorrect 5 ms 600 KB Expected EOLN
18 Incorrect 8 ms 692 KB Expected EOLN
19 Incorrect 6 ms 600 KB Expected EOLN
20 Incorrect 10 ms 600 KB Expected EOLN
21 Incorrect 17 ms 1112 KB Expected EOLN
22 Incorrect 21 ms 1364 KB Expected EOLN
23 Incorrect 20 ms 1112 KB Expected EOLN
24 Incorrect 30 ms 1112 KB Expected EOLN
25 Incorrect 65 ms 1112 KB Expected EOLN
26 Incorrect 26 ms 1060 KB Expected EOLN
27 Incorrect 21 ms 1140 KB Expected EOLN
28 Incorrect 22 ms 1112 KB Expected EOLN
29 Incorrect 25 ms 1272 KB Expected EOLN
30 Incorrect 32 ms 1112 KB Expected EOLN
31 Incorrect 0 ms 344 KB Expected EOLN
32 Incorrect 0 ms 344 KB Expected EOLN