Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <queue>
- using namespace std;
- struct crew {
- int hc;
- int st;
- int et;
- };
- struct guest {
- int h;
- int t;
- };
- int main() {
- crew *Crew;
- guest Guest;
- queue <guest> GuestLine;
- int H, C, Q;
- cin >> H >> C >> Q;
- Crew = new crew[C];
- cout << endl << "Crew Information..." << endl;
- for (int i = 0; i < C; i++) {
- cin >> Crew[i].hc >> Crew[i].st >> Crew[i].et;
- }
- cout << endl << "Guest Information..." << endl << endl;
- for (int i = 0; i < Q; i++) {
- cin >> Guest.h >> Guest.t;
- GuestLine.push(Guest);
- }
- cout << "\nOutput...\n";
- while (!GuestLine.empty()) {
- bool checker = true;
- for (int i = 0; i < C; i++) {
- if (GuestLine.front().t >= Crew[i].st && GuestLine.front().t <= Crew[i].et && GuestLine.front().t <= H) {
- if (GuestLine.front().h <= Crew[i].hc) {
- checker = false;
- break;
- }
- }
- }
- cout << (checker ? "YES" : "NO") << endl;
- GuestLine.pop();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement