답안 #798103

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
798103 2023-07-30T11:15:10 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 / 2] << "\n";
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -