1016. Phone Bills (25)

Source: Internet
Author: User

Analysis:

Simulate the question and submit it for countless times. Pay attention to the following points:

1. If a person does not have a valid call record, the person's information will not be output. Here, the question is not displayed after 15 times of reading N times.

2. Call time money calculation: Suppose we calculate the bill between time1 and time2;

(1) We can start the calculation from the start point (that is, 00:00:00), and the result is get_money (time2)-get_money (time1), which is convenient for calculation.

(2) We can also start from time1 to time2, Which is annoying.

3. A valid call record indicates that if someone's call record is1.on;2.on;3.off;, Where1.onWill be discarded and matched2.on;3.off;.

# Include <iostream> # include <stdio. h >#include <algorithm> # include <cstring> # include <vector> # include <cctype> # include <stack> # include <map> rate_structure [} person [cmp (Person &, person & (. name! =. Name <. total <get_money (idx) money = money + = person [idx]. dd ** rate_structure [(I =; I <person [idx]. hh; I ++ money ++ = * money + = person [idx]. mm * money/should_output (idx, n) pre =-(I = idx; I <n; I ++ (person [I]. name = (person [I]. is_on_line = pre = (person [I]. is_on_line = (pre! =-) Work (tmp = person [sum = pre =-; flag = (should_output (cout <person [printf (, person [flag = (I =; I <n; I ++ (person [I]. name! = (Flag = printf (flag = cout <printf (flag = pre =-sum = tmp = (person [I]. is_on_line = pre = (person [I]. is_on_line = (pre! =-Printf (, person [I]. total-money = get_money (I)-printf (sum + = pre =-(flag = printf (scanf (, & rate_structure [])! = Rate_structure [] = rate_structure []; (I =; I <; I ++ scanf (, & rate_structure [] + = scanf (, & (I =; I <n; I ++ cin> scanf (, & person [I]. month, & person [I]. hh, & cin> person [I]. total = person [I]. dd * + person [I]. hh * + person [I]. is_on_line = (status =?: Sort (person, person +}View Code

 

  

Related Article

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.