ACM_图论TDMTDMTDMTDM
tomjobs
别慌,慌也没用
展开
-
ACWING 370. 卡图难题(2-SAT模板题)
有N个变量X0~XN−1,每个变量的可能取值为0或1。 给定M个算式,每个算式形如 XaopXb=c,其中 a,b 是变量编号,c 是数字0或1,op 是 and,or,xor 三个位运算之一。 求是否存在对每个变量的合法赋值,使所有算式都成立。 输入格式 第一行包含两个整数N和M。 接下来M行,每行包含三个整数a b c,以及一个位运算(AND,OR,XOR中的一个)。 输出格式 输出结果,如果存在,输出“YES”,否则输出“NO” 数据范围 1≤N≤1000, 1≤M≤106 输入样例: 4 4 0 1原创 2020-10-24 21:33:58 · 223 阅读 · 0 评论 -
Journey CodeForces - 839C(树的深度,期望,dfs)
There are n cities and n - 1 roads in the Seven Kingdoms, each road connects two cities and we can reach any city from any other by the roads. Theon and Yara Greyjoy are on a horse in the first city, ...原创 2019-08-19 15:21:55 · 392 阅读 · 0 评论 -
Sleepy Game CodeForces - 937D(判环)
Petya and Vasya arranged a game. The game runs by the following rules. Players have a directed graph consisting of n vertices and m edges. One of the vertices contains a chip. Initially the chip is lo...原创 2019-08-31 20:46:50 · 221 阅读 · 1 评论