結果

問題 No.909 たぴの配置
ユーザー TAISA_TAISA_
提出日時 2019-10-20 11:33:26
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 302 ms / 3,000 ms
コード長 797 bytes
コンパイル時間 1,681 ms
コンパイル使用メモリ 167,508 KB
実行使用メモリ 6,196 KB
最終ジャッジ日時 2023-09-15 14:34:41
合計ジャッジ時間 9,970 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 282 ms
5,944 KB
testcase_06 AC 292 ms
6,076 KB
testcase_07 AC 273 ms
5,924 KB
testcase_08 AC 295 ms
5,928 KB
testcase_09 AC 302 ms
6,188 KB
testcase_10 AC 273 ms
5,880 KB
testcase_11 AC 265 ms
5,824 KB
testcase_12 AC 288 ms
5,896 KB
testcase_13 AC 294 ms
6,196 KB
testcase_14 AC 273 ms
5,832 KB
testcase_15 AC 269 ms
5,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define all(vec) vec.begin(), vec.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
constexpr ll INF = (1LL << 30) - 1LL;
constexpr ll LINF = (1LL << 60) - 1LL;
constexpr ll MOD = 1e9 + 7;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<ll> x(n), y(n);
    ll d = LINF;
    for (int i = 0; i < n; i++) {
        cin >> x[i];
    }
    for (int i = 0; i < n; i++) {
        cin >> y[i];
        chmin(d, x[i] + y[i]);
    }
    cout << d << endl;
    cout << 0 << endl;
    for (int i = 0; i < n; i++) {
        cout << min(d, x[i]) << endl;
    }
    cout << d << endl;
}
0