답안 #975829

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
975829 2024-05-06T00:06:01 Z Isam Gap (APIO16_gap) C++17
0 / 100
24 ms 5656 KB
#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;
}

Compilation message

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){
      |                   ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
3 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
4 Runtime error 2 ms 2392 KB Execution failed because the return code was nonzero
5 Correct 0 ms 2392 KB Output is correct
6 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
7 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
8 Runtime error 2 ms 2392 KB Execution failed because the return code was nonzero
9 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
10 Correct 1 ms 2392 KB Output is correct
11 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
12 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
13 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
14 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
15 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
16 Runtime error 4 ms 2836 KB Execution failed because the return code was nonzero
17 Runtime error 4 ms 2584 KB Execution failed because the return code was nonzero
18 Runtime error 4 ms 2584 KB Execution failed because the return code was nonzero
19 Runtime error 4 ms 2580 KB Execution failed because the return code was nonzero
20 Correct 7 ms 2564 KB Output is correct
21 Runtime error 14 ms 3624 KB Execution failed because the return code was nonzero
22 Runtime error 14 ms 3624 KB Execution failed because the return code was nonzero
23 Runtime error 14 ms 3624 KB Execution failed because the return code was nonzero
24 Runtime error 17 ms 3580 KB Execution failed because the return code was nonzero
25 Runtime error 12 ms 3632 KB Execution failed because the return code was nonzero
26 Runtime error 18 ms 3564 KB Execution failed because the return code was nonzero
27 Runtime error 14 ms 3620 KB Execution failed because the return code was nonzero
28 Runtime error 14 ms 3628 KB Execution failed because the return code was nonzero
29 Runtime error 19 ms 3620 KB Execution failed because the return code was nonzero
30 Correct 24 ms 3612 KB Output is correct
31 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
32 Runtime error 1 ms 2484 KB Execution failed because the return code was nonzero
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 2392 KB Output isn't correct
2 Runtime error 2 ms 4648 KB Execution killed with signal 6
3 Runtime error 3 ms 4696 KB Execution killed with signal 6
4 Runtime error 2 ms 4696 KB Execution killed with signal 6
5 Runtime error 3 ms 4696 KB Execution killed with signal 6
6 Runtime error 2 ms 4696 KB Execution killed with signal 6
7 Runtime error 2 ms 4696 KB Execution killed with signal 6
8 Runtime error 2 ms 4696 KB Execution killed with signal 6
9 Runtime error 2 ms 4696 KB Execution killed with signal 6
10 Runtime error 2 ms 4696 KB Execution killed with signal 6
11 Runtime error 3 ms 4696 KB Execution killed with signal 6
12 Runtime error 3 ms 4696 KB Execution killed with signal 6
13 Runtime error 2 ms 4696 KB Execution killed with signal 6
14 Runtime error 3 ms 4696 KB Execution killed with signal 6
15 Runtime error 2 ms 4696 KB Execution killed with signal 6
16 Runtime error 7 ms 4888 KB Execution killed with signal 6
17 Runtime error 6 ms 4888 KB Execution killed with signal 6
18 Runtime error 6 ms 4892 KB Execution killed with signal 6
19 Runtime error 6 ms 4888 KB Execution killed with signal 6
20 Runtime error 4 ms 4944 KB Execution killed with signal 6
21 Runtime error 16 ms 5296 KB Execution killed with signal 6
22 Runtime error 19 ms 5412 KB Execution killed with signal 6
23 Runtime error 16 ms 5424 KB Execution killed with signal 6
24 Runtime error 16 ms 5656 KB Execution killed with signal 6
25 Runtime error 13 ms 5408 KB Execution killed with signal 6
26 Runtime error 16 ms 5424 KB Execution killed with signal 6
27 Runtime error 16 ms 5420 KB Execution killed with signal 6
28 Runtime error 16 ms 5420 KB Execution killed with signal 6
29 Runtime error 15 ms 5408 KB Execution killed with signal 6
30 Runtime error 11 ms 5416 KB Execution killed with signal 6
31 Runtime error 3 ms 4696 KB Execution killed with signal 6
32 Runtime error 2 ms 4696 KB Execution killed with signal 6