結果

問題 No.909 たぴの配置
ユーザー 37zigen
提出日時 2019-10-18 23:13:41
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 380 ms / 3,000 ms
コード長 529 bytes
コンパイル時間 680 ms
コンパイル使用メモリ 70,320 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-25 19:18:13
合計ジャッジ時間 6,923 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cmath>
#include <iostream>
#include <string>

const int NMAX = 212345;
int X[NMAX];
int Y[NMAX];

int main() {
  int N;
  std::cin >> N;
  for (int i = 0; i < N; ++i) std::cin >> X[i];
  for (int i = 0; i < N; ++i) std::cin >> Y[i];
  int ans = X[0] + Y[0];
  for (int i = 0; i < N; ++i) {
    ans = std::min(ans, X[i] + Y[i]);
  }
  std::cout << ans << std::endl;
  std::cout << 0 << std::endl;
  for (int i = 0; i < N; ++i) {
    std::cout << std::min(ans, X[i]) << std::endl;
  }
  std::cout << ans << std::endl;
}

0