Suspects Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Description As Sherlock Holmes was investigating a crime, he identified n suspects. He knows for sure that exactly one of them committed the crime. T…
B. Suspects time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output As Sherlock Holmes was investigating a crime, he identified n suspects. He knows for sure that exactly one of them committed the…
题意:有1~N,n(1e5)个嫌疑人,有m个人说真话,每个人的陈述都形如X是凶手,或X不是凶手.现在给出n,m及n个陈述(以+x/-X表示)要求输出每个人说的话是true ,false or notdefine. 题解:模拟,依次假设每个人是犯人,统计说真话的有几个,如果 ==m 就符合. 现在考虑notdefine:当符合的情况数大于1时,就说明有notdefine. 因为枚举时,某一对-y-x,x是凶手时,-x是假话-y是真话,y是凶手时,-x真话-y假话.而其他人的陈述都与xy无关 所以模…
Codeforces Round #110 (Div. 2) C. Message 题意 给两个长度不超过2000的字符串\(s,u\),仅由小写字母构成. 找出\(s\)的一个子串\(t\),通过3种操作变换成字符串\(u\): 在首或尾添加一个字符; 删除首或尾的一个字符; 改变某个位置的字符. 求最小的操作步数. 思路 因为删除.插入的代价和修改的代价一样,显然找出和\(u\)长度一样的子串\(t\)可以求得最小代价. 显然\(u\)可以只匹配\(s\)的一个前缀或后缀,可以通过在\(s\…
D. Max and Bike Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/595/problem/D Description For months Maxim has been coming to work on his favorite bicycle. And quite recently he decided that he is ready to take part in a cy…
A. Exam Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/534/problem/A Description An exam for n students will take place in a long and narrow room, so the students will sit in a line in some order. The teacher suspects that…
题目链接:Codeforces Round #298 (Div. 2) A. Exam An exam for n students will take place in a long and narrow room, so the students will sit in a line in some order. The teacher suspects that students with adjacent numbers (i and i + 1) always studied side…
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题.. 今天,我们来扒一下cf的题面! PS:本代码不是我原创 1. 必要的分析 1.1 页面的获取 一般情况CF的每一个 contest 是这样的: 对应的URL是:http://codeforces.com/contest/xxx 还有一个Complete problemset页面,它是这样的:…
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Each of the ships consists of bconsecutive cells. No cell can be part of two ships, however, the shi…
http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants to reach cinema. The film he has bought a ticket for starts in t minutes. There is a straight road of length s from the service to the cinema. Let's…