結果

問題 No.909 たぴの配置
ユーザー mine691mine691
提出日時 2019-10-18 22:04:36
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 366 ms / 3,000 ms
コード長 720 bytes
コンパイル時間 1,738 ms
コンパイル使用メモリ 166,508 KB
実行使用メモリ 5,536 KB
最終ジャッジ日時 2023-09-07 23:33:28
合計ジャッジ時間 7,596 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 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 353 ms
5,536 KB
testcase_06 AC 366 ms
5,332 KB
testcase_07 AC 335 ms
5,256 KB
testcase_08 AC 336 ms
5,368 KB
testcase_09 AC 354 ms
5,472 KB
testcase_10 AC 323 ms
5,276 KB
testcase_11 AC 317 ms
5,064 KB
testcase_12 AC 339 ms
5,328 KB
testcase_13 AC 346 ms
5,468 KB
testcase_14 AC 332 ms
5,112 KB
testcase_15 AC 329 ms
5,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;
const int inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;
#define fast() ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)

int N, ans = inf;

int main()
{
    cin >> N;
    vector<int> x(N), y(N), point(N + 2);
    for (int i = 0; i < N; i++)
    {
        cin >> x[i];
    }

    for (int i = 0; i < N; i++)
    {
        cin >> y[i];
        ans = min(ans, x[i] + y[i]);
    }

    cout << ans << endl;

    point[0] = 0, point[N + 1] = ans;

    for (int i = 1; i < N + 1; i++)
    {
        point[i] = min(x[i - 1], ans);
    }

    for (int i = 0; i < N + 2; i++)
    {
        cout << point[i] << endl;
    }
}
0