結果

問題 No.909 たぴの配置
ユーザー kyoprounokyoprouno
提出日時 2019-12-17 22:37:47
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 370 ms / 3,000 ms
コード長 559 bytes
コンパイル時間 3,770 ms
コンパイル使用メモリ 167,896 KB
実行使用メモリ 6,336 KB
最終ジャッジ日時 2023-09-18 02:07:37
合計ジャッジ時間 7,956 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 353 ms
5,928 KB
testcase_06 AC 370 ms
6,176 KB
testcase_07 AC 339 ms
6,184 KB
testcase_08 AC 359 ms
5,932 KB
testcase_09 AC 362 ms
6,336 KB
testcase_10 AC 338 ms
6,004 KB
testcase_11 AC 333 ms
6,020 KB
testcase_12 AC 347 ms
5,808 KB
testcase_13 AC 365 ms
6,072 KB
testcase_14 AC 341 ms
5,952 KB
testcase_15 AC 336 ms
5,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> x(n);
    vector<int> y(n);
    vector<long long> z(n);
    long long d=1000000000;
    for(int i=0;i<n;i++){
        cin >> x[i];
    }
    for(int i=0;i<n;i++){
        cin >> y[i];
        z[i]=x[i]+y[i];
        d=min(d,z[i]);
    }
    cout << d << endl;
    cout << 0 << endl;
    for(int i=0;i<n;i++){
        if(x[i]>d){
            cout << d << endl;
        }
        else{
            cout << x[i] << endl;
        }
    }
    cout << d << endl;
}
0