結果
問題 |
No.1460 Max of Min
|
ユーザー |
![]() |
提出日時 | 2021-03-31 21:58:44 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 628 bytes |
コンパイル時間 | 1,712 ms |
コンパイル使用メモリ | 169,620 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-15 18:32:57 |
合計ジャッジ時間 | 11,574 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 34 RE * 57 |
ソースコード
#include <bits/stdc++.h> int ri() { int n; scanf("%d", &n); return n; } int main() { int k = ri(); int64_t n; std::cin >> n; std::vector<int64_t> a(k); int64_t b[k]; for (auto &i : a) std::cin >> i; for (auto &i : b) std::cin >> i; for (int i = 0; i < 10000; i++) { int64_t next = -1000000000000000001; for (int j = 0; j < k; j++) next = std::max(next, std::min(b[j], a[i + j])); a.push_back(next); } if (n < (int) a.size()) { printf("%" PRId64 "\n", a[n]); return 0; } else { assert(0); int left = (n - (a.size() - k)) % k; printf("%" PRId64 "\n", a[a.size() - k + left]); } return 0; }