Submission #723753

# Submission time Handle Problem Language Result Execution time Memory
723753 2023-04-14T09:15:15 Z rshohruh Hacker (BOI15_hac) C++14
40 / 100
667 ms 262144 KB
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

bool cmp(const vector<int>& a, const vector<int>& b) {
    return *min_element(a.begin(), a.end()) < *min_element(b.begin(), b.end());
}

int main() {
    #ifdef __local__
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    int n;
    cin >> n;
    vector<int> lis(n);
    for (int i = 0; i < n; i++) {
        cin >> lis[i];
    }
    vector<vector<int>> sussies(n);
    int k = (n + 1) / 2;
    lis.insert(lis.end(), lis.begin(), lis.end());
    for (int i = 0; i < n; i++) {
        int cur = 0;
        for (int j = 0; j < k; j++) {
            cur += lis[i+j];
        }
        for (int j = 0; j < k; j++) {
            sussies[(i+j)%n].push_back(cur);
        }
    }
    vector<int> mins;
    for (int i = 0; i < n; i++) {
        mins.push_back(*min_element(sussies[i].begin(), sussies[i].end()));
    }
    int ans = *max_element(mins.begin(), mins.end());
    cout << ans << endl;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 596 KB Output is correct
8 Correct 1 ms 596 KB Output is correct
9 Correct 2 ms 596 KB Output is correct
10 Correct 1 ms 596 KB Output is correct
11 Correct 2 ms 596 KB Output is correct
12 Correct 1 ms 596 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 1 ms 596 KB Output is correct
17 Correct 1 ms 596 KB Output is correct
18 Correct 1 ms 596 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 596 KB Output is correct
8 Correct 1 ms 596 KB Output is correct
9 Correct 2 ms 596 KB Output is correct
10 Correct 1 ms 596 KB Output is correct
11 Correct 2 ms 596 KB Output is correct
12 Correct 1 ms 596 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 1 ms 596 KB Output is correct
17 Correct 1 ms 596 KB Output is correct
18 Correct 1 ms 596 KB Output is correct
19 Correct 3 ms 852 KB Output is correct
20 Correct 9 ms 2388 KB Output is correct
21 Correct 5 ms 1876 KB Output is correct
22 Correct 79 ms 24572 KB Output is correct
23 Correct 210 ms 73880 KB Output is correct
24 Correct 76 ms 24536 KB Output is correct
25 Correct 222 ms 73884 KB Output is correct
26 Correct 221 ms 73904 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 0 ms 212 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 212 ms 73956 KB Output is correct
31 Correct 211 ms 74088 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 2 ms 724 KB Output is correct
3 Correct 219 ms 74096 KB Output is correct
4 Runtime error 667 ms 262144 KB Execution killed with signal 9
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 596 KB Output is correct
8 Correct 1 ms 596 KB Output is correct
9 Correct 2 ms 596 KB Output is correct
10 Correct 1 ms 596 KB Output is correct
11 Correct 2 ms 596 KB Output is correct
12 Correct 1 ms 596 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 1 ms 596 KB Output is correct
17 Correct 1 ms 596 KB Output is correct
18 Correct 1 ms 596 KB Output is correct
19 Correct 3 ms 852 KB Output is correct
20 Correct 9 ms 2388 KB Output is correct
21 Correct 5 ms 1876 KB Output is correct
22 Correct 79 ms 24572 KB Output is correct
23 Correct 210 ms 73880 KB Output is correct
24 Correct 76 ms 24536 KB Output is correct
25 Correct 222 ms 73884 KB Output is correct
26 Correct 221 ms 73904 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 0 ms 212 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 212 ms 73956 KB Output is correct
31 Correct 211 ms 74088 KB Output is correct
32 Correct 0 ms 212 KB Output is correct
33 Correct 2 ms 724 KB Output is correct
34 Correct 219 ms 74096 KB Output is correct
35 Runtime error 667 ms 262144 KB Execution killed with signal 9
36 Halted 0 ms 0 KB -