Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <map>
- std::map<double, int> roadStarts;
- std::vector<int> getRoadIndexes(double position) {
- auto it = roadStarts.lower_bound(position);
- if (it->first == position) {
- return {it->second - 1, it->second};
- }
- return {it->second};
- }
- bool isDuoLineRoad(int index) {
- }
- int main() {
- int T, R, K, L = 0;
- std::cin >> T >> R >> K;
- std::vector<int> road(K + 2, 0);
- for (int i = 1; i <= K; ++i) {
- std::cin >> road[i];
- roadStarts[L] = i;
- L += road[i];
- }
- roadStarts[L] = K + 1;
- double A = 0;
- double B = L;
- while (true) {
- double meetingTime = (B - A) / 2;
- double meetingPlace = meetingTime + A;
- auto meetingRoadIndexes = getRoadIndexes(meetingPlace);
- if (meetingRoadIndexes.size()) {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement