結果
問題 |
No.909 たぴの配置
|
ユーザー |
|
提出日時 | 2020-04-21 20:04:32 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 353 ms / 3,000 ms |
コード長 | 629 bytes |
コンパイル時間 | 838 ms |
コンパイル使用メモリ | 73,248 KB |
最終ジャッジ日時 | 2025-01-09 22:07:26 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include <iostream> #include <vector> constexpr int INF = 1 << 30; void solve() { int n; std::cin >> n; std::vector<int> xs(n), ys(n); for (auto& x : xs) std::cin >> x; for (auto& y : ys) std::cin >> y; int r = INF; for (int i = 0; i < n; ++i) { r = std::min(r, xs[i] + ys[i]); } std::cout << r << std::endl << 0 << std::endl; for (int i = 0; i < n; ++i) { std::cout << std::min(xs[i], r) << std::endl; } std::cout << r << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }