# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
909387 | 2024-01-17T07:43:24 Z | shoryu386 | Hacker (BOI15_hac) | C++17 | 1 ms | 348 KB |
#include <bits/stdc++.h> using namespace std; #define MAX 200007 #define int long long main(){ int n; cin >> n; int count = (n+1)/2; int arr[2*n]; for (int x = 0; x < n; x++) cin >> arr[x]; for (int x = 0; x < n; x++) arr[n + x] = arr[x]; int hmm[n]; memset(hmm, 63, sizeof(hmm)); int sums[n]; for (int x = 0; x < n; x++){ int sum = 0; for (int y = x; y < x+count; y++){ sum += arr[y]; } sums[x] = sum; //hmm is min of all values from x-count+1 to x for (int y = x; y < x+count; y++){ hmm[y % n] = min(hmm[y % n], sum); } } multiset<int> ms; for (int x = 0; x < count; x++){ ms.insert(sums[x]); } hmm[0] = *ms.begin(); for (int x = 1; x < n; x++){ ms.insert(sums[count+1-x]); ms.erase(ms.find(sums[x-1])); hmm[x] = *ms.begin(); } int ans = INT_MIN; for (int x = 0; x < n; x++){ ans = max(ans, hmm[x]); } cout << ans; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Runtime error | 1 ms | 348 KB | Execution killed with signal 6 |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Runtime error | 1 ms | 348 KB | Execution killed with signal 6 |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Runtime error | 1 ms | 348 KB | Execution killed with signal 6 |
3 | Halted | 0 ms | 0 KB | - |