結果

問題 No.909 たぴの配置
ユーザー MisterMister
提出日時 2020-04-21 20:04:32
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 294 ms / 3,000 ms
コード長 629 bytes
コンパイル時間 1,007 ms
コンパイル使用メモリ 77,388 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 10:51:19
合計ジャッジ時間 6,736 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 272 ms
5,376 KB
testcase_06 AC 280 ms
5,376 KB
testcase_07 AC 261 ms
5,376 KB
testcase_08 AC 276 ms
5,376 KB
testcase_09 AC 294 ms
5,376 KB
testcase_10 AC 267 ms
5,376 KB
testcase_11 AC 261 ms
5,376 KB
testcase_12 AC 283 ms
5,376 KB
testcase_13 AC 293 ms
5,376 KB
testcase_14 AC 264 ms
5,376 KB
testcase_15 AC 260 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>

constexpr int INF = 1 << 30;

void solve() {
    int n;
    std::cin >> n;

    std::vector<int> xs(n), ys(n);
    for (auto& x : xs) std::cin >> x;
    for (auto& y : ys) std::cin >> y;

    int r = INF;
    for (int i = 0; i < n; ++i) {
        r = std::min(r, xs[i] + ys[i]);
    }

    std::cout << r << std::endl
              << 0 << std::endl;
    for (int i = 0; i < n; ++i) {
        std::cout << std::min(xs[i], r) << std::endl;
    }
    std::cout << r << std::endl;
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}
0