結果

問題 No.909 たぴの配置
ユーザー 37zigen37zigen
提出日時 2019-10-18 23:13:41
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 385 ms / 3,000 ms
コード長 529 bytes
コンパイル時間 787 ms
コンパイル使用メモリ 67,152 KB
実行使用メモリ 5,008 KB
最終ジャッジ日時 2023-09-08 02:11:43
合計ジャッジ時間 6,961 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 375 ms
4,832 KB
testcase_06 AC 385 ms
4,876 KB
testcase_07 AC 357 ms
4,800 KB
testcase_08 AC 380 ms
4,828 KB
testcase_09 AC 384 ms
4,888 KB
testcase_10 AC 351 ms
4,764 KB
testcase_11 AC 351 ms
4,764 KB
testcase_12 AC 364 ms
4,952 KB
testcase_13 AC 381 ms
5,008 KB
testcase_14 AC 352 ms
4,744 KB
testcase_15 AC 351 ms
4,728 KB
権限があれば一括ダウンロードができます

ソースコード

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