Coding Contest Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 5968 Accepted Submission(s): 1413 Problem Description A coding contest will be held in this university, in a huge playground. Th
题目链接 2016 青岛网络赛 Problem C 题意 给出一些敏感词,和一篇文章.现在要屏蔽这篇文章中所有出现过的敏感词,屏蔽掉的用$'*'$表示. 建立$AC$自动机,查询的时候沿着$fail$指针往下走,当匹配成功的时候更新$f[i]$ $f[i]$表示要屏蔽以第$i$个字母结尾的长度为$f[i]$的字符串. #include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i(a); i &l
2016年省赛 G Triple Nimnim游戏,要求开始局面为先手必败,也就是异或和为0.如果n为奇数,二进制下最后一位只有两种可能1,1,1和1,0,0,显然异或和为1,所以方案数为0如果n为偶数,举个例子,14,二进制为1110,我们按位来拆1110==1000+100+101000=100+100+000也就是上一位的1可以拆成下一位的两个1和一个0,对于n在二进制下的每一个1都可以拆成3种情况(0都有三个位置可以选),所以为3^x,又因为如果每次0都选在同一个位置,就会出现0的情况,
首发于QQ空间和知乎,我在这里也更一下. 前言 以前高中搞竞赛的时候,经常看到神犇出去比赛或者训练之后写游记什么的,感觉萌萌哒.但是由于太弱,就没什么心情好写.现在虽然还是很弱,但是抱着享受的心情来沈阳玩一圈,总结一下还是可以的…… day -n 某天去数院找学长搞请假条,被无情地奶了一口:“你们要拿金回来啊!”此处应有一个巨大的flag……为滚粗埋下伏笔. day -1 打印模板……打了200+页……事后证明大量的高中竞赛内容是没卵用的…… day 0 一大早打车去双流坐飞机,
A.Relic Discovery_hdu5982 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 57 Accepted Submission(s): 49 Problem Description Recently, paleoanthropologists have found historical remains on an
I Count Two Three 31.1% 1000ms 32768K I will show you the most popular board game in the Shanghai Ingress Resistance Team. It all started several months ago. We found out the home address of the enlightened agent Icount2three and decided to draw hi
Herbs Gathering 10.76% 1000ms 32768K Collecting one's own plants for use as herbal medicines is perhaps one of the most self-empowering things a person can do, as it implies that they have taken the time and effort to learn about the uses and virtu
Problem G: Parenthesis Time Limit: 5 Sec Memory Limit: 128 MBSubmit: 398 Solved: 75[Submit][Status][Web Board] Description Bobo has a balanced parenthesis sequence P=p1 p2…pn of length n and q questions. The i-th question is whether P remains balan
Barricade Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Description The empire is under attack again. The general of empire is planning to defend his castle. The land can be seen as N towns and M roads, a
题目链接 A - Wrestling Match (二分图染色) 题意略坑(没有说好的玩家一定能打过差的玩家啊啊~~) 典型的二分图染色问题,每个玩家看成一个点,把相互较量过的玩家之间连边,好的玩家染成黑色,差的玩家染成白色.先把能确定颜色的点都确定下来,然后剩下的点判断是不是二分图,推导过程中发现矛盾立即返回No.如果一个点没有和其他任何点相连且颜色不确定也返回No. #include<bits/stdc++.h> using namespace std; typedef long long
题目链接 2016 Qingdao Online Problem I 题意 在一棵给定的树上删掉一条边,求剩下两棵树的树的直径中较长那的那个长度的期望,答案乘上$n-1$后输出. 先把原来那棵树的直径求出来.显然删掉的边不是这条直径上的边,那么这时答案就是这条直径的长度. 否则就是直径的某个端点到某一个点(要求连通)的距离的最大值. 在整条链上做两次$DP$之后枚举取较大值即可. #include <bits/stdc++.h> using namespace std; #define r
Sort Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description Recently, Bob has just learnt a naive sorting algorithm: merge sort. Now, Bob receives a task from Alice.Alice will give Bob N sorted sequenc
The Best Path Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Problem Description Alice is planning her travel route in a beautiful valley. In this valley, there are N lakes, and M rivers linking these lakes. Alice