QOJ.ac

QOJ

Time Limit: 12 s Memory Limit: 512 MB Total points: 100

#14294. TEST_132

الإحصائيات

给定平面上 $n$ 个互不相同的点 $(x_i,y_i)_{i=1}^n$,每个点有点权,初始为 $v_i$;

共 $m$ 次操作:

修改操作:给定 $X$,将满足 $x_i=X$ 的点的点权 $v_i$ 修改为 $v_i^2$;

查询操作:给定 $Y$,求满足 $y_i=Y$ 的点的点权 $v_i$ 的和;

答案对 $10^9+7$ 取模。

输入格式

第一行两个整数 $n,m$;

接下来 $n$ 行,每行三个整数 $x_i,y_i,v_i$;

接下来 $m$ 行,每行两个整数,修改操作表示为 $1,X$,查询操作表示为 $2,Y$;

输出格式

对每个查询操作,输出一行,表示答案。

样例数据

样例 1 输入

5 10
1 3 597843412
1 1 613307236
1 2 488247075
1 4 29761102
1 5 101159431
1 1
2 2
1 1
2 2
2 1
2 2
1 1
1 1
2 3
1 1

样例 1 输出

577359197
27079329
482035359
27079329
220579797

子任务

Idea:ccz181078,Solution:ccz181078,Code:ccz181078,Data:ccz181078

对于 $100\%$ 的数据,满足 $1\le n,m\le 1.2\times10^6$,$1\le x_i,y_i\le n$,$0\le v_i\le 10^9+6$,$1\le X,Y\le n$。

对于 $20\%$ 的数据,满足 $n,m\le 5000$;

对于另外 $20\%$ 的数据,没有修改操作;

对于另外 $20\%$ 的数据,满足 $x_i,y_i,X,Y$ 在 $1,2,\dots,n$ 中独立地均匀随机选取;

对于另外 $20\%$ 的数据,无特殊限制。

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.