結果

問題 No.909 たぴの配置
ユーザー minatominato
提出日時 2019-12-14 10:47:29
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 295 ms / 3,000 ms
コード長 995 bytes
コンパイル時間 2,400 ms
コンパイル使用メモリ 177,240 KB
実行使用メモリ 4,772 KB
最終ジャッジ日時 2023-09-10 11:45:44
合計ジャッジ時間 9,135 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 287 ms
4,616 KB
testcase_06 AC 295 ms
4,560 KB
testcase_07 AC 273 ms
4,596 KB
testcase_08 AC 285 ms
4,616 KB
testcase_09 AC 293 ms
4,580 KB
testcase_10 AC 272 ms
4,532 KB
testcase_11 AC 265 ms
4,384 KB
testcase_12 AC 277 ms
4,580 KB
testcase_13 AC 291 ms
4,548 KB
testcase_14 AC 273 ms
4,772 KB
testcase_15 AC 271 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define EPS (1e-7)
#define INF (1e9)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const double PI = acos(-1);
const ll MOD = 1000000007;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
 
template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
///////////////////////////////////////////////////////////////

int main() {
  ios::sync_with_stdio(false); cin.tie(nullptr); //入出力高速化
  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;
  rep(i,N) chmin(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 cout << min(ans,X[i-1]) << endl;
  }
}
0