- 博客(36)
- 资源 (10)
- 问答 (1)
- 收藏
- 关注
原创 POJ 3254 Corn Fields (状压dp)
Description Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squares.
2017-08-31 21:57:50 258
原创 Codeforces 842 D. Vitya and Strange Lesson (trie)
Description Today at the lesson Vitya learned a very interesting function — mex. Mex of a sequence of numbers is the minimum non-negative number that is not present in the sequence as element. For ex
2017-08-30 16:17:51 1245
原创 Codeforces 842 C. Ilya And The Tree (dfs)
Description Ilya is very fond of graphs, especially trees. During his last trip to the forest Ilya found a very interesting tree rooted at vertex 1. There is an integer number written on each vertex
2017-08-30 13:47:31 910
原创 UPC 1053 Mysterious Treasure (记忆化搜索)
Description WNJXYK and DIDIDI is playing a game. DIDIDI draws a directed graph G on the paper which contains n points, m directed edges and no cycle. WNJXYK starts from point 1. For every round, WNJX
2017-08-27 17:28:22 580 2
原创 POJ 2104 K-th Number (划分树 / 主席树)
Description You are working for Macrohard company in data structures department. After failing your previous task about key insertion you were asked to write a new data structure that would be able t
2017-08-23 18:24:14 412
原创 HDU 6156 Palindrome Function (数位dp)
Description As we all know,a palindrome number is the number which reads the same backward as forward,such as 666 or 747.Some numbers are not the palindrome numbers in decimal form,but in other base,
2017-08-22 21:50:10 433
原创 HDU 6170 Two strings (dp)
Description Giving two strings and you should judge if they are matched. The first string contains lowercase letters and uppercase letters. The second string contains lowercase letters, upp
2017-08-22 19:53:59 1569 9
原创 HDU 6154 CaoHaha's staff (数学)
Description “You shall not pass!” After shouted out that,the Force Staff appered in CaoHaha’s hand. As we all know,the Force Staff is a staff with infinity power.If you can use it skillful,
2017-08-21 21:16:21 400
原创 HDU 6152 Friend-Graph (最大团)
Description It is well known that small groups are not conducive of the development of a team. Therefore, there shouldn’t be any small groups in a good team. In a team with n members,if there ar
2017-08-20 14:59:28 725 2
原创 HDU 6150 Vertex Cover (构造)
Description As we know, minimumvertexcover is a classical NP-complete problem. There will not be polynomial time algorithm for it unless P=NP. You can see the definition of vertex cover in https
2017-08-20 12:42:03 491
原创 HDU 6153 A Secret (扩展KMP)
Description Today is the birthday of SF,so VS gives two strings S1,S2 to SF as a present,which have a big secret.SF is interested in this secret and ask VS how to get it.There are the things that VS
2017-08-20 09:31:20 333
原创 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 346
原创 HDU 6146 Pokémon GO (dp)
Description 众所周知,度度熊最近沉迷于 Pokémon GO。 今天它决定要抓住所有的精灵球! 为了不让度度熊失望,精灵球已经被事先放置在一个2*N的格子上,每一个格子上都有一个精灵球。度度熊可以选择任意一个格子开始游戏,抓捕格子上的精灵球,然后移动到一个相邻的至少有一个公共点的格子上继续抓捕。例如,(2, 2) 的相邻格子有(1, 1), (2, 1
2017-08-18 21:22:33 900
原创 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 1583 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 426
原创 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 333
原创 BZOJ 2038 小Z的袜子 (莫队算法)
Description 作为一个生活散漫的人,小Z 每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小Z 再也无法忍受这恼人的找袜子过程,于是他决定听天由命…… 具体来说, 小Z 把这 N 只袜子从 1 到 N 编号,然后从编号 L 到 R ( L 尽管 小Z 并不在意两只袜子是不是完整的一双,甚至不在意两只袜子是否一左一右,他却很在意袜子的颜色,毕竟穿两只不同色的
2017-08-16 11:52:45 369
原创 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 506
原创 HDU 6119 小小粉丝度度熊 (枚举 + 二分)
Description 度度熊喜欢着喵哈哈村的大明星——星星小姐。 为什么度度熊会喜欢星星小姐呢? 首先星星小姐笑起来非常动人,其次星星小姐唱歌也非常好听。 但这都不是最重要的,最重要的是,星星小姐拍的一手好代码! 于是度度熊关注了星星小姐的贴吧。 一开始度度熊决定每天都在星星小姐的贴吧里面签到。 但是度度熊是一个非常健忘的孩子,总有那
2017-08-14 11:22:56 471
原创 HDU 6118 度度熊的交易计划 (最小费用最大流)
Description 度度熊参与了喵哈哈村的商业大会,但是这次商业大会遇到了一个难题: 喵哈哈村以及周围的村庄可以看做是一共由n个片区,m条公路组成的地区。 由于生产能力的区别,第i个片区能够花费a[i]元生产1个商品,但是最多生产b[i]个。 同样的,由于每个片区的购买能力的区别,第i个片区也能够以c[i]的价格出售最多d[i]个物品。 由于这些因素,
2017-08-13 19:55:20 1221
原创 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 1425
原创 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 399
原创 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 509
原创 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 337
原创 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 1338 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 377
原创 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 504
原创 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 375
原创 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 334
原创 『图论』LCA 最近公共祖先
转载记得告诉千千哦~同步更新:https://www.dreamwings.cn/lca/4874.html概述篇LCA (Least Common Ancestors) ,即最近公共祖先,是指这样的一个问题:在一棵有根树中,找出某两个节点 u 和 v 最近的公共祖先。 LCA 可分为在线算法与离线算法在线算法:指程序可以以序列化的方式一个一个处理输入,也就是说在一开始并不需要知道所有的输入。离
2017-08-07 19:56:17 4247 6
原创 BZOJ 2440 [中山市选2011]完全平方数 (容斥)
Description 小 X 自幼就很喜欢数。但奇怪的是,他十分讨厌完全平方数。他觉得这些数看起来很令人难受。由此,他也讨厌所有是完全平方数的正整数倍的数。然而这丝毫不影响他对其他数的热爱。 这天是小X的生日,小 W 想送一个数给他作为生日礼物。当然他不能送一个小 X 讨厌的数。他列出了所有小 X 不讨厌的数,然后选取了第 K 个数送给了小 X 。小 X 很开心地收下了。
2017-08-06 20:37:53 453
原创 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 354
原创 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 409
原创 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 327
原创 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 466
原创 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 393
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关注的人