zoukankan      html  css  js  c++  java
  • a题

    D. Logging
    time limit per test
    2 seconds
    memory limit per test
    64 megabytes
    input
    standard input
    output
    standard output

    The main server of Gomble company received a log of one top-secret process, the name of which can't be revealed. The log was written in the following format: «[date:time]: message», where for each «[date:time]» value existed not more than 10 lines. All the files were encoded in a very complicated manner, and only one programmer — Alex — managed to decode them. The code was so complicated that Alex needed four weeks to decode it. Right after the decoding process was finished, all the files were deleted. But after the files deletion, Alex noticed that he saved the recordings in format «[time]: message». So, information about the dates was lost. However, as the lines were added into the log in chronological order, it's not difficult to say if the recordings could appear during one day or not. It is possible also to find the minimum amount of days during which the log was written.

    So, to make up for his mistake Alex has to find the minimum amount of days covered by the log. Note that Alex doesn't have to find the minimum amount of days between the beginning and the end of the logging, he has to find the minimum amount of dates in which records could be done. (See Sample test 2 for further clarifications).

    We should remind you that the process made not more than 10 recordings in a minute. Consider that a midnight belongs to coming day.

    Input

    The first input line contains number n (1 ≤ n ≤ 100). The following n lines contain recordings in format «[time]: message», where time is given in format «hh:mm x.m.». For hh two-digit numbers from 01 to 12 are used, for mm two-digit numbers from 00 to 59 are used, and x is either character «a» or character «p». A message is a non-empty sequence of Latin letters and/or spaces, it doesn't start or end with a space. The length of each message doesn't exceed 20.

    Output

    Output one number — the minimum amount of days covered by the log.

    Sample test(s)
    input
    5
    [05:00 a.m.]: Server is started
    [05:00 a.m.]: Rescan initialized
    [01:13 p.m.]: Request processed
    [01:10 p.m.]: Request processed
    [11:40 p.m.]: Rescan completed
    output
    2
    input
    3
    [09:00 a.m.]: User logged in
    [08:00 a.m.]: User logged in
    [07:00 a.m.]: User logged in
    output
    3
    Note

    Formally the 12-hour time format is described at:

    • http://en.wikipedia.org/wiki/12-hour_clock.
    The problem authors recommend you to look through these descriptions before you start with the problem.
  • 相关阅读:
    github not authorized eclipse 关于 代码不能提交到GitHub
    idea 导入项目后 有的项目目录结构不展开解决办法
    intellij idea 主题大全,看不惯idea 那2种主题的来这里了
    win10 系统输入法与 idea的 ctr+shift+f 快捷键冲突,解决办法
    此地址使用了一个通常用于网络浏览以外目的的端口。出于安全原因,Firefox 取消了该请求。
    关于IntelliJ IDEA有时候快捷键无效的说明
    杜恩德是谁?
    oracle如何连接别人的数据库,需要在本地添加一些配置
    2.6---找有环链表的开头结点(CC150)
    2.3---删除链表的结点,不提供头结点(CC150)
  • 原文地址:https://www.cnblogs.com/wejex/p/3249626.html
Copyright © 2011-2022 走看看