2014ACM上海邀请赛A解释称号】的更多相关文章

#include <cstdio> #include <cstring> #include <iostream> using namespace std; const int M=510; int m,n; int map[M][M], match[M], chk[M]; int dfs(int p) { int i; for(i=1;i<=m;i++) if( map[p][i] && chk[i]==0 ) { chk[i]=1; if( ma…
Description  Byteman, one of the most deserving employee of The Goldmine of Byteland, is about to retire by the end of the year. The Goldmine management would like to reward him in acknowledgment of his conscientious work. As a reward Byteman may rec…
Seam Carving DescriptionFish likes to take photo with his friends. Several days ago, he found that some pictures of him were damaged. The trouble is that there are some seams across the pictures. So he tried to repair these pictures. He scanned these…
Battle ships Problem DescriptionDear contestant, now you are an excellent navy commander, who is responsible of a tough mission currently.Your fleet unfortunately encountered an enemy fleet near the South Pole where the geographical conditions are ne…
Comparison of Android versionsProblem DescriptionAs an Android developer, itˇs really not easy to figure out a newer version of two kernels, because Android is updated so frequently and has many branches. Fortunately, Google identifies individual bui…
Game with Pearls Problem DescriptionTom and Jerry are playing a game with tubes and pearls. The rule of the game is:1) Tom and Jerry come up together with a number K.2) Tom provides N tubes. Within each tube, there are several pearls. The number of p…
题意:n个数 m个询问 每个询问[l, r]的和, 再把[l, r]之间所有的数变为平方(模为9223372034707292160LL) 很明显的线段树 看到这个模(LLONG_MAX为9223372036854775807) 很明显平方时会爆LL 很容易发现所有数平方模了几次之后值就不再改变了 而且这个“几次”相当小 因此直接暴力搞就好了 public static void main(String[] args) { Scanner in = new Scanner(System.in);…
题意: 给n和一个字符串(可以有空格) 求字符串编码n次后的字符串 编码方式:字符串的每个字符转化成ASCII码, ASCII码转化成8位2进制,    将二进制数分割成6位为一组的(不够的补0), 再变成十进制数 依次按照以下方式变成字母 转化成字母后, 若长度不是4的整数倍, 在字符串后面补= 举个例子, The的ASCII码分别为84,104,101 转成8位2进制为01010100,01101000,01100101 分割成6位的为010101,000110,100001,100101…
3797714 2014 - 10 - 12 21:58 : 19 Accepted 3820 C++ 1350 70240 zz_1215 比較麻烦的一道题吧,開始的时候不停的段异常,后面知道是爆栈了,然后用数组模拟递归,才ac了 思路挺简单的,先找到这个树的直径,单独拿出来,能够证明最后选的两个点一定是在直径上的.我就不证了 然后求出这条直径上的每一个点向外延伸的最远距离 对这个距离做两次RMQ,第一次是对于往左边计算最大距离,所以要这个距离的序列要依次+1,+2,+3.......+n-1…
传送门 题目描述     在空闲时间,张老师习惯性地和菜哭武玩起了取石子游戏,这次的游戏规则有些不同,在他们面前有n堆石子,其中,第i堆石子的个数为a[i],现在制定规则如下:     从张老师开始,两个人轮流取石子,每次可以从任意一堆中取走x个石子,其中x必须严格小于这堆石子的总数并且能够被这堆石子的个数整除,谁先无法继续取走石子就算失败!     例如,只有一堆石子,个数为6,张老师首先可以取走的石子个数为1,2或者3个.     现在给定n堆石子每一堆的石子数,张老师希望你帮他确定在双方最…