
ACM
文章平均质量分 71
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 · 707 阅读 · 0 评论 -
Getting in Line UVA, 216
#include #include #include #include #include using 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 · 299 阅读 · 0 评论 -
Making Change UVA, 166
这道题我们先来想一想: 在现实生活中,你去买东西,有找零钱找你100的吗??没有!! 那么我们可以试着从卖家出发考虑问题,把小于最大面值的所有情况枚举出来 int re[41][2]={ //第一个数表示找的零钱,第二个数表示需要的最少的硬币 {0,0},原创 2016-04-03 21:31:59 · 538 阅读 · 0 评论 -
X-Explosives
#include #include const 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 · 237 阅读 · 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 · 269 阅读 · 0 评论