U567314 [Ynoi2019] 【我推的孩子】

题目背景

![](https://cdn.luogu.com.cn/upload/image_hosting/lt8g2d2q.png) ![](https://cdn.luogu.com.cn/upload/image_hosting/3bj3179t.png) ![](https://cdn.luogu.com.cn/upload/image_hosting/rd5enph3.png) ![](https://cdn.luogu.com.cn/upload/image_hosting/xclghvnz.png) ![](https://cdn.luogu.com.cn/upload/image_hosting/o7fln2i7.png) ![](https://cdn.luogu.com.cn/upload/image_hosting/sg2lkz2g.png) ![](https://cdn.luogu.com.cn/upload/image_hosting/8oa48wz4.png) ![](https://cdn.luogu.com.cn/upload/image_hosting/s73r6462.png)

题目描述

这是一道交互题。 本地测试需 #include 提交时请采用以下模板,而不 include hpmq.h,具体方法就是直接把这个模板放在自己代码里面。 以下说明均为对本地测试的说明,提交时请注意上面的说明。 ```cpp class Data{ friend class Operation; friend int main(); private: unsigned int x,sz,T,flag; void read(); public: void add_eq(const Data &a); void add(const Data &a,const Data &b); void clr(); void print()const; bool empty()const; }; class Operation{ friend int main(); private: unsigned int a,b,L,R,flag; void read(); public: void apply(Data &w)const; void apply(Operation &w)const; void clr(); bool empty()const; }; void solve( const int n, const int m, const int *x, const int *y, const Data *d, const int *a, const int *b, const int *c, const Operation *o){ //自行完善 } ``` 这是一道交互题。你需要借助 Data 类实现 solve() 函数。你可以使用 Data 类的成员函数,以及 C++ 编译器自动合成的函数(包括构造函数和赋值运算符)。 给定平面上的 $n$ 个点,第 $i+1$ 个点为 $(x_i,y_i)$,初始值为 $d_i$,$0\le i

输入格式

输出格式

说明/提示

Idea:ccz181078,Solution:ccz181078,Code:ccz181078,Data:ccz181078 对于所有数据,满足: $|x_i|\le 10^6$,$|y_i|\le 10^6$; $|a_i|\le 10^3$,$|b_i|\le 10^3$,$b_i\ne 0$,$|c_i|\le 10^6$; $x_i,y_i,a_i,b_i,c_i$ 为整数; 对任意 $i,j$,有 $a_ix_j+b_iy_j\ne c_i$,即不存在点在直线上的情况; 对任意 $i\ne j$,有 $\left(\frac{a_i}{b_i},\frac{c_i}{b_i}\right)\ne \left(\frac{a_j}{b_j},\frac{c_j}{b_j}\right)$,即不存在重合的直线; 数据被分为 6 个子任务,每个子任务有固定的 $n,m$ 和允许的代价上限,每个子任务可能依赖其它子任务,只有通过一个子任务和其依赖的子任务的所有测试点才能获得这个子任务的分值; | 子任务 | n | m | 代价上限 | 分值 | 依赖 | | ------ | -------------- | ------ | ----------------- | ---- | ---- | | 1 | $2\times 10^4$ | $10^3$ | $4\times 10^7$ | 10 | | | | 2 | $2\times 10^5$ | $10^2$ | $4\times 10^7$ | 10 | | | 3 | $2\times 10^5$ | $10^2$ | $1.25\times 10^6$ | 20 | | | 4 | $2^{16}$ | $10^4$ | $8\times 10^7$ | 20 | | | 5 | $2\times 10^5$ | $10^4$ | $2.5\times 10^7$ | 10 | | | 6 | $2\times 10^5$ | $10^4$ | $2.5\times 10^7$ | 30 | | 子任务 4 满足特殊限制:$-2^7\le x_i