B. Petya and Exam】的更多相关文章

补的若干年以前的题目,水题,太菜啦_(:з」∠)_    B. Petya and Exam time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output It's hard times now. Today Petya needs to score 100 points on Informatics exam. The tasks see…
题目链接:http://codeforces.com/contest/832/problem/B B. Petya and Exam time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output It's hard times now. Today Petya needs to score 100 points on Informatics…
B. Petya and Exam time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output It's hard times now. Today Petya needs to score 100 points on Informatics exam. The tasks seem easy to Petya, but he think…
地址:http://codeforces.com/contest/832/problem/B 题目: B. Petya and Exam time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output It's hard times now. Today Petya needs to score 100 points on Informati…
B. Petya and Exam time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output It's hard times now. Today Petya needs to score 100 points on Informatics exam. The tasks seem easy to Petya, but he think…
E - Petya and Exam CodeForces - 832B 这个题目其实可以不用字典树写,但是因为之前写过poj的一个题目,意思和这个差不多,所以就用字典树写了一遍. 代码还是很好理解的,主要就是哪个findx函数,这个要好好理解. 如果碰到*或着?就要重新标记一下,其他都是一样的,对于?可以跳过好字母,对于*可以跳过若干个不好的字母, 这个就在直接跳过之前加一个判断条件就可以了. 贴一下代码 #include<iostream> #include<cstdio> #…
B. Petya and Exam 题目链接 题意 给你一串字符,在这个串中所有出现的字符都是\(good\)字符,未出现的都是\(bad\)字符, 然后给你另一串字符,这个字符串中有两个特殊的字符,一个是\(?\)这个字符只能被\(good\)字符代替,另一个是\(*\)这个能被忽略,或者被\(bad\)字符组成的字符串代替. 然后给你n个字符串,问你是否能通过代替原本串中的符号来变得. 思路 首先判断原本串中是否存在\(*\)字符如果不存在,那么下面的串的长度就应该和原本串的长度相等.如果存…
It's hard times now. Today Petya needs to score 100 points on Informatics exam. The tasks seem easy to Petya, but he thinks he lacks time to finish them all, so he asks you to help with one.. There is a glob pattern in the statements (a string consis…
题意:给你两个串,第一个串里面的字母都是good 字母, 第二个串是模式串,里面除了字母还有?和*(只有一个) ?可以替换所有good字母, *可以替换所有坏字母和空格(可以是多个坏字母!!!这点卡了我很久,也不举一个样例...) 然后q次询问,每次给你一个串,问你能否匹配成功,yes or no 思路:暴力,可惜晚上的时候被hacks掉了,真实数据的范围是超过1e5的,比较可惜. #include <stdio.h> #include <string.h> #include &l…
思路: 模拟. 实现: #include <iostream> using namespace std; string a, b; ]; bool solve() { ) return false; , j = ; for (; i < x; i++, j++) { if (a[i] >= 'a' && a[i] <= 'z') { if (a[i] != b[j]) return false; } else if (a[i] == '?') { if (!o…