結果

問題 No.909 たぴの配置
ユーザー kappybarkappybar
提出日時 2020-03-28 12:16:30
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 378 ms / 3,000 ms
コード長 700 bytes
コンパイル時間 1,762 ms
コンパイル使用メモリ 167,596 KB
実行使用メモリ 4,716 KB
最終ジャッジ日時 2023-08-30 17:33:12
合計ジャッジ時間 8,533 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 351 ms
4,660 KB
testcase_06 AC 373 ms
4,652 KB
testcase_07 AC 336 ms
4,384 KB
testcase_08 AC 362 ms
4,640 KB
testcase_09 AC 378 ms
4,704 KB
testcase_10 AC 348 ms
4,448 KB
testcase_11 AC 344 ms
4,532 KB
testcase_12 AC 349 ms
4,716 KB
testcase_13 AC 370 ms
4,708 KB
testcase_14 AC 339 ms
4,392 KB
testcase_15 AC 334 ms
4,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> pp;
const int INF = 1e9;
const int MOD = 1000000007;


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 = INF,idx = 0;

    rep(i,n){
        if(ans > x[i] + y[i]){
            idx = i; 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{
            if(x[i-1] < ans) cout << x[i-1] << endl;
            else cout << ans << endl;
        }
    }

    return 0;  
}
0