07 2018 档案
摘要:链接:http://acm.hdu.edu.cn/showproblem.php?pid=6331 Walking Plan Problem Description There are n intersections in Bytetown, connected with m one way str
阅读全文
摘要:链接:http://acm.hdu.edu.cn/showproblem.php?pid=6325 Interstellar Travel Problem Description After trying hard for many years, Little Q has finally recei
阅读全文
摘要:Little Q and Little T are playing a game on a tree. There are n vertices on the tree, labeled by 1,2,...,n , connected by n−1 bidirectional edges. The
阅读全文
摘要:链接:http://acm.hdu.edu.cn/showproblem.php?pid=6322 Problem Description In number theory, Euler's totient function φ(n) counts the positive integers up
阅读全文
摘要:有一棵由N个结点构成的树,每一条边上都有其对应的权值。现在给定起点,求从该点出发的一条路径(至少有一条边)使得这条路径上的权值之和最大,并输出这个最大值。 Input 第一行一个正整数T,代表数据组数。每组数据第一行两个正整数n(2<=n<=10^5),s(1<=s<=n),分别表示树结点数目以及给
阅读全文
摘要:链接:http://codeforces.com/contest/401/problem/D 题意:给出一个数字num和m,问通过重新排列num中的各位数字中有多少个数(mod m)=0,直接枚举全排列肯定不行,可以用状压dp来搞.. dp[S][k]表示选了num中的S且(mod m)=k的方案种
阅读全文
摘要:Input: standard inputOutput: standard output Time Limit: 2 seconds The small sawmill in Mission, British Columbia, has developed a brand new way of pa
阅读全文
摘要:1 A*算法 A*算法在人工智能中是一种典型的启发式搜索算法,启发中的估价是用估价函数表示的: 其中f(n)是节点n的估价函数,g(n)表示实际状态空间中从初始节点到n节点的实际代价,h(n)是从n到目标节点最佳路径的估计代价。另外定义h'(n)为n到目标节点最佳路径的实际值。如果h'(n)≥h(n
阅读全文
摘要:喜马拉雅山上的猴子Time Limit: 1000 MS Memory Limit: 256 MBSubmit Status余周周告诉我喜马拉雅山上有猴子,他们知道点石成金的方法。我不信,于是余周周带我去喜马拉雅山拜访猴子。喜马拉雅山上有n个猴子聚落,不妨叫...
阅读全文
摘要:Weiwei is a software engineer of ShiningSoft. He has just excellently fulfilled a software project with his fellow workers. His boss i...
阅读全文
摘要:Since 1945, when the first nuclear bomb was exploded by the Manhattan Project team in the US, the number of nuclear weapons have soar...
阅读全文
摘要:Marica is very angry with Mirko because he found a new girlfriend and she seeks revenge.Since she doesn't live in the same city, she started preparing
阅读全文
摘要:杭州有N个景区,景区之间有一些双向的路来连接,现在8600想找一条旅游路线,这个路线从A点出发并且最后回到A点,假设经过的路线为V1,V2,....VK,V1,那么必须满足K>2,就是说至除了出发点以外至少要经过2个其他不同的景区,而且不能重复经过同一个景区。现在86...
阅读全文
摘要:Arbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the sa...
阅读全文
摘要:oooccc1 is a Software Engineer who has to ride to the work place every Monday through Friday. For a long period, he went to office w...
阅读全文
摘要:Henry decides to develop a web site, which will provide the service of transit search. But he can only get the transit data of Guangzh...
阅读全文
摘要:A group of thieves is approaching a museum in the country of zjsxzy,now they are in city A,and the museum is in city B,where keeps man...
阅读全文
摘要:You have been given a matrix C N*M, each element E of C N*M is positive and no more than 1000, The problem is that if there exist N nu...
阅读全文
摘要:Ali has taken the Computer Organization and Architecture course this term. He learned that there may be dependence between instruction...
阅读全文
摘要:Liyuan wanted to rewrite the famous book “Journey to the West” (“Xi You Ji” in Chinese pinyin). In the original book, the Monkey King ...
阅读全文
摘要:F. Xor-Pathstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere is a rectangul...
阅读全文
摘要:A supermarket in Tehran is open 24 hours a day every day and needs a number of cashiers to fit its need. The supermarket manager has h...
阅读全文
摘要:It is well known that, in the period of The Three Empires, Liu Bei, the emperor of the Shu Empire, was defeated by Lu Xun, a general of the Wu Empire.
阅读全文
摘要:You are given n closed, integer intervals [ai, bi] and n integers c1, ..., cn. Write a program that: > reads the number of intervals, their endpoints
阅读全文
摘要:命运石之门Time Limit: 1000 MS Memory Limit: 256 MBSubmit Status“这一切都是命运石之门的选择!“凶真博士发明了能够逆转时间的电话微波炉,也就是微型时光机。每次时光机开机时,时光机顶部的数字屏上会随机显示一个数...
阅读全文
摘要:Chiaki often participates in international competitive programming contests. The time zone becomes a big problem. Given a time in Beij...
阅读全文
摘要:hiaki has an array of nn positive integers. You are told some facts about the array: for every two elements aiai and ajaj in the subar...
阅读全文
摘要:Chiaki has 3n3n points p1,p2,…,p3np1,p2,…,p3n. It is guaranteed that no three points are collinear. Chiaki would like to construct nn ...
阅读全文
摘要:Given an integer nn, Chiaki would like to find three positive integers xx, yy and zzsuch that: n=x+y+zn=x+y+z, x∣nx∣n, y∣ny∣n, z∣nz∣n ...
阅读全文
摘要:You surely have never heard of this new planet surface exploration scheme, as it is being carried out in a project with utmost secrecy...
阅读全文
摘要:Senior Pan fails in his discrete math exam again. So he asks Master ZKC to give him graph theory problems everyday. The task is simple...
阅读全文
摘要:LsF is visiting a local amusement park with his friends, and a mirror room successfully attracts his attention. Inside the mirror room...
阅读全文
摘要:Giving two strings and you should judge if they are matched. The first string contains lowercase letters and uppercase letters. The se...
阅读全文
摘要:zk has n numbers a1,a2,...,ana1,a2,...,an. For each (i,j) satisfying 1≤iusing namespace std;const int maxn=1e5+5;int n,m;vector a,b,c...
阅读全文
摘要:At Valentine's eve, Shylock and Lucar were enjoying their time as any other couples. Suddenly, LSH, Boss of FFF Group caught both of t...
阅读全文
摘要:Mr. Cui is working off-campus and he misses his girl friend very much. After a whole night tossing and turning, he decides to get to h...
阅读全文
摘要:You are given a complete binary tree with n nodes. The root node is numbered 1, and node x's father node is ⌊x/2⌋⌊x/2⌋. At the beginning, node x has a
阅读全文
摘要:You are to find all the two-word compound words in a dictionary. A two-word compound word is a word in the dictionary that is the conc...
阅读全文
摘要:Now our hero finds the door to the BEelzebub feng5166. He opens the door and finds feng5166 is about to kill our pretty Princess. But ...
阅读全文
摘要:Misha hacked the Codeforces site. Then he decided to let all the users change their handles. A user can now change his handle any numb...
阅读全文
摘要:Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ... shows the first ...
阅读全文
摘要:Many areas of Computer Science use simple, abstract domains for both analytical and empirical studies. For example, an early AI study ...
阅读全文
摘要:Raju and Meena love to play with Marbles. They have got a lot of marbles with numbers written on them. At the beginning, Raju would pl...
阅读全文
摘要:The gaming company Sandstorm is developing an online two player game. You have been asked to implement the ranking system. All players...
阅读全文
摘要:一、引例 1、一类不等式组的解 二、最短路 1、Dijkstra 2、图的存储 3、链式前向星 4、Dijkstra + 优先队列 5、Bellman-Ford 6、SPFA 7、Floyd-Warshall 三、差分约束 1、数形结合 2、三角不等式 3、解的存在性 4、最大值 => 最小值 5、
阅读全文
摘要:E. Military Problem time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output In this problem you
阅读全文
摘要:E. Military Problemtime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn this probl...
阅读全文
摘要:D. Two Strings Swapstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are give...
阅读全文
摘要:C. Three Parts of the Arraytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou ar...
阅读全文
摘要:B. Polycarp's Practicetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp i...
阅读全文
摘要:A. Adjacent Replacementstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMishka go...
阅读全文
摘要:咸鱼咕咕咕Time Limit: 1000 MS Memory Limit: 64 MBSubmit Status咸鱼有个咕咕笼。咕咕笼可以划分成m×nm×n个格子,每个小格子可以放下一只咕咕,也可以放下一个咕咕槽。现在咕咕笼里有若干只咕咕。放在咕咕笼里的咕咕...
阅读全文
摘要:F. Isomorphic Stringstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are giv...
阅读全文
摘要:G. Team Playerstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are nn play...
阅读全文
摘要:咸鱼睡觉觉 Time Limit: 1000 MS Memory Limit: 64 MB Submit Status 咸鱼要睡觉觉了! 但那群咕咕有点烦。 咸鱼决定要赶走一些咕咕,使得他们不要这么吵。 那kk只咕咕们排成了一列。 咸鱼做出了nn个决定,第ii个决定是要在第aiai只咕咕到第bibi
阅读全文
摘要:咸鱼睡觉觉Time Limit: 1000 MS Memory Limit: 64 MBSubmit Status咸鱼要睡觉觉了!但那群咕咕有点烦。咸鱼决定要赶走一些咕咕,使得他们不要这么吵。那kk只咕咕们排成了一列。咸鱼做出了nn个决定,第ii个决定是要在第...
阅读全文
摘要:You are given an undirected graph with weighted edges. The length of some path between two vertices is the bitwise xor of weights of all edges belongi
阅读全文
摘要:You are given an undirected graph with weighted edges. The length of some path between two vertices is the bitwise xor of weights of a...
阅读全文
摘要:弗吉桑Time Limit: 3000 MS Memory Limit: 64 MBSubmit Status弗吉桑是一座横跨清水河大草原的活火山,位于子科技大学主楼东北方约 80km 处,主峰海拔 3776m , 2002 年 8 月经电子科大校土局重新测量...
阅读全文
摘要:M - 图书馆Time Limit: 2000 MS Memory Limit: 256 MBSubmit Status电子科技太学图书馆创建于1956年,馆舍总面积66974平方米,各类阅览室37个,阅览座位10023个(含在建新馆),馆藏总量371.8万册...
阅读全文
摘要:查找第k大Submit Page Summary Time Limit: 1 Sec Memory Limit: 128 Mb Submitted: 316 Solved: 20 Description小W有很强的好胜心,也有...
阅读全文
摘要:Barareh on Fire Submit Page Summary Time Limit: 3 Sec Memory Limit: 512 Mb Submitted: 102 Solved: 48 Description The Barareh village is on fire due to
阅读全文
摘要:Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 16142 Accepted: 7305 Description A Telephone Line Company (TLC) is establishing a new telep
阅读全文
摘要:By Recognizing These Guys, We Find Social Networks Useful Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 125536/65536 K (Java/Others)Total Submi
阅读全文
摘要:割顶和桥:对于无向图G,如果删除某个节点u后,连通分量数目增加,则称u为图的割顶;如果删除某条边后,连通分量数目增加,则称该边为图的桥。对于连通图删除割顶或桥后都会使得图不再连通 以下我,我们利用dfs的性质来快速找出一个连通图中的所有的割顶和桥 首先我们要引入”时间戳”这个概念: 时间戳:表示在进
阅读全文
摘要:励志的猴子Time Limit: 1000 MS Memory Limit: 256 MBSubmit Status上图是2013南京亚青会吉祥物圆圆。自从它诞生以来,它就被吐槽为最丑吉祥物。即使如此,它仍然坚强的活着,并且……它还学会了人类的坐标系、画画和数...
阅读全文
摘要:北极的猴子 Time Limit: 1000 MS Memory Limit: 256 MB Submit Status 也许你不知道,在北极也有猴子,我们叫它们北极猴。北极猴们在北极一共有n个聚落,不妨叫它们1,2,…n号聚落;它们之间有m条双向道路(这意味着如果一条路从1号聚落到2号聚落,那么你
阅读全文
摘要:天才钱vs学霸周2Time Limit: 500 MS Memory Limit: 128 MBSubmit Status由于上次的游戏中学霸周输了,因此学霸周想出个问题为难天才钱,问题是这样的,有一个n×mn×m的矩阵,每一个格子中有一个整数,周大爷给出了数...
阅读全文
摘要:天才钱vs学霸周Time Limit: 1000 MS Memory Limit: 256 MBSubmit Status有一天,天才钱和学霸周闲的无聊玩起了游戏,游戏内容是这样的,现在有nn个城堡 mm个不同的桥,每一个桥连接着两个不同的城堡,并且已知这mm...
阅读全文
摘要:学霸周选课Time Limit: 1000 MS Memory Limit: 128 MBSubmit Status众所周知周大爷不仅编程了得,专业课成绩更是名列前茅,恰巧又到了选课的季节,神秘的zin作为周大爷的好朋(基)友,给了周大爷一份课表,这个课 表和...
阅读全文