
hdu
DATELOST
I'm curious.
展开
-
HDU-1715 大数 矩阵快速幂
Problem DescriptionFibonacci数列,定义如下:f(1)=f(2)=1f(n)=f(n-1)+f(n-2) n>=3计算第n项Fibonacci数值。Input输入第一行为一个整数N,接下来N行为整数Pi(1<=Pi<=1000)Output输出为N行,每行为对应的f(Pi)。Sample Input512345Sampl...原创 2019-03-02 12:28:44 · 207 阅读 · 0 评论 -
HDU-1565 网络流最小割
Problem Description给你一个nn的格子的棋盘,每个格子里面有一个非负数。从中取出若干个数,使得任意的两个数所在的格子没有公共边,就是说所取的数所在的2个格子不能相邻,并且取出的数的和最大。Input包括多个测试实例,每个测试实例包括一个整数n 和nn个非负数(n<=20)Output对于每个测试实例,输出可能取得的最大的和Sample Input375 1...原创 2019-03-25 23:33:15 · 200 阅读 · 0 评论 -
HDU-1150 网络流最小割/最小点覆盖/最大匹配
Problem DescriptionAs we all know, machine scheduling is a very classical problem in computer science and has been studied for a very long history. Scheduling problems differ widely in the nature of ...原创 2019-03-26 23:12:44 · 190 阅读 · 0 评论 -
HDU-3746 KMP求循环节
Problem DescriptionCC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there are only 99.9 yuan left. he is too distressed and t...原创 2019-04-22 22:02:14 · 130 阅读 · 0 评论 -
HDU-4135 容斥
Problem DescriptionGiven a number N, you are asked to count the number of integers between A and B inclusive which are relatively prime to N.Two integers are said to be co-prime or relatively prime ...原创 2019-05-08 21:15:39 · 108 阅读 · 0 评论 -
HDU-3949 线性基Kth
Problem DescriptionXOR is a kind of bit operator, we define that as follow: for two binary base number A and B, let C=A XOR B, then for each bit of C, we can get its value by check the digit of corre...原创 2019-04-30 22:32:09 · 228 阅读 · 0 评论 -
HDU-2138 Miller_Rabin算法
Problem DescriptionGive you a lot of positive integers, just to find out how many prime numbers there are.InputThere are a lot of cases. In each case, there is an integer N representing the number ...原创 2019-05-09 11:29:40 · 125 阅读 · 0 评论 -
HDU-5391 威尔逊定理
Problem DescriptionTina Town is a friendly place. People there care about each other.Tina has a ball called zball. Zball is magic. It grows larger every day. On the first day, it becomes 1 time as l...原创 2019-05-09 12:14:32 · 184 阅读 · 0 评论 -
HDU-3864 Pollar_Rho算法
Problem DescriptionOregon Maple was waiting for Bob When Bob go back home. Oregon Maple asks Bob a problem that as a Positive number N, if there are only four Positive number M makes Gcd(N, M) == M t...原创 2019-05-09 14:37:01 · 262 阅读 · 0 评论 -
HDU-1402 FFT
Problem DescriptionCalculate A * B.InputEach line will contain two integers A and B. Process to end of file.Note: the length of each integer will not exceed 50000.OutputFor each case, output A *...原创 2019-05-19 22:41:10 · 135 阅读 · 0 评论 -
HDU-3572 网络流建图
Problem DescriptionOur geometry princess XMM has stoped her study in computational geometry to concentrate on her newly opened factory. Her factory has introduced M new machines in order to process t...原创 2019-03-24 21:43:18 · 214 阅读 · 0 评论 -
HDU-1698 线段树 区间修改
Problem DescriptionIn the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same ...原创 2019-03-14 23:33:12 · 185 阅读 · 0 评论 -
HDU-1754 zkw线段树 单点更新 最大值
Problem Description很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处理到文件结束。在每个测试的第一行,有两个正整数 N 和 M ( 0&lt;N&lt;...原创 2019-03-03 22:53:06 · 209 阅读 · 0 评论 -
HDU-1051 贪心 vector.erase
Problem DescriptionThere is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking machine in one by one fashion. It need...原创 2019-03-06 22:19:56 · 114 阅读 · 0 评论 -
HDU-1394 zkw线段树 逆序数
Problem DescriptionThe inversion number of a given number sequence a1, a2, …, an is the number of pairs (ai, aj) that satisfy i &amp;lt; j and ai &amp;gt; aj.For a given sequence of numbers a1, a2, …, an, i...原创 2019-03-04 15:51:02 · 171 阅读 · 0 评论 -
HDU-4496 并查集 逆向加边
Problem DescriptionLuxer is a really bad guy. He destroys everything he met.One day Luxer went to D-city. D-city has N D-points and M D-lines. Each D-line connects exactly two D-points. Luxer will d...原创 2019-03-09 20:58:48 · 223 阅读 · 0 评论 -
HDU-3018 并查集 欧拉回路
Problem DescriptionAnt Country consist of N towns.There are M roads connecting the towns.Ant Tony,together with his friends,wants to go through every part of the country.They intend to visit every ...原创 2019-03-08 18:01:14 · 176 阅读 · 0 评论 -
HDU-1043 逆向bfs 打表
Problem DescriptionThe 15-puzzle has been around for over 100 years; even if you don’t know it by that name, you’ve seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 o...原创 2019-03-11 23:03:24 · 252 阅读 · 0 评论 -
HDU-2444 判断二分图,最大匹配
Problem DescriptionThere are a group of students. Some of them may know each other, while others don’t. For example, A and B know each other, B and C know each other. But this may not imply that A an...原创 2019-03-16 23:37:22 · 141 阅读 · 0 评论 -
HDU-6460 矩阵快速幂 含幂项 二项展开
Problem DescriptionFarmer John有n头奶牛.某天奶牛想要数一数有多少头奶牛,以一种特殊的方式:第一头奶牛为1号,第二头奶牛为2号,第三头奶牛之后,假如当前奶牛是第n头,那么他的编号就是2倍的第n-2头奶牛的编号加上第n-1头奶牛的编号再加上自己当前的n的三次方为自己的编号.现在Farmer John想知道,第n头奶牛的编号是多少,估计答案会很大,你只要输出答案对...原创 2019-03-17 13:54:13 · 632 阅读 · 0 评论 -
HDU-1532 网络流
Problem DescriptionEvery time it rains on Farmer John’s fields, a pond forms over Bessie’s favorite clover patch. This means that the clover is covered by water for awhile and takes quite a long time...原创 2019-03-24 18:55:59 · 182 阅读 · 0 评论 -
HDU-3068 最长回文 Hash
Problem Description给出一个只由小写英文字符a,b,c…y,z组成的字符串S,求S中最长回文串的长度.回文就是正反读都是一样的字符串,如aba, abba等Input输入有多组case,不超过120组,每组输入为一行小写英文字符a,b,c…y,z组成的字符串S两组case之间由空行隔开(该空行不用处理)字符串长度len <= 110000Output每一行一...原创 2019-07-14 21:43:35 · 138 阅读 · 0 评论 -
HDU-1880 Hash +STL
Problem Description哈利波特在魔法学校的必修课之一就是学习魔咒。据说魔法世界有100000种不同的魔咒,哈利很难全部记住,但是为了对抗强敌,他必须在危急时刻能够调用任何一个需要的魔咒,所以他需要你的帮助。给你一部魔咒词典。当哈利听到一个魔咒时,你的程序必须告诉他那个魔咒的功能;当哈利需要某个功能但不知道该用什么魔咒时,你的程序要替他找到相应的魔咒。如果他要的魔咒不在词典中,就...原创 2019-07-15 21:04:34 · 117 阅读 · 0 评论 -
HDU-3966 树链剖分 树状数组 点权
Problem DescriptionOur protagonist is the handsome human prince Aragorn comes from The Lord of the Rings. One day Aragorn finds a lot of enemies who want to invade his kingdom. As Aragorn knows, the ...原创 2019-07-21 21:59:51 · 185 阅读 · 0 评论 -
HDU-2586 倍增lca
Problem DescriptionThere are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this “How far is it if I want to go from house A to house B”...原创 2019-07-26 22:41:55 · 122 阅读 · 0 评论 -
HDU-4699 对顶栈
Sample Input8I 2I -1I 1Q 3LDRQ 2Sample Output23一个栈存光标前的,一个存光标后的#include<bits/stdc++.h>using namespace std;const int N=1e6+6;stack<int>a,b;char op;int c,p,n;int sum[N],...原创 2019-07-31 22:29:49 · 180 阅读 · 0 评论 -
HDU-1237 中缀表达式转后缀表达式 后缀表达式求值
中缀表达式转后缀表达式 :扫描中缀表达式:1.数字,直接输出2.左括号,左括号入栈3.右括号,不断取栈顶并输出,直到栈顶为左括号,最后左括号出栈4.运算符,不断取栈顶并输出,直栈顶优先级高于此运算符,最后新运算符入栈后缀表达式求值:扫描后缀表达式:1.数字,入栈2.运算符,取出栈顶两个数,运算,结果入栈3.最后栈里剩下的一个数即为答案#include<iostream&...原创 2019-08-01 23:10:41 · 173 阅读 · 0 评论 -
HDU-3007 最小圆覆盖
Problem DescriptionEach person had do something foolish along with his or her growth.But,when he or she did this that time,they could not predict that this thing is a mistake and they will want this ...原创 2019-09-19 13:17:06 · 228 阅读 · 0 评论 -
HDU-6535 计算几何 辛普森积分
Problem DescriptionChika has just learned about solid geometry! She is very interested in the volume of three-dimensional geometric shapes, so she decides to test you.Before that, she is going to te...原创 2019-09-22 21:01:00 · 337 阅读 · 0 评论 -
HDU-6242 随机rand()
Problem DescriptionAlice is interesting in computation geometry problem recently. She found a interesting problem and solved it easily. Now she will give this problem to you :You are given N distinc...原创 2019-09-24 21:07:19 · 159 阅读 · 0 评论 -
HDU-3692 三维几何,二维凸包
Problem DescriptionOn the planet Pandora, huge rocks are floating in the sky. Despite the beautiful scenery, these rocks bring some critical problem: they block the sunshine, and shade on the ground....原创 2019-09-26 20:01:25 · 188 阅读 · 0 评论 -
HDU-4449 三维凸包 平面投影 三维坐标转二维坐标 二维凸包
Problem DescriptionYou are a notable architect.Recently, a company invites you to design their new building for them. It is not an easy task, because they make some strange claims to the new buildin...原创 2019-09-27 20:40:50 · 348 阅读 · 0 评论 -
HDU-3998 网络流 拆点
Problem DescriptionThere is a sequence X (i.e. x[1], x[2], …, x[n]). We define increasing subsequence of Xas x[i1], x[i2],…,x[ik], which satisfies follow conditions:x[i1] < x[i2],…,<x[ik];1...原创 2019-07-30 18:27:06 · 144 阅读 · 0 评论 -
HDU-1950 最长上升 二维偏序
最长上升#include<bits/stdc++.h>using namespace std;const int N=4e4+4;int bit[N],a[N],b[N],n;//bit[i]存以i结尾的最长上升长度,a,b分别为第1,2维偏序,二维偏序inline int lowbit(int x){return x&-x;}inline int add(int ...原创 2019-07-21 13:14:48 · 216 阅读 · 0 评论 -
HDU-1251 Trie
Problem DescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分是一连串的提问,每行一个提...原创 2019-07-18 20:10:05 · 98 阅读 · 0 评论 -
HDU-2222 AC自动机
Problem DescriptionIn the modern time, Search engine came into the life of everybody like Google, Baidu, etc.Wiskey also wants to bring this feature to his image retrieval system.Every image have a...原创 2019-07-18 23:46:10 · 118 阅读 · 0 评论 -
HDU-2896 AC自动机
Problem Description当太阳的光辉逐渐被月亮遮蔽,世界失去了光明,大地迎来最黑暗的时刻。。。。在这样的时刻,人们却异常兴奋——我们能在有生之年看到500年一遇的世界奇观,那是多么幸福的事儿啊但网路上总有那么些网站,开始借着民众的好奇心,打着介绍日食的旗号,大肆传播病毒。小t不幸成为受害者之一。小t如此生气,他决定要把世界上所有带病毒的网站都找出来。当然,谁都知道这是不可能的。小...原创 2019-07-19 00:39:33 · 120 阅读 · 0 评论 -
HDU-2767 tarjan缩点
InputOn the first line one positive number: the number of testcases, at most 100. After that per testcase:One line containing two integers n (1 ≤ n ≤ 20000) and m (0 ≤ m ≤ 50000): the number of sta...原创 2019-07-28 23:08:49 · 164 阅读 · 0 评论 -
HDU-1827 tarjan缩点
Problem Description听说lcy帮大家预定了新马泰7日游,Wiskey真是高兴的夜不能寐啊,他想着得快点把这消息告诉大家,虽然他手上有所有人的联系方式,但是一个一个联系过去实在太耗时间和电话费了。他知道其他人也有一些别人的联系方式,这样他可以通知其他人,再让其他人帮忙通知一下别人。你能帮Wiskey计算出至少要通知多少人,至少得花多少电话费就能让所有人都被通知到吗?Input...原创 2019-07-29 09:41:06 · 126 阅读 · 0 评论 -
HDU-1166 分块
Input第一行一个整数T,表示有T组数据。每组数据第一行一个正整数N(N<=50000),表示敌人有N个工兵营地,接下来有N个正整数,第i个正整数ai代表第i个工兵营地里开始时有ai个人(1<=ai<=50)。接下来每行有一条命令,命令有4种形式:(1) Add i j,i和j为正整数,表示第i个营地增加j个人(j不超过30)(2)Sub i j ,i和j为正整数,表...原创 2019-07-19 18:55:08 · 255 阅读 · 0 评论