結果
問題 | No.1139 Slime Race |
ユーザー |
|
提出日時 | 2020-07-31 21:37:20 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 535 bytes |
コンパイル時間 | 2,739 ms |
コンパイル使用メモリ | 194,124 KB |
最終ジャッジ日時 | 2025-01-12 09:28:00 |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 WA * 3 |
ソースコード
#include <bits/stdc++.h> int main(){ int64_t N, D; std::cin >> N >> D; std::vector<int64_t> x(N), v(N); for(int i = 0; i < N; ++i) std::cin >> x[i]; for(int i = 0; i < N; ++i) std::cin >> v[i]; auto f = [&](int64_t T){ int64_t ret = std::accumulate(v.begin(), v.end(), 0LL) * T; return ret; }; int64_t lb = 0, ub = 1e9; while(std::abs(lb - ub) > 1){ auto mid = (lb + ub) / 2; if(f(mid) >= D){ ub = mid; }else{ lb = mid; } } std::cout << ub << "\n"; return 0; }