首页 > TAG信息列表 > MyCalendar

[Google] LeetCode 729 My Calendar I

You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a double booking. A double booking happens when two events have some non-empty intersection (i.e., some moment is common to both events.). Th

729. My Calendar I

You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a double booking. A double booking happens when two events have some non-empty intersection (i.e., some moment is common to both events.). Th

leetcode729 我的日程安排表I

思路: 二分。 实现: 1 class MyCalendar { 2 public: 3 set<pair<int,int>>st; 4 MyCalendar() { 5 6 7 } 8 9 bool book(int start, int end) { 10 auto it=st.lower_bound({end,0}); 11 if(it==st.begin()){

[LeetCode] 729. My Calendar I

You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a double booking. A double booking happens when two events have some non-empty intersection (i.e., some moment is common to both events.). Th