HDU 4079 happy telephones simple question

Source: Internet
Author: User

// Give you some time for phone calls to work, and then give you another time period for monitoring, ask how many calls can be monitored, as long as there are overlapping time periods, even if there is monitoring .. Simple question ..
# Include <iostream>
# Include <stdio. h>
Using namespace STD;
Struct phone
{
Int source;
Int des;
Int start;
Int;
};
Phone phone [10001];
Int main ()
{
Int n, m;
Int I, J;
Int start, end;
Int;
Int sum;
While (scanf ("% d", & N, & M )! = EOF)
{
If (n = 0 & M = 0)
Break;
For (I = 0; I <n; I ++)
{
Scanf ("% d", & phone [I]. source, & phone [I]. des, & phone [I]. start, & phone [I]. during );
}
For (I = 0; I <m; I ++)
{
Sum = 0;
Scanf ("% d", & START, & );
End = start +;
For (j = 0; j <n; j ++)
{
If (phone [J]. Start <start & phone [J]. Start + phone [J]. During> start)
Sum ++;
If (phone [J]. Start = start)
Sum ++;
If (phone [J]. Start> Start & start + during> phone [J]. Start)
Sum ++;
}
Printf ("% d \ n", sum );
}
}
Return 0;
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.