답안 #1027597

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1027597 2024-07-19T07:53:48 Z Gangsta Gap (APIO16_gap) C++14
0 / 100
2000 ms 2820 KB
#include "bits/stdc++.h"
#include "gap.h"
#define ll long long
#define pb push_back
#define pii pair<ll,ll>
#define ff first
#define ss second
#define sz size()

const int N = 2e5 + 1;

using namespace std;

ll ans;

// void MinMax(ll s, ll t, ll &mn, ll &mx){
// 	int a, b;
// 	cin >> a >> b;
// 	mn = a;
// 	mx = b;
// }

ll findGap(int t, int n){
	ll mn = -1, mx = 1e18+1, tmp = 0, tmp1 = 1e18;
	if(t == 1){
		while(1){
			tmp = max(mn,(ll)0), tmp1 = min(mx,(ll)1e18);
			mn++;
			mx--;
			if(mn > mx) return ans;
			MinMax(tmp, tmp1, &mn, &mx);
			if(mn == -1) return ans;
			ans = max({ans,mn-tmp, tmp1-mx});
		}
	}
}

// int main(){
//     int n, t;
//     cin >> t >> n;
//     cout << findGap(t, n);
// }

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:36:1: warning: control reaches end of non-void function [-Wreturn-type]
   36 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3084 ms 340 KB Time limit exceeded
2 Execution timed out 3046 ms 2392 KB Time limit exceeded
3 Execution timed out 3079 ms 2392 KB Time limit exceeded
4 Execution timed out 3020 ms 2392 KB Time limit exceeded
5 Execution timed out 3021 ms 2392 KB Time limit exceeded
6 Execution timed out 3059 ms 2392 KB Time limit exceeded
7 Execution timed out 3045 ms 2392 KB Time limit exceeded
8 Execution timed out 3030 ms 2392 KB Time limit exceeded
9 Execution timed out 3065 ms 2392 KB Time limit exceeded
10 Execution timed out 3041 ms 2388 KB Time limit exceeded
11 Execution timed out 3061 ms 2392 KB Time limit exceeded
12 Execution timed out 3059 ms 2392 KB Time limit exceeded
13 Execution timed out 3063 ms 2392 KB Time limit exceeded
14 Execution timed out 3027 ms 2392 KB Time limit exceeded
15 Execution timed out 3066 ms 2388 KB Time limit exceeded
16 Execution timed out 3029 ms 2644 KB Time limit exceeded
17 Execution timed out 3037 ms 2392 KB Time limit exceeded
18 Execution timed out 3056 ms 2392 KB Time limit exceeded
19 Execution timed out 3064 ms 2392 KB Time limit exceeded
20 Execution timed out 3062 ms 2392 KB Time limit exceeded
21 Execution timed out 3053 ms 2648 KB Time limit exceeded
22 Execution timed out 3063 ms 2744 KB Time limit exceeded
23 Execution timed out 3071 ms 2736 KB Time limit exceeded
24 Execution timed out 3018 ms 2648 KB Time limit exceeded
25 Execution timed out 3037 ms 2648 KB Time limit exceeded
26 Execution timed out 3090 ms 2648 KB Time limit exceeded
27 Execution timed out 3041 ms 2648 KB Time limit exceeded
28 Execution timed out 3047 ms 2684 KB Time limit exceeded
29 Execution timed out 3042 ms 2648 KB Time limit exceeded
30 Execution timed out 3062 ms 2648 KB Time limit exceeded
31 Execution timed out 3040 ms 2392 KB Time limit exceeded
32 Execution timed out 3085 ms 2392 KB Time limit exceeded
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3029 ms 2392 KB Time limit exceeded
2 Execution timed out 3049 ms 2392 KB Time limit exceeded
3 Execution timed out 3024 ms 2392 KB Time limit exceeded
4 Execution timed out 3084 ms 2388 KB Time limit exceeded
5 Execution timed out 3029 ms 2392 KB Time limit exceeded
6 Execution timed out 3079 ms 2392 KB Time limit exceeded
7 Execution timed out 3014 ms 2392 KB Time limit exceeded
8 Execution timed out 3070 ms 2392 KB Time limit exceeded
9 Execution timed out 3060 ms 2392 KB Time limit exceeded
10 Execution timed out 3042 ms 2392 KB Time limit exceeded
11 Execution timed out 3096 ms 2644 KB Time limit exceeded
12 Execution timed out 3053 ms 2392 KB Time limit exceeded
13 Execution timed out 3062 ms 2392 KB Time limit exceeded
14 Execution timed out 3040 ms 2392 KB Time limit exceeded
15 Execution timed out 3076 ms 2392 KB Time limit exceeded
16 Execution timed out 3064 ms 2392 KB Time limit exceeded
17 Execution timed out 3066 ms 2392 KB Time limit exceeded
18 Execution timed out 3042 ms 2392 KB Time limit exceeded
19 Execution timed out 3039 ms 2392 KB Time limit exceeded
20 Execution timed out 3019 ms 2392 KB Time limit exceeded
21 Execution timed out 3062 ms 2648 KB Time limit exceeded
22 Execution timed out 3044 ms 2648 KB Time limit exceeded
23 Execution timed out 3032 ms 2820 KB Time limit exceeded
24 Execution timed out 3039 ms 2648 KB Time limit exceeded
25 Execution timed out 3054 ms 2648 KB Time limit exceeded
26 Execution timed out 3050 ms 2648 KB Time limit exceeded
27 Execution timed out 3038 ms 2756 KB Time limit exceeded
28 Execution timed out 3032 ms 2648 KB Time limit exceeded
29 Execution timed out 3038 ms 2648 KB Time limit exceeded
30 Execution timed out 3041 ms 2648 KB Time limit exceeded
31 Execution timed out 3071 ms 2392 KB Time limit exceeded
32 Execution timed out 3040 ms 2392 KB Time limit exceeded