题意 题目链接 第一行的\(n\)表示模式串长度为\(n\) 接下来\(n\)行,每行开头有一个整数\(num\)表示匹配串中该位置的字符可以在\(num\)个桅子花出现,接下来输入这\(num\)个位置 最后一行一个模式串 Sol "It contains a set of test data"的意思原来是说只有一组测试数据 ShiftAnd算法,非常interesting,推荐一篇讲的非常好的blog 这题就是给出了\(B\)数组,然后暴力搞一下就行了.. 垃圾题目卡我读入卡我输出…
题目链接 A - Wrestling Match (二分图染色) 题意略坑(没有说好的玩家一定能打过差的玩家啊啊~~) 典型的二分图染色问题,每个玩家看成一个点,把相互较量过的玩家之间连边,好的玩家染成黑色,差的玩家染成白色.先把能确定颜色的点都确定下来,然后剩下的点判断是不是二分图,推导过程中发现矛盾立即返回No.如果一个点没有和其他任何点相连且颜色不确定也返回No. #include<bits/stdc++.h> using namespace std; typedef long long…
Using regular expression to define a numeric string is a very common thing. Generally, use the shape as follows: (||) (|) () (|) Above regular expression matches digits:The first , and . The second and . The third . And the fourth and . The above reg…
问题描述: Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while 14 is not ugly since it includes another prime factor 7. Note that 1…