Submission #1005791

# Submission time Handle Problem Language Result Execution time Memory
1005791 2024-06-23T05:06:07 Z omsincoconut Gap (APIO16_gap) C++17
0 / 100
20 ms 3608 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]);
}

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:21:1: warning: no return statement in function returning non-void [-Wreturn-type]
   21 | }
      | ^
gap.cpp:13:9: warning: 'q1' is used uninitialized in this function [-Wuninitialized]
   13 |   MinMax(fl, fr, q1, q2);
      |   ~~~~~~^~~~~~~~~~~~~~~~
gap.cpp:13:9: warning: 'q2' is used uninitialized in this function [-Wuninitialized]
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 344 KB Execution failed because the return code was nonzero
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 0 ms 2392 KB Execution failed because the return code was nonzero
5 Runtime error 1 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 1 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 1 ms 2392 KB Execution failed because the return code was nonzero
12 Runtime error 0 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 3 ms 2532 KB Execution failed because the return code was nonzero
17 Runtime error 4 ms 2780 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 5 ms 2768 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 3568 KB Execution failed because the return code was nonzero
22 Runtime error 12 ms 3504 KB Execution failed because the return code was nonzero
23 Runtime error 12 ms 3568 KB Execution failed because the return code was nonzero
24 Runtime error 12 ms 3416 KB Execution failed because the return code was nonzero
25 Runtime error 17 ms 3608 KB Execution failed because the return code was nonzero
26 Runtime error 12 ms 3416 KB Execution failed because the return code was nonzero
27 Runtime error 12 ms 3508 KB Execution failed because the return code was nonzero
28 Runtime error 12 ms 3596 KB Execution failed because the return code was nonzero
29 Runtime error 12 ms 3560 KB Execution failed because the return code was nonzero
30 Runtime error 7 ms 3416 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
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2392 KB Output isn't correct
2 Incorrect 0 ms 2392 KB Output isn't correct
3 Incorrect 1 ms 2388 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 0 ms 2392 KB Output isn't correct
7 Incorrect 0 ms 2392 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 1 ms 2392 KB Output isn't correct
16 Incorrect 3 ms 2508 KB Output isn't correct
17 Incorrect 3 ms 2392 KB Output isn't correct
18 Incorrect 3 ms 2480 KB Output isn't correct
19 Incorrect 3 ms 2564 KB Output isn't correct
20 Incorrect 2 ms 2392 KB Output isn't correct
21 Incorrect 12 ms 2824 KB Output isn't correct
22 Incorrect 12 ms 2648 KB Output isn't correct
23 Incorrect 12 ms 2648 KB Output isn't correct
24 Incorrect 12 ms 2648 KB Output isn't correct
25 Incorrect 16 ms 2648 KB Output isn't correct
26 Incorrect 13 ms 2648 KB Output isn't correct
27 Incorrect 12 ms 2780 KB Output isn't correct
28 Incorrect 20 ms 2648 KB Output isn't correct
29 Incorrect 20 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