CodeForces 4C Registration system

本文介绍了CodeForces 4C问题,即Berlandesk注册系统的设计。系统接收到新用户的注册请求时,若用户名未注册,则插入数据库并返回'OK'。若用户名已存在,系统将生成新的用户名(如原名+数字后缀),发送给用户并添加到数据库。文章提供了一个通过使用映射来检查用户名唯一性的解决方案,避免了模拟注册过程导致的时间超时问题。
摘要由CSDN通过智能技术生成

C. Registration system

time limit per test

5 seconds

memory limit per test

64 megabytes

input

standard input

output

standard output

A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle.

Each time a new user wants to register, he sends to the system a request with his name. If such a name does not exist in the system database, it is inserted into the database, and the user gets the response OK, confirming the successful registration. If the name already exists in the system database, the system makes up a new user name, sends it to the user as a prompt and also inserts the prompt into the database. The ne

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值