結果

問題 No.1925 悪鬼三七次元
ユーザー KudeKude
提出日時 2022-05-02 23:04:05
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,158 bytes
コンパイル時間 2,510 ms
コンパイル使用メモリ 223,096 KB
実行使用メモリ 4,568 KB
最終ジャッジ日時 2023-09-14 20:18:54
合計ジャッジ時間 4,882 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 12 ms
4,380 KB
testcase_04 AC 12 ms
4,376 KB
testcase_05 AC 12 ms
4,376 KB
testcase_06 AC 12 ms
4,376 KB
testcase_07 AC 13 ms
4,376 KB
testcase_08 AC 13 ms
4,376 KB
testcase_09 AC 13 ms
4,380 KB
testcase_10 AC 13 ms
4,376 KB
testcase_11 AC 12 ms
4,376 KB
testcase_12 AC 13 ms
4,380 KB
testcase_13 AC 11 ms
4,376 KB
testcase_14 AC 13 ms
4,376 KB
testcase_15 AC 12 ms
4,376 KB
testcase_16 AC 13 ms
4,376 KB
testcase_17 AC 12 ms
4,376 KB
testcase_18 AC 13 ms
4,376 KB
testcase_19 AC 12 ms
4,380 KB
testcase_20 AC 12 ms
4,376 KB
testcase_21 AC 13 ms
4,380 KB
testcase_22 AC 12 ms
4,376 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 4 ms
4,376 KB
testcase_26 AC 3 ms
4,376 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 5 ms
4,380 KB
testcase_30 WA -
testcase_31 AC 8 ms
4,380 KB
testcase_32 AC 4 ms
4,376 KB
testcase_33 AC 4 ms
4,376 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 5 ms
4,380 KB
testcase_37 AC 7 ms
4,376 KB
testcase_38 AC 7 ms
4,376 KB
testcase_39 WA -
testcase_40 AC 10 ms
4,376 KB
testcase_41 AC 7 ms
4,376 KB
testcase_42 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
namespace {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#include<atcoder/all>
#pragma GCC diagnostic pop
using namespace std;
using namespace atcoder;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(i,n) for(int i = (int)(n) - 1; i >= 0; i--)
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
template<class T> bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; }
template<class T> bool chmin(T& a, const T& b) { if (b < a) { a = b; return true; } else return false; }
using ll = long long;
using P = pair<int,int>;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<ll>;
using VVL = vector<VL>;

} int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  VI a(n);
  rep(i, n) cin >> a[i];
  if (n % 2 == 0) {
    a[n / 2 - 1] += a[n / 2];
    a.erase(a.begin() + n / 2);
    n--;
  }
  int m = n / 2;
  ll ans = 1002003004005006007;
  ll now = accumulate(a.begin(), a.begin() + m, 0LL);
  rep(i, m + 1) {
    now += a[i + m];
    chmin(ans, now);
    now -= a[i];
  }
  cout << ans << '\n';
}
0