結果

問題 No.909 たぴの配置
ユーザー kagasankagasan
提出日時 2019-11-26 18:45:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 390 ms / 3,000 ms
コード長 823 bytes
コンパイル時間 2,780 ms
コンパイル使用メモリ 162,692 KB
実行使用メモリ 6,784 KB
最終ジャッジ日時 2024-04-24 16:12:03
合計ジャッジ時間 8,867 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 376 ms
6,528 KB
testcase_06 AC 390 ms
6,656 KB
testcase_07 AC 358 ms
6,400 KB
testcase_08 AC 376 ms
6,656 KB
testcase_09 AC 388 ms
6,784 KB
testcase_10 AC 360 ms
6,528 KB
testcase_11 AC 361 ms
6,400 KB
testcase_12 AC 375 ms
6,656 KB
testcase_13 AC 390 ms
6,784 KB
testcase_14 AC 367 ms
6,400 KB
testcase_15 AC 361 ms
6,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll (i) = 0; (i) < (n); (i)++)
#define rep1(i, n) for(ll (i) = 1; (i) <= (n); (i)++)
#define rrep(i, n) for(ll (i) = (n) - 1; (i) >= 0; (i)--)
#define rrep1(i, n) for(ll (i) = (n); (i) >= 1; (i)--)
const ll INF = 1145141919;
const ll MOD = 1000000007;
template<class T> void chmax(T &a, const T &b){if(a < b){a = b;}}
template<class T> void chmin(T &a, const T &b){if(a > b){a = b;}}

ll X[202020];
ll Y[202020];

int main(){

	ll N;
    cin >> N;
    rep1(i, N)cin >> X[i];
    rep1(i, N)cin >> Y[i];
    ll ans = INF;
    rep1(i, N)chmin(ans, X[i] + Y[i]);
    cout << ans << endl;
    cout << 0 << endl;
    rep1(i, N){
        cout << min(X[i], ans) << endl;
    }
    cout << ans << endl;

    return 0;
}
0