
Lv.1
无情刀永不知错 无缘份之叹奈何
签名:卷文化课的同时准备竞赛。
在 谁会做掉线检测啊?联机的 中回复
如果要提示谁掉线了的话只要每秒存一下链表里的人,在线人数改变的时候对比一下之前存的和现在的链表有什么区别,把缺项报出来就行了
2020-04-23T22:23:46 点赞:0
在 谁会做掉线检测啊?联机的 中回复
总结一下,判断一下在线人数然后把在线的人和之前存的对比一下。具体地说,每个人进来的时候都把用户名放到一个链表里面,然后只要显示链表就行了。如果要提示谁掉线了的话只要每秒存一下链表里的人,在线人数改变的时候对比一下之前存的和现在的链表有什么区别,把缺项报出来就行了。这些怎么判断可以去学学链表和云变量,这里就不再赘述了。
2020-04-23T22:25:42 点赞:0
在 谁会做掉线检测啊?联机的 中回复
啊我有个更好的方法,每秒判断一下在线人数并把判断变量标记0,如果发生变化了并且判断变量是0再把列表清空,然后把判断变量标记为1,这样别人就不会再次清空了,然后把自己的用户名丢进链表,重复到列表里的项数和在线人数一样,然后把判断变量重新标为0.
2020-04-23T22:50:12 点赞:0
在 谁会做掉线检测啊?联机的 中回复
每秒判断一下在线人数并把判断变量标记0,如果发生变化了并且判断变量是0再把列表清空,然后把判断变量标记为1,这样别人就不会再次清空了,然后把自己的用户名丢进链表,重复到列表里的项数和在线人数一样,然后把判断变量重新标为0.
· 这里用到了标记变量,这是写代码的时候也常用到的一种技巧,其中变量的值为0表示列表项数和在线用户数一样,此时如果说在线用户数和列表项数不同的话就可以备份一下然后清空重新放;如果变量是1那么表示每个用户那端还没把自己的用户名存进去,这个时候不会清空。
2020-04-24T19:00:52 点赞:1
在 【kitten高级技巧】kitten技巧来了!快来围观吧~~ 中回复
∑以下教程,可以让你轻松入门OI!
https://shequ.codemao.cn/community/199346(DFS)https://shequ.codemao.cn/community/199498(线性DP)
https://shequ.codemao.cn/community/207911(模拟)https://shequ.codemao.cn/community/207618(分治)
https://shequ.codemao.cn/community/200968(记搜)https://shequ.codemao.cn/community/224373(状压)
https://shequ.codemao.cn/community/225092(树形dp)https://shequ.codemao.cn/community/261601(生成树)
https://shequ.codemao.cn/community/208169(区间dp)https://shequ.codemao.cn/community/266275(计算机)
https://shequ.codemao.cn/community/2喵803(期望)https://shequ.codemao.cn/community/2喵688(求导)
https://shequ.codemao.cn/community/263456(团队)https://shequ.codemao.cn/community/272524(AC自动机)
https://shequ.codemao.cn/community/275691(总结)https://shequ.codemao.cn/community/277341(图的联通)
https://shequ.codemao.cn/community/277325(书的直径)还有什么呢?快看看吧(雾
2020-04-24T20:09:56 点赞:0
在 教练喵告诉你【如何写一篇好的教程帖】 中回复
https://shequ.codemao.cn/community/199346(DFS)https://shequ.codemao.cn/community/199498(线性DP)
https://shequ.codemao.cn/community/207911(模拟)https://shequ.codemao.cn/community/207618(分治)
https://shequ.codemao.cn/community/200968(记搜)https://shequ.codemao.cn/community/224373(状压)
https://shequ.codemao.cn/community/225092(树形dp)https://shequ.codemao.cn/community/261601(生成树)
https://shequ.codemao.cn/community/208169(区间dp)https://shequ.codemao.cn/community/266275(计算机)
https://shequ.codemao.cn/community/264803(期望)https://shequ.codemao.cn/community/264688(求导)
https://shequ.codemao.cn/community/263456(团队)https://shequ.codemao.cn/community/272524(AC自动机)
https://shequ.codemao.cn/community/275691(总结)https://shequ.codemao.cn/community/277341(图的联通)
https://shequ.codemao.cn/community/277325(树直径)https://shequ.codemao.cn/community/282269(kitten)
麻烦看一看这些帖子能否加精,都达到要求了。
2020-04-24T20:13:42 点赞:0
在 【教程贴】额,补上次的 中回复
(你把int 讲了为什么直接弄float,double/short/long long/unsigned/char/string去哪冽)
2020-04-25T16:34:20 点赞:0