所属分类:
MacOS编程
开发工具:C/C++
文件大小:2KB
下载次数:0
上传日期:2018-12-03 09:13:55
说明: 公司有 n 个员工,编号 1 ~ n。员工数量众多,需要你为他们编写一个管理系统。
员工上班时都要登录管理系统登记一个 code,离开要从管理系统上注销,员工也可以随时更新自己的 code。到了下班时间,所有员工都会自动注销。公司管理人员随时都可能想要知道有多少员工上班,以及任一员工登记的 code。
输入
第一行两个整数n、m。接下来m行,每行都是以下内容之一:
I a c // Log In:员工 a 登录,code 为 c。若 a 已登录,则将 code 更新为 c
O a // Log Out:编号为 a 的员工注销。若 a 未登录,则注销无效
C // Close:到下班时间,所有员工注销
N // Number:询问有多少员工正在上班
Q a // Query:询问员工 a 的 code(若未登录或已注销,视为 -1)
输出
一个整数,是所有询问(N、Q)的答案之和
(The company has n employees, numbered 1 ~ n. There are a large number of employees who need you to write a management system for them.
When employees go to work, they must log in to the management system to register a code. If they leave to log out from the management system, employees can update their code at any time. All employees are automatically logged out during off hours. Company managers may want to know how many employees are working at any time, as well as the code registered by any employee.)
文件列表:
company, 8612 , 2018-10-21
company.cpp, 1241 , 2018-10-21