結果
問題 | No.909 たぴの配置 |
ユーザー | bonKotsu |
提出日時 | 2021-12-03 00:49:21 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 369 ms / 3,000 ms |
コード長 | 665 bytes |
コンパイル時間 | 4,335 ms |
コンパイル使用メモリ | 259,388 KB |
実行使用メモリ | 4,760 KB |
最終ジャッジ日時 | 2023-09-18 12:19:57 |
合計ジャッジ時間 | 10,211 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,380 KB |
testcase_01 | AC | 1 ms
4,380 KB |
testcase_02 | AC | 1 ms
4,380 KB |
testcase_03 | AC | 1 ms
4,380 KB |
testcase_04 | AC | 1 ms
4,384 KB |
testcase_05 | AC | 352 ms
4,752 KB |
testcase_06 | AC | 369 ms
4,664 KB |
testcase_07 | AC | 339 ms
4,380 KB |
testcase_08 | AC | 356 ms
4,660 KB |
testcase_09 | AC | 368 ms
4,656 KB |
testcase_10 | AC | 337 ms
4,380 KB |
testcase_11 | AC | 337 ms
4,384 KB |
testcase_12 | AC | 361 ms
4,760 KB |
testcase_13 | AC | 356 ms
4,668 KB |
testcase_14 | AC | 341 ms
4,404 KB |
testcase_15 | AC | 341 ms
4,408 KB |
ソースコード
#include <bits/stdc++.h> using namespace std; #include <atcoder/all> using namespace atcoder; #define ll long long #define rep(i, n) for (int i = 0; i < (n); i++) #define P pair<int, int> #define LP pair<ll, ll> int main() { int n; cin >> n; vector<int> x(n), y(n); rep(i,n) cin >> x[i]; rep(i,n) cin >> y[i]; const int INF = 1001001001; int mx = INF; rep(i,n) mx = min(mx, x[i]+y[i]); cout << mx << endl; cout << 0 << endl; // たぴ0 rep(i,n) { if (x[i] >= mx) { cout << mx << endl; } else if (y[i] >= mx) { cout << 0 << endl; } else { cout << x[i] << endl; } } cout << mx << endl; // たぴn+1 }