![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM
文章平均质量分 76
ICDI
这个作者很懒,什么都没留下…
展开
-
Sum It Up UVA, 574
#include #include #include #include #include #include using namespace std;int List[15];vectorit;vector > it_sum;//还可以这样用,长知识了int flag=0;int n;void DFS(int cur,int t){ if原创 2016-04-08 13:51:38 · 666 阅读 · 0 评论 -
Getting in Line UVA, 216
#include#include#include#include#includeusing namespace std;struct Node{ int x; int y;}node[10];struct Ans{ double goal; int i;}ans[41000]; //i为全排列中的编号,goal为得原创 2016-04-06 22:55:22 · 262 阅读 · 0 评论 -
Making Change UVA, 166
这道题我们先来想一想: 在现实生活中,你去买东西,有找零钱找你100的吗??没有!! 那么我们可以试着从卖家出发考虑问题,把小于最大面值的所有情况枚举出来int re[41][2]={ //第一个数表示找的零钱,第二个数表示需要的最少的硬币 {0,0},原创 2016-04-03 21:31:59 · 466 阅读 · 0 评论 -
X-Explosives
#include#includeconst int maxn=100000+10;int a[maxn];using namespace std;int find(int x){ if(x==a[x]) return x; int temp; temp=a[x]; a[x]=find(temp);//路径压缩原创 2016-04-02 16:12:47 · 200 阅读 · 0 评论 -
An antiarithmetic permutation UVA, 11129
注意这答题的答案并不唯一解释见图#include #include using namespace std;int a[10005];int ans[10005];void compute(int l,int r)// l和r 是在数组中的位置{ int p,q; p=l; if(r-l==1||r==l||r else原创 2016-04-13 22:04:07 · 232 阅读 · 0 评论