摘要:
题意: 给一个整数k,每次平方后只能显示结果的前n位,问在这个过程中能得到的最大的数是多少; 思路: floyd判圈算法;它的正确性建立在这得到的这些数是有限的,所以一定是一个循环,在这个循环的圈里面,一个快一个慢,同时出发最后一定会再次相遇,此时结束; 在这个过程中得到最大值; AC代码: 阅读全文
摘要:
题意: 给一个序列,找两个整数a[i],a[j]使得a[i]-a[j]最大; 思路: 从前往后扫一遍;水题; AC代码: 阅读全文
摘要:
题意: 2e6个数,按从小到大的顺序输出; 思路: 计数排序; AC代码: 阅读全文