QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#492081#4. GapKiharaTouma#Compile Error//C++23411b2024-07-26 09:06:362024-07-26 09:06:37

Judging History

你现在查看的是最新测评结果

  • [2024-07-26 09:06:37]
  • 评测
  • [2024-07-26 09:06:36]
  • 提交

answer

//qoj4
#include <bits/stdc++.h>
using namespace std;
#include "gap.h"

long long findGap(int T, int n){
	static long long a[100010];
	if(T == 1){
		a[0] = -1, a[n+1] = 1e18 + 1;
		for(int i = 1, j = n; i <= j; ++ i, -- j){
			MinMax(a[i-1] + 1, a[j+1] - 1, a[i], a[j]);
		}
		long long mx = 0;
		for(int i = 1; i < n; ++ i){
			mx = max(mx, a[i+1] - a[i]);
		}
		return mx;
	} else {
		
	}
}

Details

answer.code: In function ‘long long int findGap(int, int)’:
answer.code:11:59: error: invalid conversion from ‘long long int’ to ‘long long int*’ [-fpermissive]
   11 |                         MinMax(a[i-1] + 1, a[j+1] - 1, a[i], a[j]);
      |                                                        ~~~^
      |                                                           |
      |                                                           long long int
In file included from answer.code:4:
gap.h:2:35: note:   initializing argument 3 of ‘void MinMax(long long int, long long int, long long int*, long long int*)’
    2 | void MinMax(long long, long long, long long*, long long*);
      |                                   ^~~~~~~~~~
answer.code:11:65: error: invalid conversion from ‘long long int’ to ‘long long int*’ [-fpermissive]
   11 |                         MinMax(a[i-1] + 1, a[j+1] - 1, a[i], a[j]);
      |                                                              ~~~^
      |                                                                 |
      |                                                                 long long int
gap.h:2:47: note:   initializing argument 4 of ‘void MinMax(long long int, long long int, long long int*, long long int*)’
    2 | void MinMax(long long, long long, long long*, long long*);
      |                                               ^~~~~~~~~~
answer.code:21:1: warning: control reaches end of non-void function [-Wreturn-type]
   21 | }
      | ^