ZOJ
kent_ln
多年后
再回想年少时的迷茫和执着
或许原因都不记得了
青春就是让你张扬地笑
宫崎骏
展开
-
ZOJ :: Easy Task
You are given n integers. Your task is very easy. You should find the maximum integer a and the minimum integer b among these n integers. And then you should replace both a and bwith a-b. Your task原创 2016-12-02 20:27:57 · 307 阅读 · 0 评论 -
ZOJ :: GCD Reduce
思路: 若干次gcd()之后全部为1,判断是否有解,即判断n个数的最大公约数是否为1 若不为1,设为t(t>1),即n个数均为t的倍数,无论那两个相约,结果都大于等于t,最后结果一定为t 判断为1之后,先将A[0]约成1,gcd(1,x)=1,再与后面n-1个数进行去最大公约数操作 用C++中的cin,cout会超时 采用C语言中的格式输入函数scanf()和printf()原创 2016-12-02 22:07:44 · 275 阅读 · 0 评论