제출 #975829

#제출 시각아이디문제언어결과실행 시간메모리
975829IsamGap (APIO16_gap)C++17
0 / 100
24 ms5656 KiB
#include "gap.h"
#include<bits/stdc++.h>
using namespace std;

long long findGap(int T, int N){
	
	assert(T==1||N<=10);
	
	vector<long long> a(N+1, 0ll);
	
	long long mn, mx;
	
	MinMax(0ll, (int)1E18, &mn, &mx);
	
	a[1] = mn, a[N] = mx;
	
	for(register int i = 2; i <= N/2 + (N & 1); ++i){
		
		long long l = a[i-1], r = a[N - (i-1) + 1];
		
		MinMax(l+1, r-1, &mn, &mx); // called by reference
	
		a[i] = mn, a[N - i + 1] = mx;
		
	}
	
	long long ans = -((long long)1E18 + 7);
	
	
	for(register int i = 2; i <= N; ++i){
		ans = max(ans, a[i] - a[i-1]);
	}
	
	
	return ans;
}

컴파일 시 표준 에러 (stderr) 메시지

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:17:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   17 |  for(register int i = 2; i <= N/2 + (N & 1); ++i){
      |                   ^
gap.cpp:30:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   30 |  for(register int i = 2; i <= N; ++i){
      |                   ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...