Submission #798107

# Submission time Handle Problem Language Result Execution time Memory
798107 2023-07-30T11:16:09 Z tch1cherin Hacker (BOI15_hac) C++17
0 / 100
0 ms 212 KB
// Proof by AC
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int &v : A) {
    cin >> v;
  }
  for (int i = 0; i < N; i++) {
    A.push_back(A[i]);
  }
  vector<int> pref(2 * N);
  for (int i = 0; i < 2 * N - 1; i++) {
    pref[i + 1] = pref[i] + A[i];
  }
  vector<int> S;  
  for (int i = (N + 1) / 2; i < N + (N + 1) / 2; i++) {
    S.push_back(pref[i] - pref[i - (N + 1) / 2]);
  }
  sort(S.rbegin(), S.rend());
  cout << S[(N - 1) / 2] << "\n";
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -