답안 #906007

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
906007 2024-01-13T09:11:13 Z starchan Gap (APIO16_gap) C++17
30 / 100
36 ms 3640 KB
#include<bits/stdc++.h>
#include "gap.h"
using namespace std;
#define in pair<int, int>
#define int long long
#define f first
#define s second
#define pb push_back
#define pob pop_back
#define INF (int)2e18
#define MX (int)3e5+5
#define fast() ios_base::sync_with_stdio(false); cin.tie(NULL)


int findgap1(int n)
{
	vector<int> a(n);
	int l = 0;
	int r = n-1;
	int cl = 0;
	int cr = 1e18;
	while(l <= r)
	{
		int x, y;
		MinMax(cl, cr, &x, &y);
		cl = x+1;
		cr = y-1;
		a[l++] = x;
		a[r--] = y;
	}
	int ok = 0;
	for(int i = 0; i < n-1; i++)
		ok = max(ok, a[i+1]-a[i]);
	return ok;
}

int findgap2(int n)
{
	return 0;
}

//dummy real function
int findGap(signed T, signed n)
{
	int t = T;
	int N = n;
	if(t == 1)
		return findgap1(n);
	else
		return findgap2(n); 	 
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:46:6: warning: unused variable 'N' [-Wunused-variable]
   46 |  int N = n;
      |      ^
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 2392 KB Output is correct
3 Correct 1 ms 2392 KB Output is correct
4 Correct 1 ms 2392 KB Output is correct
5 Correct 1 ms 2392 KB Output is correct
6 Correct 1 ms 2392 KB Output is correct
7 Correct 1 ms 2392 KB Output is correct
8 Correct 1 ms 2392 KB Output is correct
9 Correct 1 ms 2392 KB Output is correct
10 Correct 1 ms 2392 KB Output is correct
11 Correct 1 ms 2392 KB Output is correct
12 Correct 1 ms 2392 KB Output is correct
13 Correct 2 ms 2392 KB Output is correct
14 Correct 1 ms 2392 KB Output is correct
15 Correct 1 ms 2392 KB Output is correct
16 Correct 7 ms 2836 KB Output is correct
17 Correct 7 ms 2752 KB Output is correct
18 Correct 9 ms 2572 KB Output is correct
19 Correct 8 ms 2584 KB Output is correct
20 Correct 7 ms 2576 KB Output is correct
21 Correct 29 ms 3624 KB Output is correct
22 Correct 28 ms 3620 KB Output is correct
23 Correct 32 ms 3640 KB Output is correct
24 Correct 30 ms 3624 KB Output is correct
25 Correct 26 ms 3624 KB Output is correct
26 Correct 29 ms 3624 KB Output is correct
27 Correct 29 ms 3628 KB Output is correct
28 Correct 36 ms 3616 KB Output is correct
29 Correct 30 ms 3624 KB Output is correct
30 Correct 23 ms 3612 KB Output is correct
31 Correct 1 ms 2388 KB Output is correct
32 Correct 1 ms 2392 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 2392 KB Output isn't correct
2 Incorrect 1 ms 2392 KB Output isn't correct
3 Incorrect 1 ms 2392 KB Output isn't correct
4 Incorrect 1 ms 2392 KB Output isn't correct
5 Incorrect 1 ms 2392 KB Output isn't correct
6 Incorrect 1 ms 2392 KB Output isn't correct
7 Incorrect 1 ms 2392 KB Output isn't correct
8 Incorrect 1 ms 2392 KB Output isn't correct
9 Incorrect 1 ms 2392 KB Output isn't correct
10 Incorrect 1 ms 2392 KB Output isn't correct
11 Incorrect 1 ms 2392 KB Output isn't correct
12 Incorrect 1 ms 2392 KB Output isn't correct
13 Incorrect 2 ms 2392 KB Output isn't correct
14 Incorrect 1 ms 2392 KB Output isn't correct
15 Incorrect 2 ms 2392 KB Output isn't correct
16 Incorrect 6 ms 2592 KB Output isn't correct
17 Incorrect 6 ms 2580 KB Output isn't correct
18 Incorrect 4 ms 2844 KB Output isn't correct
19 Incorrect 4 ms 2580 KB Output isn't correct
20 Incorrect 2 ms 2576 KB Output isn't correct
21 Incorrect 13 ms 2948 KB Output isn't correct
22 Incorrect 12 ms 2864 KB Output isn't correct
23 Incorrect 18 ms 2848 KB Output isn't correct
24 Incorrect 19 ms 2848 KB Output isn't correct
25 Incorrect 11 ms 2856 KB Output isn't correct
26 Incorrect 13 ms 2848 KB Output isn't correct
27 Incorrect 12 ms 2872 KB Output isn't correct
28 Incorrect 14 ms 2856 KB Output isn't correct
29 Incorrect 12 ms 2868 KB Output isn't correct
30 Incorrect 7 ms 2860 KB Output isn't correct
31 Incorrect 1 ms 2392 KB Output isn't correct
32 Incorrect 1 ms 2392 KB Output isn't correct