MoYi123 最近的时间轴更新
MoYi123's repos on GitHub
Python · 10 人关注
mmooyyii
my note
Erlang · 4 人关注
emoji
a emoji dictionary for erlang
Erlang · 4 人关注
trueskill
Erlang implementation of classic TrueSkill and TrueSkill2
Go · 1 人关注
fst
Finite State Transducer
Erlang · 1 人关注
recordis
erlang redis orm
0 人关注
aho-corasick
aho corasick algorithm
Go · 0 人关注
excel_oj
Excel 在线测试平台(大家一起来内卷)
Erlang · 0 人关注
fibheap
Fibonacci heap for erlang
C · 0 人关注
pg_plugin_demo
Go · 0 人关注
practise_db
练习用数据库
Erlang · 0 人关注
ra
A Raft implementation for Erlang and Elixir that strives to be efficient and make it easier to use multiple Raft clusters in a single system.
Erlang · 0 人关注
recon
Collection of functions and scripts to debug Erlang in production.
C · 0 人关注
streamvbyte
Fast integer compression in C using the StreamVByte codec
0 人关注
trueskill-1
Python implementation of TrueSkill player ranking
Go · 0 人关注
WritingAnInterpreterInGo
Writing An Interpreter In Go
Erlang · 0 人关注
x
0 人关注
zheap
new heap with in-place update, powered by undo, for eventual integration into PostgreSQL
MoYi123

MoYi123

V2EX 第 469223 号会员,加入于 2020-02-14 14:02:50 +08:00
MoYi123 最近回复了
@nenseso 成功率还能这么算的? 你是在用纯 udp 协议吗?
专门为你的页面写个接口是没道理的.
可以让后端提供一个能一次性查询多个接口的方法.
大概下面那样.
req
{"data": [{"uri": "get_user", "body": {}}, {"uri": "get_time", "body"}]}
resp
{"data": [{"uri": "get_user", "resp": {"id": "12313"}}, {"uri": "get_time", "resp": "2024-4-29"}]}
“线程池不是应该首先要保证任务完成吗?”

不是, 线程池主要是为了省资源, 减少创建/销毁线程的次数.
你这样做明显会增加创建/销毁线程的次数.
candidates = [10, 20, 20, 30, 40]
target = 45
target1 = 10

from functools import cache

@cache
def dp(idx, count, min_element, max_element):
if idx == len(candidates):
________if count > target and count - min_element < target and count - max_element <= target - target1:
____________print(count, min_element, max_element)
____________return 1
________return 0
____if not count - min_element < target:
________return 0
____ele = candidates[idx]
____pick = dp(idx + 1, count + ele, min(ele, min_element), max(ele, max_element))
____not_pick = dp(idx + 1, count, min_element, max_element)
____return pick + not_pick


print(dp(0, 0, 4e18, 0))


O(n^3 * target) 只有方案数, 具体方案是什么你自己改一下.
要在编译期算运行期的值只能打表啊, 这也没办法.
2 种可能性,
1. 你题目理解错了
2. 面试官 sb
@zero47 这点数量算什么? 随便一个网络游戏, 一次就加载几千个装备物品, 还不是大把人能做?
cache 里不要按调用次数缓存, 改成每秒更新一次就行吧.

还有算 topn 可以用 heap, 虽然这点应该没多大影响.
25 天前
回复了 Curiosity777 创建的主题 Java 请教一个不断增长的数据统计问题
矿是什么东西? 建议不要在问题里加上只有你知道的业务词汇.
然后看了问题, 我也不知道你想要查什么, 怎么查.
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   757 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 14ms · UTC 21:58 · PVG 05:58 · LAX 14:58 · JFK 17:58
Developed with CodeLauncher
♥ Do have faith in what you're doing.