Submission #1092489

# Submission time Handle Problem Language Result Execution time Memory
1092489 2024-09-24T08:18:40 Z alexander707070 Gap (APIO16_gap) C++14
0 / 100
38 ms 7256 KB
#include<bits/stdc++.h>
#include "gap.h"

#define MAXN 600007
using namespace std;

const long long inf=1e18;

long long *l,*r,*ll,*rr;
long long d,ans;

long long findGap(int T, int N){

	l=new long long();
	r=new long long();

    MinMax(1, inf, l,r);

	if(N==2)return *r-*l;

	if(N<=100)return 1/0;

	d=ans=1;
	while(*l!=*r){
		while(true){
			ll=new long long();
			rr=new long long();
			MinMax((*l)+1,(*l)+d+1,ll,rr);

			if((*ll)!=-1)break;

			d*=2;
		}

		ans=max(ans,*ll-*l);
		d=ans;

		l=rr;
	}

	return ans;
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:21:20: warning: division by zero [-Wdiv-by-zero]
   21 |  if(N<=100)return 1/0;
      |                   ~^~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Runtime error 1 ms 344 KB Execution killed with signal 4
3 Runtime error 1 ms 344 KB Execution killed with signal 4
4 Runtime error 1 ms 344 KB Execution killed with signal 4
5 Runtime error 1 ms 344 KB Execution killed with signal 4
6 Runtime error 0 ms 344 KB Execution killed with signal 4
7 Runtime error 1 ms 344 KB Execution killed with signal 4
8 Runtime error 1 ms 344 KB Execution killed with signal 4
9 Runtime error 1 ms 344 KB Execution killed with signal 4
10 Runtime error 1 ms 344 KB Execution killed with signal 4
11 Correct 0 ms 344 KB Output is correct
12 Correct 0 ms 344 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 0 ms 344 KB Output is correct
15 Incorrect 1 ms 344 KB Output isn't correct
16 Correct 4 ms 600 KB Output is correct
17 Correct 5 ms 600 KB Output is correct
18 Correct 5 ms 600 KB Output is correct
19 Correct 7 ms 856 KB Output is correct
20 Correct 3 ms 856 KB Output is correct
21 Correct 18 ms 1880 KB Output is correct
22 Correct 17 ms 1872 KB Output is correct
23 Correct 22 ms 1624 KB Output is correct
24 Correct 26 ms 1872 KB Output is correct
25 Incorrect 38 ms 7248 KB Output isn't correct
26 Correct 17 ms 1624 KB Output is correct
27 Correct 17 ms 1624 KB Output is correct
28 Correct 26 ms 1880 KB Output is correct
29 Correct 17 ms 1880 KB Output is correct
30 Correct 13 ms 2136 KB Output is correct
31 Incorrect 0 ms 344 KB Output isn't correct
32 Incorrect 0 ms 344 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Runtime error 1 ms 344 KB Execution killed with signal 4
3 Runtime error 0 ms 344 KB Execution killed with signal 4
4 Runtime error 1 ms 344 KB Execution killed with signal 4
5 Runtime error 1 ms 344 KB Execution killed with signal 4
6 Runtime error 1 ms 600 KB Execution killed with signal 4
7 Runtime error 1 ms 344 KB Execution killed with signal 4
8 Runtime error 0 ms 600 KB Execution killed with signal 4
9 Runtime error 1 ms 344 KB Execution killed with signal 4
10 Runtime error 1 ms 344 KB Execution killed with signal 4
11 Correct 0 ms 344 KB Output is correct
12 Correct 1 ms 344 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Partially correct 1 ms 344 KB Partially correct
16 Correct 5 ms 856 KB Output is correct
17 Correct 7 ms 600 KB Output is correct
18 Correct 6 ms 600 KB Output is correct
19 Correct 5 ms 844 KB Output is correct
20 Correct 6 ms 856 KB Output is correct
21 Correct 16 ms 1624 KB Output is correct
22 Correct 17 ms 1872 KB Output is correct
23 Correct 17 ms 1880 KB Output is correct
24 Correct 16 ms 1624 KB Output is correct
25 Partially correct 35 ms 7256 KB Partially correct
26 Correct 17 ms 1880 KB Output is correct
27 Correct 21 ms 1880 KB Output is correct
28 Correct 26 ms 1932 KB Output is correct
29 Correct 22 ms 2220 KB Output is correct
30 Correct 13 ms 2136 KB Output is correct
31 Partially correct 0 ms 344 KB Partially correct
32 Correct 0 ms 344 KB Output is correct