답안 #1005793

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1005793 2024-06-23T05:06:59 Z omsincoconut Gap (APIO16_gap) C++17
0 / 100
21 ms 3680 KB
#include <bits/stdc++.h>
#include "gap.h"

using namespace std;
typedef long long ll;

ll findGap1(int N) {
	ll l = 1, r = N;
	ll fl = LLONG_MIN, fr = LLONG_MAX;
	ll arr[N+1];
	while (l <= r) {
		ll *q1, *q2;
		MinMax(fl, fr, q1, q2);
		arr[l++] = *q1;
		arr[r--] = *q2;
		fl = *q1+1;
		fr = *q2-1;
	}
	ll ans = 0;
	for (ll i = 1; i < N; i++) ans = max(ans, arr[i+1] - arr[i]);
  return ans;
}

ll findGap2(int N) {
	return 0;
}

ll findGap(int T, int N) {
	return T == 1 ? findGap1(N) : findGap2(N);
}

Compilation message

gap.cpp: In function 'll findGap1(int)':
gap.cpp:13:9: warning: 'q1' may be used uninitialized in this function [-Wmaybe-uninitialized]
   13 |   MinMax(fl, fr, q1, q2);
      |   ~~~~~~^~~~~~~~~~~~~~~~
gap.cpp:13:9: warning: 'q2' may be used uninitialized in this function [-Wmaybe-uninitialized]
# 결과 실행 시간 메모리 Grader output
1 Runtime error 0 ms 344 KB Execution failed because the return code was nonzero
2 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
3 Runtime error 0 ms 2492 KB Execution failed because the return code was nonzero
4 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
5 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
6 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
7 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
8 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
9 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
10 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
11 Runtime error 0 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 2644 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 2648 KB Execution failed because the return code was nonzero
17 Runtime error 5 ms 2648 KB Execution failed because the return code was nonzero
18 Runtime error 4 ms 2648 KB Execution failed because the return code was nonzero
19 Runtime error 3 ms 2648 KB Execution failed because the return code was nonzero
20 Runtime error 2 ms 2648 KB Execution failed because the return code was nonzero
21 Runtime error 12 ms 3416 KB Execution failed because the return code was nonzero
22 Runtime error 15 ms 3416 KB Execution failed because the return code was nonzero
23 Runtime error 12 ms 3416 KB Execution failed because the return code was nonzero
24 Runtime error 13 ms 3616 KB Execution failed because the return code was nonzero
25 Runtime error 17 ms 3576 KB Execution failed because the return code was nonzero
26 Runtime error 12 ms 3680 KB Execution failed because the return code was nonzero
27 Runtime error 21 ms 3408 KB Execution failed because the return code was nonzero
28 Runtime error 12 ms 3416 KB Execution failed because the return code was nonzero
29 Runtime error 11 ms 3416 KB Execution failed because the return code was nonzero
30 Runtime error 7 ms 3644 KB Execution failed because the return code was nonzero
31 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
32 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 2392 KB Output isn't correct
2 Incorrect 0 ms 2392 KB Output isn't correct
3 Incorrect 0 ms 2392 KB Output isn't correct
4 Incorrect 0 ms 2392 KB Output isn't correct
5 Incorrect 0 ms 2392 KB Output isn't correct
6 Incorrect 1 ms 2388 KB Output isn't correct
7 Incorrect 0 ms 2644 KB Output isn't correct
8 Incorrect 0 ms 2392 KB Output isn't correct
9 Incorrect 0 ms 2392 KB Output isn't correct
10 Incorrect 0 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 1 ms 2392 KB Output isn't correct
14 Incorrect 1 ms 2392 KB Output isn't correct
15 Incorrect 0 ms 2392 KB Output isn't correct
16 Incorrect 3 ms 2392 KB Output isn't correct
17 Incorrect 4 ms 2544 KB Output isn't correct
18 Incorrect 3 ms 2392 KB Output isn't correct
19 Incorrect 5 ms 2536 KB Output isn't correct
20 Incorrect 2 ms 2392 KB Output isn't correct
21 Incorrect 11 ms 2780 KB Output isn't correct
22 Incorrect 12 ms 2648 KB Output isn't correct
23 Incorrect 13 ms 2648 KB Output isn't correct
24 Incorrect 12 ms 2648 KB Output isn't correct
25 Incorrect 13 ms 2648 KB Output isn't correct
26 Incorrect 12 ms 2844 KB Output isn't correct
27 Incorrect 12 ms 2648 KB Output isn't correct
28 Incorrect 13 ms 2648 KB Output isn't correct
29 Incorrect 12 ms 2648 KB Output isn't correct
30 Incorrect 7 ms 2648 KB Output isn't correct
31 Incorrect 0 ms 2392 KB Output isn't correct
32 Incorrect 0 ms 2392 KB Output isn't correct