摘要: 重载运算符,应该是最方便写和调用的高精度写法了。 代码: struct haa { int len,a[N]; haa(){len=1;memset(a,0,sizeof(a));} haa(ll x){while(x) a[++len]=x%10,x/=10;} }; char s[N]; inl 阅读全文
posted @ 2021-10-21 17:06 conprour 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 大部分人的树形背包板子应该是写成下面这样的: for(int i = head[u]; i; i = nxt[i]) { if(to[i] == fa)continue; dfs(to[i], u); sz[u] += sz[to[i]]; for(int j = sz[u]; j >= 0; j- 阅读全文
posted @ 2021-10-21 16:49 conprour 阅读(237) 评论(0) 推荐(0) 编辑