- 博客(741)
- 资源 (10)
- 问答 (1)
- 收藏
- 关注
原创 POJ 3321 Apple Tree (树状数组)
Description There is an apple tree outside of kaka’s house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been carefully nurturing the big apple tree.
2017-08-19 19:43:52 358
原创 HDU 6146 Pokémon GO (dp)
Description 众所周知,度度熊最近沉迷于 Pokémon GO。 今天它决定要抓住所有的精灵球! 为了不让度度熊失望,精灵球已经被事先放置在一个2*N的格子上,每一个格子上都有一个精灵球。度度熊可以选择任意一个格子开始游戏,抓捕格子上的精灵球,然后移动到一个相邻的至少有一个公共点的格子上继续抓捕。例如,(2, 2) 的相邻格子有(1, 1), (2, 1
2017-08-18 21:22:33 920
原创 HDU 6143 Killer Names (容斥)
Description Galen Marek, codenamed Starkiller, was a male Human apprentice of the Sith Lord Darth Vader. A powerful Force-user who lived during the era of the Galactic Empire, Marek originated from t
2017-08-17 17:50:01 1637 15
原创 HDU 6121 Build a tree (技巧)
Description HazelFan wants to build a rooted tree. The tree has nn nodes labeled 00 to n−1n−1 , and the father of the node labeled ii is the node labeled ⌊i−1k⌋\lfloor\frac{i-1}{k}\rfloor. HazelFan w
2017-08-17 10:12:30 438
原创 HDU 6129 Just do it (组合数)
Description There is a nonnegative integer sequence a1…n of length n. HazelFan wants to do a type of transformation called prefix-XOR, which means a1…n changes into b1…n, where bi equals to the XOR v
2017-08-16 17:48:39 348
原创 BZOJ 2038 小Z的袜子 (莫队算法)
Description 作为一个生活散漫的人,小Z 每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小Z 再也无法忍受这恼人的找袜子过程,于是他决定听天由命…… 具体来说, 小Z 把这 N 只袜子从 1 到 N 编号,然后从编号 L 到 R ( L 尽管 小Z 并不在意两只袜子是不是完整的一双,甚至不在意两只袜子是否一左一右,他却很在意袜子的颜色,毕竟穿两只不同色的
2017-08-16 11:52:45 379
原创 HDU 4609 3-idiots (FFT)
Description King OMeGa catched three men who had been streaking in the street. Looking as idiots though, the three men insisted that it was a kind of performance art, and begged the king to free them
2017-08-15 20:57:09 525
原创 HDU 6119 小小粉丝度度熊 (枚举 + 二分)
Description 度度熊喜欢着喵哈哈村的大明星——星星小姐。 为什么度度熊会喜欢星星小姐呢? 首先星星小姐笑起来非常动人,其次星星小姐唱歌也非常好听。 但这都不是最重要的,最重要的是,星星小姐拍的一手好代码! 于是度度熊关注了星星小姐的贴吧。 一开始度度熊决定每天都在星星小姐的贴吧里面签到。 但是度度熊是一个非常健忘的孩子,总有那
2017-08-14 11:22:56 483
原创 HDU 6118 度度熊的交易计划 (最小费用最大流)
Description 度度熊参与了喵哈哈村的商业大会,但是这次商业大会遇到了一个难题: 喵哈哈村以及周围的村庄可以看做是一共由n个片区,m条公路组成的地区。 由于生产能力的区别,第i个片区能够花费a[i]元生产1个商品,但是最多生产b[i]个。 同样的,由于每个片区的购买能力的区别,第i个片区也能够以c[i]的价格出售最多d[i]个物品。 由于这些因素,
2017-08-13 19:55:20 1238
原创 Codeforces 839 D. Winter is here (莫比乌斯反演)
Description Winter is here at the North and the White Walkers are close. John Snow has an army consisting of n soldiers. While the rest of the world is fighting for the Iron Throne, he is going to ge
2017-08-13 11:58:59 1495
原创 Codeforces 839 B. Game of the Rows (贪心)
Description Daenerys Targaryen has an army consisting of k groups of soldiers, the i-th group contains ai soldiers. She wants to bring her army to the other side of the sea to get the Iron Throne. Sh
2017-08-13 09:03:03 414
原创 HDU 6059 Kanade's trio (字典树)
Description Give you an array A[1..n]A[1..n] ,you need to calculate how many tuples (i,j,k)(i,j,k) satisfy that (i<j<k)(i<j<k) and ((A[i] xor A[j])<(A[j] xor A[k]))((A[i]\ xor\ A[j])<(A[j]\ xor\ A[k]
2017-08-12 19:25:45 525
原创 HDU 6070 Dirt Ratio (线段树+二分)
Description In ACM/ICPC contest, the ”Dirt Ratio” of a team is calculated in the following way. First let’s ignore all the problems the team didn’t pass, assume the team passed X problems during the
2017-08-11 16:13:52 350
原创 HDU 6103 Kirinriki (尺取法)
Description We define the distance of two strings A and B with same length n is disA,B=∑n−1i=0|Ai−Bn−1−i|dis_{A,B}=\sum_{i=0}^{n−1}|A_i−B_{n−1−i}| The difference between the two characters
2017-08-10 19:56:24 1388 5
原创 HDU 6058 Kanade's sum (技巧)
Description Give you an array A[1..n]A[1..n] of length nn . Let f(l,r,k)f(l,r,k) be the k-th largest element of A[l..r]A[l..r] . Specially , f(l,r,k)=0f(l,r,k)=0 if r−l+1<kr−l+1<k . G
2017-08-10 10:54:14 389
原创 HDU 6078 Wavel Sequence (dp)
Description Have you ever seen the wave? It’s a wonderful view of nature. Little Q is attracted to such wonderful thing, he even likes everything that looks like wave. Formally, he defines a sequence
2017-08-09 20:29:49 544
原创 HDU 6052 To my boyfriend (计数)
Description Dear Liao I never forget the moment I met with you. You carefully asked me: “I have a very difficult problem. Can you teach me?”. I replied with a smile, “of course”. You replied:”Gi
2017-08-09 15:02:21 392
原创 HDU 6069 Counting Divisors (素数)
Description In mathematics, the function d(n) denotes the number of divisors of positive integer n. For example, d(12)=6d(12)=6 because 1,2,3,4,6,121,2,3,4,6,12 are all 1212 ‘s divisors. In
2017-08-08 11:19:16 349
原创 『图论』LCA 最近公共祖先
转载记得告诉千千哦~同步更新:https://www.dreamwings.cn/lca/4874.html概述篇LCA (Least Common Ancestors) ,即最近公共祖先,是指这样的一个问题:在一棵有根树中,找出某两个节点 u 和 v 最近的公共祖先。 LCA 可分为在线算法与离线算法在线算法:指程序可以以序列化的方式一个一个处理输入,也就是说在一开始并不需要知道所有的输入。离
2017-08-07 19:56:17 4331 6
原创 BZOJ 2440 [中山市选2011]完全平方数 (容斥)
Description 小 X 自幼就很喜欢数。但奇怪的是,他十分讨厌完全平方数。他觉得这些数看起来很令人难受。由此,他也讨厌所有是完全平方数的正整数倍的数。然而这丝毫不影响他对其他数的热爱。 这天是小X的生日,小 W 想送一个数给他作为生日礼物。当然他不能送一个小 X 讨厌的数。他列出了所有小 X 不讨厌的数,然后选取了第 K 个数送给了小 X 。小 X 很开心地收下了。
2017-08-06 20:37:53 470
原创 51nod 1239 欧拉函数之和
描述 对正整数 n ,欧拉函数是小于或等于 n 的数中与 n 互质的数的数目。此函数以其首名研究者欧拉命名,它又称为 Euler’s totient function 、 φ 函数、欧拉商数等。例如:φ(8) = 4(Phi(8) = 4),因为 1,3,5,7 均和 8 互质。 S(n) = Phi(1) + Phi(2) + …… Phi(n),给出n,求S(n),例如:n = 5
2017-08-05 10:33:32 367
原创 51nod 1244 莫比乌斯函数之和
描述 莫比乌斯函数,由德国数学家和天文学家莫比乌斯提出。梅滕斯(Mertens)首先使用μ(n)(miu(n))作为莫比乌斯函数的记号。具体定义如下: 如果一个数包含平方因子,那么miu(n) = 0。例如:miu(4), miu(12), miu(18) = 0。 如果一个数不包含平方因子,并且有k个不同的质因子,那么miu(n) = (-1)^k。例如:miu(2), m
2017-08-04 20:39:57 433
原创 BZOJ 2301 [HAOI2011]Problem b (莫比乌斯反演)
Description 对于给出的 nn 个询问,每次求有多少个数对 (x,y)(x,y) ,满足 a≤x≤b,c≤y≤da≤x≤b,c≤y≤d ,且 gcd(x,y)=k\gcd(x,y) = k ,gcd(x,y)\gcd(x,y) 函数为 xx 和 yy 的最大公约数。 Input 第一行一个整数 nn ,接下来 nn 行每行五个整数,分别表示 a、b、c、d、ka、b、c、d、k
2017-08-04 15:07:42 348
原创 POJ 1681 Painter's Problem (高斯消元)
Description There is a square wall which is made of n×n small square bricks. Some bricks are white while some bricks are yellow. Bob is a painter and he wants to paint all the bricks yellow. But ther
2017-08-02 20:41:41 494
原创 POJ 2154 Color (Polya + 欧拉函数)
Description Beads of N colors are connected together into a circular necklace of N beads (N<=1000000000). Your job is to calculate how many different kinds of the necklace can be produced. You should
2017-08-02 11:47:46 407
原创 HDU 6041 I Curse Myself (仙人掌图)
Description There is a connected undirected graph with weights on its edges. It is guaranteed that each edge appears in at most one simple cycle. Assuming that the weight of a weighted spanning
2017-07-31 21:48:12 517
原创 『数论』乘法逆元
在求解除法取模问题 (a/b)%m(a/b)\%m 时,我们可以转化为 (a%(b×m))/b(a\%(b×m))/b ,但是如果 bb 很大,则会出现爆精度问题,所以我们避免使用除法直接计算。可以使用逆元将除法转换为乘法:假设 bb 存在乘法逆元,即与 mm 互质(充要条件)。设 cc 是 bb 的逆元,即 b×c≡1(mod m)b×c≡1(mod~m)那么有 a/b=(a/b)×1=(a/b)
2017-07-31 11:47:27 645
原创 HDU 3594 Cactus (仙人掌图、Tarjan)
Description It is a Strongly Connected graph. Each edge of the graph belongs to a circle and only belongs to one circle. We call this graph as CACTUS. There is an example as t
2017-07-30 17:05:19 571
原创 HDU 6044 Limited Permutation (组合数+逆元)
Description As to a permutation p1,p2,⋯,pn from 1 to n, it is uncomplicated for each 1≤i≤n to calculate (li,ri) meeting the condition that min(pL,pL+1,⋯,pR)=pi if and only if li≤L≤i≤R≤ri for each 1≤L
2017-07-30 12:54:40 630
原创 HDU 6047 Maximum Sequence (贪心)
Description Steph is extremely obsessed with “sequence problems” that are usually seen on magazines: Given the sequence 11, 23, 30, 35, what is the next number? Steph always finds them too easy for s
2017-07-28 18:16:12 591
原创 HDU 6053 TrickGCD (莫比乌斯函数)
Description You are given an array AA , and Zhu wants to know there are how many different array BB satisfy the following conditions? 1≤Bi≤Ai1≤B_i≤A_i For each pair(l,r) (1≤l≤r≤n)(1≤l≤r≤n)
2017-07-28 14:05:10 929
原创 HDU 6055 Regular polygon (找正方形)
Description On a two-dimensional plane, give you n integer points. Your task is to figure out how many different regular polygon these points can make. Input The input file consists of several tes
2017-07-27 18:37:26 1198
原创 HDU 6050 Funny Function (规律+逆元)
Description Function Fx,yF_{x,y} satisfies: F1,1=F1,2=1F_{1,1}=F_{1,2}=1 F1,i=F1,i−1+2∗F1,i−2 (i>=3)F_{1,i}=F_{1,i-1}+2*F_{1,i-2}\ (i>=3) Fi,j=∑j+N−1k=jFi−1,k (i>=2,j>=1)F_{i,j}=\sum_{
2017-07-27 18:32:07 933 4
原创 HDU 6040 Hints of sd0061 (技巧)
Description sd0061, the legend of Beihang University ACM-ICPC Team, retired last year leaving a group of noobs. Noobs have no idea how to deal with m coming contests. sd0061 has left a set of hints f
2017-07-27 11:25:09 938
原创 codevs 2370 小机房的树 (LCA)
Description 小机房有棵焕狗种的树,树上有N个节点,节点标号为0到N-1,有两只虫子名叫飘狗和大吉狗,分居在两个不同的节点上。有一天,他们想爬到一个节点上去搞基,但是作为两只虫子,他们不想花费太多精力。已知从某个节点爬到其父亲节点要花费 c 的能量(从父亲节点爬到此节点也相同),他们想找出一条花费精力最短的路,以使得搞基的时候精力旺盛,他们找到你要你设计一个程序来找到这条路,要求你告诉
2017-07-27 09:40:03 291
原创 HDU 6035 Colorful Tree (树形dp)
Description There is a tree with n nodes, each of which has a type of color represented by an integer, where the color of node i is ci. The path between each two different nodes is unique, of wh
2017-07-26 20:35:55 559
原创 HDU 6038 Function (数学)
Description You are given a permutation a from 0 to n−1 and a permutation b from 0 to m−1. Define that the domain of function f is the set of integers from 0 to n−1, and the range of it is the s
2017-07-26 14:11:26 1192
原创 HDU 6034 Balala Power! (贪心)
Description Talented Mr.Tang has n strings consisting of only lower case characters. He wants to charge them with Balala Power (he could change each character ranged from a to z into each numbe
2017-07-26 10:54:43 398
原创 codevs 1036 商务旅行 (LCA)
Description 某首都城市的商人要经常到各城镇去做生意,他们按自己的路线去做,目的是为了更好的节约时间。 假设有N个城镇,首都编号为1,商人从首都出发,其他各城镇之间都有道路连接,任意两个城镇之间如果有直连道路,在他们之间行驶需要花费单位时间。该国公路网络发达,从首都出发能到达任意一个城镇,并且公路网络不会存在环。 你的任务是帮助该商人计算一下他的最短旅行时间。 I
2017-07-25 10:23:42 533
原创 POJ 1470 Closest Common Ancestors (LCA)
Description Write a program that takes as input a rooted tree and a list of pairs of vertices. For each pair (u,v) the program determines the closest common ancestor of u and v in the tree. The close
2017-07-24 16:19:38 408
Spig 网站浮动小人 (javascript)
2018-06-17
OICQ 聊天室(Java 课程设计)
2018-06-17
Little Giant (C++ 课程设计)
2018-06-17
Flow blog(数据库课程设计)
2018-06-17
Codeforces Edu Hacking
2018-06-17
HDU 自动 AC 机(Python)
2018-06-17
黑白棋 (Reversi)
2016-10-30
黑客帝国C语言
2016-01-07
VC绘图库Easyx
2016-01-05
C语言一个小小的问题,望解答
2016-01-08
TA创建的收藏夹 TA关注的收藏夹
TA关注的人