PAT (Advanced Level) Practice 1085 Perfect Sequence
最后一个测试点过不了,是因为m*p可能超过了int的范围,导致判断条件出错,所以将数据类型改成longlong就好了。#include#include#include#include#definemaxn100001usingnamespacestd;longlonga[maxn],maxlen=0;intindex=0;intmain(){intn,p;cin>>n>>p;for(inti=0;