結果

問題 No.909 たぴの配置
ユーザー hipopohipopo
提出日時 2020-01-11 14:58:50
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 388 ms / 3,000 ms
コード長 550 bytes
コンパイル時間 2,051 ms
コンパイル使用メモリ 202,128 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-03 19:33:03
合計ジャッジ時間 8,981 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 378 ms
5,376 KB
testcase_06 AC 388 ms
5,376 KB
testcase_07 AC 356 ms
5,376 KB
testcase_08 AC 370 ms
5,376 KB
testcase_09 AC 387 ms
5,376 KB
testcase_10 AC 354 ms
5,376 KB
testcase_11 AC 356 ms
5,376 KB
testcase_12 AC 368 ms
5,376 KB
testcase_13 AC 385 ms
5,376 KB
testcase_14 AC 360 ms
5,376 KB
testcase_15 AC 357 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

using ll = long long;

int main() {
    int n;
    cin >> n;
    vector<int> x(n), y(n);
    for (int i = 0; i < n; i++) {
        cin >> x.at(i);
    }
    for (int i = 0; i < n; i++) {
        cin >> y.at(i);
    }

    int min_d = 2 * (int)1e6;
    for (int i = 0; i < n; i++) {
        min_d = min(min_d, x.at(i) + y.at(i));
    }
    
    cout << min_d << endl;
    cout << 0 << endl;
    for (int i = 0; i < n; i++) {
        cout << min(x.at(i), min_d) << endl;
    }
    cout << min_d << endl;
}
0