文件名称:1-2
介绍说明--下载内容来自于网络,使用问题请自行百度
描述
公司有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)的答案之和(int表示,自动溢出,不用管溢出部分)(The company has n employees, numbered 1 ~ n. The large number of employees requires you to write a management system for them.
When employees go to work, they have to log in to the management system to register a code and leave to logout from the management system. Employees can also update their code at any time. By the time of get off work, all employees will be automatically logged off. Company managers may want to know how many employees work at any time, as well as any employee registration code.)
公司有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)的答案之和(int表示,自动溢出,不用管溢出部分)(The company has n employees, numbered 1 ~ n. The large number of employees requires you to write a management system for them.
When employees go to work, they have to log in to the management system to register a code and leave to logout from the management system. Employees can also update their code at any time. By the time of get off work, all employees will be automatically logged off. Company managers may want to know how many employees work at any time, as well as any employee registration code.)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.