結果

問題 No.909 たぴの配置
ユーザー hamuhei4869hamuhei4869
提出日時 2019-10-18 21:31:41
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 385 ms / 3,000 ms
コード長 591 bytes
コンパイル時間 1,733 ms
コンパイル使用メモリ 146,028 KB
実行使用メモリ 5,492 KB
最終ジャッジ日時 2023-09-07 21:23:41
合計ジャッジ時間 7,851 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 364 ms
5,404 KB
testcase_06 AC 385 ms
5,344 KB
testcase_07 AC 348 ms
5,232 KB
testcase_08 AC 366 ms
5,340 KB
testcase_09 AC 374 ms
5,492 KB
testcase_10 AC 350 ms
5,224 KB
testcase_11 AC 346 ms
5,188 KB
testcase_12 AC 365 ms
5,408 KB
testcase_13 AC 381 ms
5,348 KB
testcase_14 AC 354 ms
5,292 KB
testcase_15 AC 355 ms
5,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

const int MOD = 1e9+7;

int main()
{
    int N;cin >> N;
    vector<int> X(N),Y(N),Z(N);
    for(int i = 0;i < N;i++){
        cin >> X[i];
        Z[i] += X[i];
    }
    for(int i = 0;i < N;i++){
        cin >> Y[i];
        Z[i] += Y[i];
    }
    int mi = *min_element(Z.begin(), Z.end());
    cout<<mi<<endl;
    cout<<0<<endl;
    for(int i = 0;i < N;i++){
        if(X[i] > abs(mi - Y[i])){
            cout<<abs(mi - Y[i])<<endl;
        }else{
            cout<<X[i]<<endl;
        }
    }
    cout<<mi<<endl;
}
0