QOJ.ac

QOJ

Time Limit: 12.0 s Memory Limit: 512 MB Total points: 100 Hackable ✓

#4000. 弥留之国的爱丽丝

統計

给你 $n$ 个结点和 $m$ 条有向边,点编号为 $1,2,\dots,n$。每条边的颜色是黑色或者白色。一开始所有 $m$ 条边都是黑色的。

你需要进行 $q$ 次操作,有两种操作:

1 k:将第 $k$ 条边的颜色进行反转。

2 u v:询问是否能从 $u$ 只经过黑色的边走到 $v$。

输入格式

第一行有三个数 $n,m$ 和 $q$,表示点数,边数,操作数。

之后 $m$ 行,每行包含两个数 $u_i$ 和 $v_i$,表示有一条从 $u_i$ 到 $v_i$ 的有向边。

之后 $q$ 行,每行一个操作,格式如上述。

输出格式

对每个询问,如果可以从 $u$ 只经过黑色的边走到 $v$,则输出 YES,否则输出 NO

样例数据

样例 1 输入

5 6 7
1 2
1 3
2 4
3 4
3 5
4 5
2 1 5
2 2 3
1 3
1 4
2 1 4
1 3
2 1 5

样例 1 输出

YES
NO
NO
YES

子任务

Idea:Claris,Solution:Claris,Code:Claris,Data:Claris

对于 $100\%$ 的数据,满足 $2 \leq n \leq 5\times 10^4$, $1\leq m,q\leq 10^5$,$1 \leq k \leq m$,$1 \leq u,v \leq n$, $u\neq v$。

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.