K - K Crawling in process... Crawling failed Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1875 Description 相信大家都听说一个“百岛湖”的
H - H Crawling in process... Crawling failed Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Practice POJ 3070 Description In the Fibonac
L - L Crawling in process... Crawling failed Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1879 Description 省政府“畅通工程”的目标是使
C. Cutting Figure time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You've gotten an n × m sheet of squared paper. Some o
A. HDU1142 Walk Through the Forest 单源最短路径+记忆化搜索。 #include <algorithm>#include <cstdio>#include <cstdlib>#include <cmath>#include <cstring>#include <iostream>#define INF 10000000using name
思路: 看题解的时候可以结合这篇博客 首先我们要搞清楚维护的是啥。 我们对每一个 a [ i ] a[i] a[i]维护一个 m m m位的bitset,表示 a [ i ] a[i] a[i]是否大于 b [ j ] b[j] b[j]。 这样的 b i t s e t bitset bitset最多只有 m m m种,因为 b b b数组就m个数字,这个有单调性。 所以我们可以预处理出这
题目都很短就懒得写题意了。 思路: 把每个字符的后缀都用hash表示然后用map存起来算数目。 统计的时候,对于当前的前缀我们可以算出其在后缀中出现的次数。 但问题是这样可能有重复。 解决办法是: c n t [ n e x t [ i ] ] − = c n t [ i ] cnt[next[i]] -= cnt[i] cnt[next[i]]−=cnt[i] 因为假设p1是p2的最长公共
题意: 按照 c [ i ] = b [ a [ i ] ] c[i]=b[a[i]] c[i]=b[a[i]]进行置换,给你起点排列和终点排列,置换了k次,求置换排列 思路: 模拟枚举环上节点,然后置换数组就对应 p [ b [ i ] ] = b [ i + 1 ] p[b[i]]=b[i+1] p[b[i]]=b[i+1],相当于在环上后移一位。 是道原题,详解可以看: https:
题意: a [ i ] [ j ] = l c m ( i , j ) a[i][j]=lcm(i,j) a[i][j]=lcm(i,j) 求所有 k ∗ k k*k k∗k小矩阵的最大值和。 思路: 维护横向单调队列求每一行的前 k k k个数最值,再用纵向单调队列求出纵向前 k k k个数最值。这样求出每一点对应 k ∗ k k*k k∗k矩阵的最值了。 但是本题求lcm是log,会
今天,继续讲着第二天没有做完的题目,9*9方格,和奶牛问题。 第二天的问题,还是放在第二天里面解决,第三天,只附上第三天的新题型。 1.有如下程序段,输出结果是 int a = 10,b = 20; int *p, **pp; p = &a; pp = &p; p = &b; printf(“%d %d \n”, *p, **pp); A.10, 20 B.