結果

問題 No.909 たぴの配置
ユーザー ei13337ei13337
提出日時 2019-10-18 21:27:31
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 351 ms / 3,000 ms
コード長 528 bytes
コンパイル時間 2,136 ms
コンパイル使用メモリ 167,576 KB
実行使用メモリ 4,756 KB
最終ジャッジ日時 2023-09-07 21:13:54
合計ジャッジ時間 7,482 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 2 ms
4,384 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 345 ms
4,636 KB
testcase_06 AC 338 ms
4,756 KB
testcase_07 AC 307 ms
4,380 KB
testcase_08 AC 339 ms
4,576 KB
testcase_09 AC 351 ms
4,664 KB
testcase_10 AC 324 ms
4,380 KB
testcase_11 AC 328 ms
4,388 KB
testcase_12 AC 343 ms
4,716 KB
testcase_13 AC 345 ms
4,584 KB
testcase_14 AC 317 ms
4,492 KB
testcase_15 AC 316 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
using namespace std;
using ll = long long;

int main() {
    int n;
    cin >> n;
    vector<int> x(n), y(n);
    rep(i, n) cin >> x[i];
    rep(i, n) cin >> y[i];
    int ans = x[0] + y[0];
    rep(i, n) {
        ans = min(ans, x[i] + y[i]);
    }
    cout << ans << endl;
    rep(i, n + 2) {
        if(i == 0) cout << 0 << endl;
        else if(i == n + 1) cout << ans << endl;
        else cout << min(x[i - 1], ans) << endl;
    }
    return 0;
}
0