답안 #1110497

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1110497 2024-11-09T15:06:38 Z Newtonabc Gap (APIO16_gap) C++14
0 / 100
28 ms 1276 KB
#include "gap.h"
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
long long arr[N];
long long findGap(int T, int N)
{
    long long aa,bb;
  MinMax(1000,0,&aa,&bb);
	if(T==1){
		long long ans=LLONG_MIN;
		int lind=1,rind=N;
		long long l=0,r=1e18,mn,mx;
		while(lind<=rind){
			MinMax(l,r,&mn,&mx);
			if(mn==-1) break;
			arr[lind]=mn,arr[rind]=mx;
			lind++,rind--;
			l=mn+1,r=mx-1;
		}
		for(int i=1;i<N;i++){
			ans=max(ans,arr[i+1]-arr[i]);
		}
		/*for(int i=0;i<N;i++) cout<<arr[i] <<" ";
		cout<<"\n\n";*/
		return ans;
	}
	
		
	
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:31:1: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
2 Runtime error 1 ms 420 KB Execution failed because the return code was nonzero
3 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
4 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
5 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
6 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
7 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
8 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
9 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
10 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
11 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
12 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
13 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
14 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
15 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
16 Runtime error 4 ms 592 KB Execution failed because the return code was nonzero
17 Runtime error 6 ms 764 KB Execution failed because the return code was nonzero
18 Runtime error 5 ms 592 KB Execution failed because the return code was nonzero
19 Runtime error 4 ms 592 KB Execution failed because the return code was nonzero
20 Runtime error 2 ms 436 KB Execution failed because the return code was nonzero
21 Runtime error 27 ms 1148 KB Execution failed because the return code was nonzero
22 Runtime error 15 ms 1104 KB Execution failed because the return code was nonzero
23 Runtime error 26 ms 1104 KB Execution failed because the return code was nonzero
24 Runtime error 15 ms 1276 KB Execution failed because the return code was nonzero
25 Runtime error 12 ms 1104 KB Execution failed because the return code was nonzero
26 Runtime error 15 ms 1028 KB Execution failed because the return code was nonzero
27 Runtime error 15 ms 1104 KB Execution failed because the return code was nonzero
28 Runtime error 15 ms 1104 KB Execution failed because the return code was nonzero
29 Runtime error 15 ms 1104 KB Execution failed because the return code was nonzero
30 Runtime error 9 ms 1104 KB Execution failed because the return code was nonzero
31 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
32 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
2 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
3 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
4 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
5 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
6 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
7 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
8 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
9 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
10 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
11 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
12 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
13 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
14 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
15 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
16 Runtime error 4 ms 628 KB Execution failed because the return code was nonzero
17 Runtime error 7 ms 592 KB Execution failed because the return code was nonzero
18 Runtime error 4 ms 592 KB Execution failed because the return code was nonzero
19 Runtime error 5 ms 592 KB Execution failed because the return code was nonzero
20 Runtime error 3 ms 592 KB Execution failed because the return code was nonzero
21 Runtime error 16 ms 1200 KB Execution failed because the return code was nonzero
22 Runtime error 28 ms 1012 KB Execution failed because the return code was nonzero
23 Runtime error 25 ms 1104 KB Execution failed because the return code was nonzero
24 Runtime error 22 ms 1220 KB Execution failed because the return code was nonzero
25 Runtime error 13 ms 1104 KB Execution failed because the return code was nonzero
26 Runtime error 16 ms 1104 KB Execution failed because the return code was nonzero
27 Runtime error 16 ms 1104 KB Execution failed because the return code was nonzero
28 Runtime error 15 ms 1104 KB Execution failed because the return code was nonzero
29 Runtime error 16 ms 1072 KB Execution failed because the return code was nonzero
30 Runtime error 10 ms 1104 KB Execution failed because the return code was nonzero
31 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero
32 Runtime error 1 ms 336 KB Execution failed because the return code was nonzero