问题 D: Segment Balls 时间限制: 1 Sec 内存限制: 128 MB 提交: 253 解决: 37 题目描述 Small K has recently earn money in stock market , so he want to make balls to celebrate it. Now he buys so many balls , and he want to put it into the boxes , he will have two operato…
E. XOR on Segment time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output You've got an array a, consisting of n integers a1, a2, ..., an. You are allowed to perform two operations on this array:…
magic balls Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 323 Accepted Submission(s): 90 Problem Description The town of W has N people. Each person takes two magic balls A and B every day.…
传送门 题意简述:要求支持两种操作: 插入一条线段. 询问与直线x=kx=kx=k相交的线段中,交点最靠上的线段的编号. 思路: 直接上李超线段树即可. 代码: #include<bits/stdc++.h> #define ri register int using namespace std; typedef long long ll; typedef double db; const int mod=1e9+7,N=40005,M=100005; inline int read(){ i…
题目大意:维护一个二维平面,给定若干条线段,支持询问任意整数横坐标处对应的纵坐标最靠上的线段的 id,相同高度取 id 值较小的,强制在线. 题解:初步学习了李超线段树.李超线段树的核心思想在于通过标记永久化的方式来维护斜率. 代码如下 #include <bits/stdc++.h> using namespace std; const int maxn=1e5+10; const double eps=1e-6; inline int read(){ int x=0,f=1;char ch…