Submission #741993

#TimeUsernameProblemLanguageResultExecution timeMemory
741993vjudge1Gap (APIO16_gap)C++17
Compilation error
0 ms0 KiB
long long findGap(int T, int N){
	long long l = 0, r = 1e18, L = 1, R = N;
	long long a[N+1], mn, mx;
	int cnt = 0;
	while(L <= R){
		cnt++;
		MinMax(l, r, &mn, &mx);
		a[L] = mn, a[R] = mx;
		L++, R--;
		l = mn+1;
		r = mx-1;
	}
	if(cnt > (N+1)/2){
		for(int i=1; i<=1e9; i++) cout << "WA";
	}
	long long ans = 0;
	for(int i=2; i<=N; i++){
		ans = max(ans, a[i] - a[i-1]);
	}
	return ans;
}

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:7:3: error: 'MinMax' was not declared in this scope
    7 |   MinMax(l, r, &mn, &mx);
      |   ^~~~~~
gap.cpp:14:29: error: 'cout' was not declared in this scope
   14 |   for(int i=1; i<=1e9; i++) cout << "WA";
      |                             ^~~~
gap.cpp:18:9: error: 'max' was not declared in this scope; did you mean 'mx'?
   18 |   ans = max(ans, a[i] - a[i-1]);
      |         ^~~
      |         mx