結果

問題 No.909 たぴの配置
ユーザー たぴちゃんたぴちゃん
提出日時 2019-10-17 21:47:56
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 657 bytes
コンパイル時間 1,890 ms
コンパイル使用メモリ 200,756 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-07 20:49:52
合計ジャッジ時間 6,395 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using int64 = long long;

int main(){
    int n;
    cin >> n;
    assert(1 <= n && n <= 100000);
    vector<int64> x(n), y(n);
    for(int i = 0; i < n; i++){
        cin >> x[i];
        assert(0 <= x[i] && x[i] <= 1000000);
    }
    for(int i = 0; i < n; i++){
        cin >> y[i];
        assert(0 <= y[i] && y[i] <= 1000000);
    }
    int64 MIN = x[0] + y[0];
    int64 l = 1000000;
    for(int i = 1; i < n; i++) MIN = min(MIN, x[i] + y[i]);
    cout << MIN << endl << l << endl;
    for(int i = 0; i < n; i++) cout << max(min(l + x[i], l + MIN - y[i]), l - x[i]) << endl;
    cout << l + MIN << endl;
}
0