結果

問題 No.909 たぴの配置
コンテスト
ユーザー cotton_fn_
提出日時 2019-12-12 15:09:31
言語 C++17
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 87 ms / 3,000 ms
+ 216µs
コード長 769 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 628 ms
コンパイル使用メモリ 115,748 KB
実行使用メモリ 9,904 KB
最終ジャッジ日時 2026-10-25 00:01:12
合計ジャッジ時間 4,771 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <utility>
#include <tuple>
#include <string>
#include <cstdint>
#include <vector>
#include <array>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <cassert>
using namespace std;
using i64 = int64_t;
int n;
vector<int> xs, ys;
int main() {
    cin >> n;
    xs.resize(n + 2);
    ys.resize(n + 2);
    for (int i = 1; i <= n; ++i) cin >> xs[i];
    for (int i = 1; i <= n; ++i) cin >> ys[i];
    xs[n + 1] = 1 << 28;
    for (int i = 1; i <= n; ++i) {
        xs[n + 1] = min(xs[n + 1], xs[i] + ys[i]);
    }
    for (int i = 1; i <= n; ++i) {
        xs[i] = min(xs[i], xs[n + 1]);
    }
    cout << xs[n + 1] << '\n';
    for (int i = 0; i <= n + 1; ++i) cout << xs[i] << '\n';
    return 0;
}
0