【2005-2006 ACM-ICPC, NEERC, Moscow Subregional Contest】Problem J. Jack-pot
简单dfs,差分一下A数组和建出字典树能写得更方便,若不这么做代码时就会像我一样难受。#include#include#includeusingnamespacestd;typedeflonglongll;constintN=100003;inta[13][N],n,m,k,A[13],pos[13][N];lldfs(inttmp,intl,intr,intf){if(tmp>m){return