# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
532285 |
2022-03-02T16:46:05 Z |
rainboy |
None (JOI14_ho_t3) |
C |
|
20 ms |
336 KB |
#include <stdio.h>
#define N 400
long long min(long long a, long long b) { return a < b ? a : b; }
long long max(long long a, long long b) { return a > b ? a : b; }
int main() {
static long long aa[N + 1];
int n, i, j, k;
long long ans;
scanf("%d", &n);
for (i = 1; i <= n; i++) {
scanf("%lld", &aa[i]);
aa[i] += aa[i - 1];
}
ans = 0;
for (i = 0; i < n; i++)
for (j = i + 1; j < n; j++)
for (k = j + 1; k < n; k++)
ans = max(ans, min(min(aa[j] - aa[i], aa[k] - aa[j]), aa[n] + aa[i] - aa[k]));
printf("%lld\n", ans);
return 0;
}
Compilation message
2014_ho_t3.c: In function 'main':
2014_ho_t3.c:13:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
13 | scanf("%d", &n);
| ^~~~~~~~~~~~~~~
2014_ho_t3.c:15:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
15 | scanf("%lld", &aa[i]);
| ^~~~~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Output is correct |
2 |
Correct |
1 ms |
208 KB |
Output is correct |
3 |
Correct |
1 ms |
208 KB |
Output is correct |
4 |
Correct |
1 ms |
284 KB |
Output is correct |
5 |
Correct |
1 ms |
208 KB |
Output is correct |
6 |
Correct |
1 ms |
208 KB |
Output is correct |
7 |
Correct |
1 ms |
208 KB |
Output is correct |
8 |
Correct |
1 ms |
208 KB |
Output is correct |
9 |
Correct |
1 ms |
208 KB |
Output is correct |
10 |
Correct |
1 ms |
208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Output is correct |
2 |
Correct |
1 ms |
208 KB |
Output is correct |
3 |
Correct |
1 ms |
208 KB |
Output is correct |
4 |
Correct |
1 ms |
284 KB |
Output is correct |
5 |
Correct |
1 ms |
208 KB |
Output is correct |
6 |
Correct |
1 ms |
208 KB |
Output is correct |
7 |
Correct |
1 ms |
208 KB |
Output is correct |
8 |
Correct |
1 ms |
208 KB |
Output is correct |
9 |
Correct |
1 ms |
208 KB |
Output is correct |
10 |
Correct |
1 ms |
208 KB |
Output is correct |
11 |
Correct |
16 ms |
284 KB |
Output is correct |
12 |
Correct |
17 ms |
280 KB |
Output is correct |
13 |
Correct |
17 ms |
284 KB |
Output is correct |
14 |
Correct |
18 ms |
284 KB |
Output is correct |
15 |
Correct |
18 ms |
284 KB |
Output is correct |
16 |
Correct |
17 ms |
288 KB |
Output is correct |
17 |
Correct |
17 ms |
336 KB |
Output is correct |
18 |
Correct |
17 ms |
284 KB |
Output is correct |
19 |
Correct |
20 ms |
288 KB |
Output is correct |
20 |
Correct |
17 ms |
280 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Output is correct |
2 |
Correct |
1 ms |
208 KB |
Output is correct |
3 |
Correct |
1 ms |
208 KB |
Output is correct |
4 |
Correct |
1 ms |
284 KB |
Output is correct |
5 |
Correct |
1 ms |
208 KB |
Output is correct |
6 |
Correct |
1 ms |
208 KB |
Output is correct |
7 |
Correct |
1 ms |
208 KB |
Output is correct |
8 |
Correct |
1 ms |
208 KB |
Output is correct |
9 |
Correct |
1 ms |
208 KB |
Output is correct |
10 |
Correct |
1 ms |
208 KB |
Output is correct |
11 |
Correct |
16 ms |
284 KB |
Output is correct |
12 |
Correct |
17 ms |
280 KB |
Output is correct |
13 |
Correct |
17 ms |
284 KB |
Output is correct |
14 |
Correct |
18 ms |
284 KB |
Output is correct |
15 |
Correct |
18 ms |
284 KB |
Output is correct |
16 |
Correct |
17 ms |
288 KB |
Output is correct |
17 |
Correct |
17 ms |
336 KB |
Output is correct |
18 |
Correct |
17 ms |
284 KB |
Output is correct |
19 |
Correct |
20 ms |
288 KB |
Output is correct |
20 |
Correct |
17 ms |
280 KB |
Output is correct |
21 |
Runtime error |
1 ms |
336 KB |
Execution killed with signal 11 |
22 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Output is correct |
2 |
Correct |
1 ms |
208 KB |
Output is correct |
3 |
Correct |
1 ms |
208 KB |
Output is correct |
4 |
Correct |
1 ms |
284 KB |
Output is correct |
5 |
Correct |
1 ms |
208 KB |
Output is correct |
6 |
Correct |
1 ms |
208 KB |
Output is correct |
7 |
Correct |
1 ms |
208 KB |
Output is correct |
8 |
Correct |
1 ms |
208 KB |
Output is correct |
9 |
Correct |
1 ms |
208 KB |
Output is correct |
10 |
Correct |
1 ms |
208 KB |
Output is correct |
11 |
Correct |
16 ms |
284 KB |
Output is correct |
12 |
Correct |
17 ms |
280 KB |
Output is correct |
13 |
Correct |
17 ms |
284 KB |
Output is correct |
14 |
Correct |
18 ms |
284 KB |
Output is correct |
15 |
Correct |
18 ms |
284 KB |
Output is correct |
16 |
Correct |
17 ms |
288 KB |
Output is correct |
17 |
Correct |
17 ms |
336 KB |
Output is correct |
18 |
Correct |
17 ms |
284 KB |
Output is correct |
19 |
Correct |
20 ms |
288 KB |
Output is correct |
20 |
Correct |
17 ms |
280 KB |
Output is correct |
21 |
Runtime error |
1 ms |
336 KB |
Execution killed with signal 11 |
22 |
Halted |
0 ms |
0 KB |
- |