UVA
文章平均质量分 75
japomica
这个作者很懒,什么都没留下…
展开
-
UVa 216 Getting in Line
#include#include#includestruct cable{ double x,y;}a[10];int b[10],c[10],vis[10],n;double min,sum,l;double length(double x1,double y1,double x2,double y2){ double L=sqrt((x1-x2)*(x1-x2)+(y1-原创 2013-08-05 18:19:31 · 508 阅读 · 0 评论 -
UVA 539 - The Settlers of Catan 解题报告
搜索即可,图为无向图。找出能走的不重复的边的最大数#include #include#include#include#define maxn 30using namespace std;int map[maxn][maxn];int vis[maxn][maxn];int point_num;int edge_num;int max_num;void dfs(int原创 2013-08-05 18:15:55 · 658 阅读 · 0 评论 -
UVA10025(The ? 1 ? 2 ? ... ? n = k problem)
题意:±1 ± 2 ± 3 ±…± n = k , 找出满足条件的最小 n 。。解析:必然存在整数 x(1=当 s1 = 1+2+3+...+x+..+n >= k时,有 s2 = 1+2+3+...-x+..+n == k,即多出的x肯定在1~n之间。s1 - s2 = s1 - k = 2x所以,我们想求最小的n,也就是求最小的满足条件的s1,而它与k的差必原创 2013-08-04 20:05:09 · 548 阅读 · 0 评论 -
UVA 639- Don't Get Rooked
In chess, the rook is a piece that can move any number of squares vertically or horizontally. In this problem we will consider small chess boards (at most 44) that can also contain walls through whi原创 2013-08-05 18:27:36 · 448 阅读 · 0 评论 -
uva-10344 - 23 out of 5
全排列+回溯(不过用的是DFS,囧)题意:给出5个数字,顺序可以任意排列,有三种运算:加、减、乘,不考虑优先级,按顺序计算,判断能否有一种方案得出的结果是23。#include #include using namespace std;int a[5],visit[5];int dfs(int n){ int flag; if(visit[0]+visi原创 2013-08-07 10:42:29 · 517 阅读 · 0 评论 -
uva 10763 - Foreign Exchange
Problem EForeign ExchangeInput: standard inputOutput: standard outputTime Limit: 1 secondYour non-profit organization (iCORE - international Confederation of Revolver Enthusiasts) coordi原创 2013-08-15 11:23:42 · 439 阅读 · 0 评论 -
UVa 10132(文件碎片)
Question 2: File FragmentationThe ProblemYour friend, a biochemistry major, tripped while carrying a tray of computer files through the lab. All of the files fell to the ground and broke. Your原创 2013-08-15 20:02:27 · 529 阅读 · 0 评论 -
UVa 10341 Solve It
Problem FSolve ItInput:standard inputOutput:standard outputTime Limit:1 secondMemory Limit: 32 MBSolve the equation: p*e-x + q*sin(x) + r*cos(x) +s*tan(x) + t*x2 + u = 0原创 2013-08-16 00:42:28 · 545 阅读 · 0 评论 -
uva 10057 - A mid-summer night's dream
Problem CA mid-summer night’s dreamInput:standard inputOutput:standard outputThis is year 2200AD. Science has progressed a lot in two hundred years. Two hundred years is mentioned here because原创 2013-08-16 02:32:52 · 562 阅读 · 0 评论