
acm
W-Jarvis
这个作者很懒,什么都没留下…
展开
-
产生冠军
Problem Description有一群人,打乒乓球比赛,两两捉对撕杀,每两个人之间最多打一场比赛。球赛的规则如下:如果A打败了B,B又打败了C,而A与C之间没有进行过比赛,那么就认定,A一定能打败C。如果A打败了B,B又打败了C,而且,C又打败了A,那么A、B、C三者都不可能成为冠军。根据这个规则,无需循环较量,或许就能确定冠军。你的任务就是面对一群比赛选手,在经过了若干转载 2017-05-15 21:36:01 · 198 阅读 · 0 评论 -
Arctic Network UVA - 10369
The Department of National Defence(DND) wishes to connect severalnorthern outposts by a wirelessnetwork. Two different communicationtechnologies are to beused in establishing the network:every outpost原创 2017-10-07 18:51:30 · 223 阅读 · 0 评论 -
ACM Contest and Blackout UVA - 10600
In order to prepare the “The First National ACM School Contest” (in 20??) the major of the citydecided to provide all the schools with a reliable source of power. (The major is really afraid ofblackou原创 2018-05-09 19:51:15 · 252 阅读 · 0 评论 -
Palindrome 简单(dp)poj1159
DescriptionA palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a program which, given a string, determines t原创 2017-11-16 20:29:09 · 222 阅读 · 0 评论 -
A - Max Sum HDU - 1003 (dp)
A - Max Sum HDU - 1003Time limit1000 msMemory limit32768 kBOSWindows Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the m原创 2017-11-19 20:34:09 · 188 阅读 · 0 评论 -
Max Sum Plus Plus HDU - 1024(dp)
Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now you are faced with a more difficult problem. Gi原创 2017-11-19 20:55:11 · 301 阅读 · 0 评论 -
求数组的最长递减子序列 (dp)
1000ms 65536K给定一个整数序列,输出它的最长递减(注意不是“不递增”)子序列。输入包括两行,第一行包括一个正整数N(N输出为一行,最长递减子序列的结果,数字间用空格分隔(测试case中只会有一个最长递减子序列)。样例输入89 4 3 2 5 4 3 2样例输出9 5 4 3 2#include#includeu原创 2017-10-29 09:11:43 · 786 阅读 · 0 评论 -
度度熊与邪恶大魔王(dp)
度度熊与邪恶大魔王Accepts: 2395Submissions: 14900Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Problem Description度度熊为了拯救可爱的公主,于是与邪恶大魔王战斗起来。邪恶大魔原创 2017-11-22 17:03:35 · 290 阅读 · 0 评论 -
最佳路线,最短路径
#include <iostream>#include<algorithm>#include<cstring>using namespace std;int T,N,M,K,A,S,u,v,w,h[1001],k[1001],p[1001][1001],t[1001][1001],d[1001][1001],dis[1001],b[1001][1001]...原创 2018-03-10 17:23:43 · 374 阅读 · 0 评论 -
约数个数
链接:https://www.nowcoder.com/acm/contest/82/A来源:牛客网题目描述t次询问,每次给你一个数n,求在[1,n]内约数个数最多的数的约数个数 输入描述:第一行一个正整数t之后t行,每行一个正整数n输出描述:输出t行,每行一个整数,表示答案示例1输入513911316输出64166备原创 2018-03-31 16:06:00 · 453 阅读 · 0 评论 -
Car HDU - 5935
Ruins is driving a car to participating in a programming contest. As on a very tight schedule, he will drive the car without any slow down, so the speed of the car is non-decrease real number. Of cour...原创 2018-05-09 19:28:38 · 187 阅读 · 0 评论 -
Difference HDU - 5936
Little Ruins is playing a number game, first he chooses two positive integers yy and KK and calculates f(y,K)f(y,K), here f(y,K)=∑z in every digits of yzK(f(233,2)=22+32+32=22)f(y,K)=∑z in原创 2018-05-09 19:42:02 · 244 阅读 · 0 评论 -
Four Operations HDU - 5938
Little Ruins is a studious boy, recently he learned the four operations! Now he want to use four operations to generate a number, he takes a string which only contains digits '1' - '9', and split it i...原创 2018-05-09 19:44:07 · 202 阅读 · 0 评论 -
Slim Span UVA - 1395
Given an undirected weighted graph G, youshould find one of spanning trees specified as follows.The graph G is an ordered pair (V, E), whereV is a set of vertices {v1, v2, . . . , vn} and E is aset of原创 2017-10-07 18:49:05 · 259 阅读 · 0 评论 -
继续畅通工程 HDU - 1879
省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。现得到城镇道路统计表,表中列出了任意两城镇间修建道路的费用,以及该道路是否已经修通的状态。现请你编写程序,计算出全省畅通需要的最低成本。 Input测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N ( 1当N为0时输入结束。Output每个测原创 2017-10-07 16:30:51 · 202 阅读 · 0 评论 -
放苹果
把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。Input第一行是测试数据的数目t(0 Output对输入的每组数据M和N,用一行输出相应的K。Sample Input17 3Sample Output8这是我自己写的还没交过,不知道对不对;#i转载 2017-05-14 20:33:18 · 175 阅读 · 0 评论 -
走格子
有编号1-n的n个格子,机器人从1号格子顺序向后走,一直走到n号格子,并需要从n号格子走出去。机器人有一个初始能量,每个格子对应一个整数Aii,表示这个格子的能量值。如果Aii > 0,机器人走到这个格子能够获取Aii个能量,如果Aii < 0,走到这个格子需要消耗相应的能量,如果机器人的能量 < 0,就无法继续前进了。问机器人最少需要有多少初始能量,才能完成整个旅程。例如:n转载 2017-05-15 21:52:14 · 346 阅读 · 0 评论 -
数字1的数量
给定一个十进制正整数N,写下从1开始,到N的所有正数,计算出其中出现所有1的个数。例如:n = 12,包含了5个1。1,10,12共包含3个1,11包含2个1,总共5个1。Input输入N(1 Output输出包含1的个数Sample Input12Sample Output5#include#includeint main(){ lon转载 2017-05-15 21:55:11 · 1106 阅读 · 0 评论 -
大数乘法
给出2个大整数A,B,计算A*B的结果。Input第1行:大数A 第2行:大数B (A,B的长度 = 0)Output输出A * BSample Input123456234567Sample Output28958703552#include#includeint c[1000001];int main(){ char a转载 2017-05-15 21:57:07 · 401 阅读 · 0 评论 -
Jinixin's password
Time Limit: 1 Sec Memory Limit: 128 MBDescriptionGod of Jinixin is a great god that his IQ is at the top of his team. In his computer,there are many things that he is learning. Every day, he thr转载 2017-05-17 20:05:20 · 326 阅读 · 0 评论 -
Eqs POJ - 1840
Consider equations having the following form: a1x1 3+ a2x2 3+ a3x3 3+ a4x4 3+ a5x5 3=0 The coefficients are given integers from the interval [-50,50]. It is consider a solution a system (x1, x2,转载 2017-06-12 17:55:54 · 348 阅读 · 0 评论 -
- 敌兵布阵 HDU - 1166
C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。 中央情报局要研究敌人究竟演习什么战术,原创 2017-10-07 16:16:24 · 160 阅读 · 0 评论 -
Agri-Net POJ - 1258
Farmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs your help, of course.Farmer John ordered a high spe原创 2017-10-07 16:19:49 · 165 阅读 · 0 评论 -
Jungle Roads POJ - 1251
The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle overtakes roads relentlessly, so原创 2017-10-07 16:22:51 · 148 阅读 · 0 评论 -
The Unique MST POJ - 1679
Given a connected undirected graph, tell if its minimum spanning tree is unique. Definition 1 (Spanning Tree): Consider a connected, undirected graph G = (V, E). A spanning tree of G is a subgraph原创 2017-10-07 16:24:34 · 146 阅读 · 0 评论 -
Truck History POJ - 1789
Advanced Cargo Movement, Ltd. uses trucks of different types. Some trucks are used for vegetable delivery, other for furniture, or for bricks. The company has its own code describing each type of a tr原创 2017-10-07 16:27:07 · 289 阅读 · 0 评论 -
畅通工程再续 HDU - 1875
相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件,就是2个小岛之间的距离不能小于10米,也不能大于1000米。当然,为了节省资金,只要求实现任意2个小原创 2017-10-07 16:28:59 · 219 阅读 · 0 评论 -
ArcSoft's Office Rearrangement HDU - 5933
ArcSoft, Inc. is a leading global professional computer photography and computer vision technology company. There are NN working blocks in ArcSoft company, which form a straight line. The CEO of ArcSo...原创 2018-05-09 20:01:16 · 206 阅读 · 0 评论