进击のACM
文章平均质量分 64
JIANTAO_YI
磨成長為硯,記錄過往的歲月;化歲月成墨,書寫點滴的青春;執青春之筆,揮斥方遒的成長!
展开
-
P1034 家族 (并查集 I)
点击此处打开原题链接:https://vijos.org/p/1034附AC代码:#include#define M 50001int father[M],a,b,m,n,p;int find(int x){ if (father[x]!=x) father[x]=find(father[x]); return father[x];}int m原创 2013-11-02 15:48:31 · 1055 阅读 · 0 评论 -
POJ 2524 Ubiquitous Religions (并查集 II)
点击此处打开原题链接:http://poj.org/problem?id=2524题目大意:学校里所有人都信宗教,每个人只能信一种宗教。输入n个人m组数,每组数代表2个人信的是一种宗教。问学校里存在多少种宗教。附AC源代码:#include #define M 50001int father[M],Array[M];int fi原创 2013-11-02 15:58:01 · 756 阅读 · 0 评论 -
【STL】next_permutation的原理和使用
1、碰到next_permutation(permutation:序列的意思)今天在TC上碰到一道简单题(SRM531 - Division Two - Level One),是求给定数组不按升序排列的最小字典序列(Sequence of numbers A is lexicographically smaller than B if A contains a smaller numb转载 2013-11-17 12:02:31 · 910 阅读 · 0 评论 -
POJ 1611 The Suspects (并查集III)
原题链接:http://poj.org/problem?id=1611The SuspectsTime Limit: 1000MS Memory Limit: 20000KTotal Submissions: 19392 Accepted: 9408DescriptionSevere acute respi原创 2013-11-03 11:18:34 · 543 阅读 · 0 评论 -
HDOJ 2035 快速幂取模的事,为何我会想到大数类-________-''
人见人爱A^BTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18981 Accepted Submission(s): 13283Problem Description求A^B的最后三位数表示的整数。原创 2013-12-20 23:27:59 · 835 阅读 · 0 评论