随笔分类 - XXPC
摘要:A Thickest Burger a+b+max(a,b) include using namespace std; typedef long long ll; int main(){ //freopen("in.txt","r",stdin); int n,a,b; while(~scanf("
阅读全文
摘要:D What a Beautiful Lake 找递增长度递减长度 1 include define maxn 205 using namespace std; int n; int a[maxn]; int main(){ //freopen("in.txt","r",stdin); while(
阅读全文
摘要:A ArcSoft's Office Rearrangement 均分石子。 好像怎么分答案都一样,于是模拟一遍。 D Difference 每个k预处理一半,然后用中途相遇法,就是类似尺取。 include using namespace std; typedef long long ll; ll
阅读全文
摘要:A Wrestling Match 判断二分图,特判没属性的孤点。 D A Simple Math Problem 设$G=gcd(a,b)$。 $gcd(a,b)=gcd(x+y,lcm(x,y))=gcd(x+y,ky)=gcd(x+y,y)=gcd(x,y)$ 那么等式$\frac{x}{G}
阅读全文
摘要:A Too Rich 给定每一种面值的硬币的个数,求出用最多硬币表示出所给价值。 倒着做可以用前缀和优化和剪枝。 可以$O(1)$算出当前面值减去前缀和之后最少需要几个,然后在此基础上多做3次就可以了,因为前一种硬币最多3枚就可以表示后一种硬币了。 G Dancing Stars on Me 每个点
阅读全文
摘要:A An Easy Physics Problem Not Easy 啊。 给个射线,和一个圆柱体,射线撞到圆柱体会弹射。判断能否经过给定的点。 折射的时候不能用三角函数旋转,会被卡精度。 $(x,y)$关于直线$ax+by+c=0$的对称点坐标$nx=x 2a\frac{ax+by+c}{a^2+
阅读全文
摘要:A Xiongnu's Land 二分答案。 include using namespace std; typedef long long ll; struct node{ int x,y,lx,ly; void in(){ scanf("%d%d%d%d",&x,&y,&lx,&ly); } ll
阅读全文
摘要:A Alien Sunset 暴力枚举t E L include using namespace std; typedef long long ll; const int maxn = 1e6+5; struct node{ int x,y,h; ll d; void in(){ scanf("%d
阅读全文

浙公网安备 33010602011771号