ICode9

精准搜索请尝试: 精确搜索
  • POJ-2763 Housewife Wind2022-07-06 15:41:31

    Housewife Wind 树链剖分 利用树中每个点都只有一个父节点的性质,将边权化为点权,然后树链剖分 LCA,套一个线段树维护权值 注意在同一链的时候,LCA 的点权是不计算在内的 这题卡时间卡的很紧,如果 TLE,尝试改成 scanf printf #include <iostream> #include <cstdio> #include <algorithm

  • POJ 2763"Housewife Wind"(DFS序+树状数组+LCA)2019-11-02 15:56:59

      传送门   •题意   一对夫妇居住在 xx村庄,给村庄有 $n$ 个小屋;   这 $n$ 个小屋之间有双向可达的道路,不会出现环,即所构成的图是个树;   从 $a_i$ 小屋到 $b_i$ 小屋需要花费 $w_i$ 时间;   初始,女主角在 $s$ 号小屋,有 q 次询问,每次询问为以下两种的一个: 0 u : 她有

  • POJ - 2763 Housewife Wind 【树链剖分+边权】2019-08-04 10:42:55

    After their royal wedding, Jiajia and Wind hid away in XX Village, to enjoy their ordinary happy life. People in XX Village lived in beautiful huts. There are some pairs of huts connected by bidirectional roads. We say that huts in the same pair directl

  • POJ 2763 Housewife Wind LCA+树状数组 dfs序2019-08-01 19:37:07

    http://poj.org/problem?id=2763 After their royal wedding, Jiajia and Wind hid away in XX Village, to enjoy their ordinary happy life. People in XX Village lived in beautiful huts. There are some pairs of huts connected by bidirectional roads. We say that

  • 阶乘的素因子分解(SOJ 2763)2019-03-22 16:52:16

    SOJ 2763: Factorial 问题:给出两个数$N(1\le N\le 10^{9})$和$B(2\le B\le 100000)$,求解$N!$以$B$为基表达时末尾$0$的个数。 例子:(1)$7!$以$10$为基时等于$5040$,此时末尾有$1$个$0$.      (2)$7!$以$2$为基时表示为$1001110110000$,此时末尾有$4$个$0$.  分析:以$B$为基时,$N!

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有