832B 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 seem easy to Petya, but he think…
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…
题意:给你两个串,第一个串里面的字母都是good 字母, 第二个串是模式串,里面除了字母还有?和*(只有一个) ?可以替换所有good字母, *可以替换所有坏字母和空格(可以是多个坏字母!!!这点卡了我很久,也不举一个样例...) 然后q次询问,每次给你一个串,问你能否匹配成功,yes or no 思路:暴力,可惜晚上的时候被hacks掉了,真实数据的范围是超过1e5的,比较可惜. #include <stdio.h> #include <string.h> #include &l…
E - Petya and Exam CodeForces - 832B 这个题目其实可以不用字典树写,但是因为之前写过poj的一个题目,意思和这个差不多,所以就用字典树写了一遍. 代码还是很好理解的,主要就是哪个findx函数,这个要好好理解. 如果碰到*或着?就要重新标记一下,其他都是一样的,对于?可以跳过好字母,对于*可以跳过若干个不好的字母, 这个就在直接跳过之前加一个判断条件就可以了. 贴一下代码 #include<iostream> #include<cstdio> #…
补的若干年以前的题目,水题,太菜啦_(:з」∠)_    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…
地址: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 题目链接 题意 给你一串字符,在这个串中所有出现的字符都是\(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…
思路: 模拟. 实现: #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…
[Link]:http://codeforces.com/contest/832/problem/B [Description] *能代替一个字符串(由坏字母组成); ?能代替单个字符(由好字母组成); 问你每个串能不能被匹配 [Solution] 对于没有*的情况; 先判断长度是否相同,不相同则不行; 否则看看问号所在的位置是不是?且,看看?对应的字母是不是好字母; 对于有*的情况; 先把左边和右边的字符和母串的对应位置对应起来; 左对齐比较和右对齐比较 然后中间部分就是用坏字母组成的字符串了…
wa一万次难受. #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using namespace std; #define max_n 100010 char a[max_n],b[max_n],c[max_n]; ]; int main() { ; memset(d,,sizeof(d)); scanf("%s",a); getchar();…
链接:https://codeforces.com/contest/1282/problem/C 题意:  有一个人参加考试,考试只有两种题,一种是简单题,每道题耗时固定为a:另一种是困难题,每道题耗时固定为b,保证b>a.解出一道题得分都是1.考试的规则并不只是写多少题得多少分,鼓励提前交卷.假如你没有提前交卷,那么有一部分的题目会列为“必做题”,当“必做题”的题目没有全部被完成的话,这门课就算0分:否则得到与题数相同的分数,包括“必做”和“非必做”的. 题意: 题意很明显需要按题目的“必做时…
补的若干年以前的题目,水题,太菜啦_(:з」∠)_    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 s…
A. Sasha and Sticks 水题,判断一下次数的奇和偶就可以的. B. Petya and Exam 赛上的时候没有写出来,orz,记录一下吧. 题意:给出一个模式串,可能会有?和*两种符号,*最多有一个.?可以被好的字符代替,*可以被空串,坏的字符,坏的字符串代替,现在给出n个字符串,问这些字符串是否满足要求.好的字符在开头已经给出. 思路: 对于不包含*的串,直接判断?位置的是否都为好字符就ok了. 对于包含*的串,做如下处理,首先把*代表的bad串提取出来,再把模式串中的*擦除…
A. Sasha and Sticks 题目链接:http://codeforces.com/contest/832/problem/A 题目意思:n个棍,双方每次取k个,取得多次数的人获胜,Sasha先取,问Sasha是否可以取胜. 代码: //Author: xiaowuga #include <iostream> #include <algorithm> #include <set> #include <vector> #include <que…
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…
contest链接: https://codeforces.com/contest/1282 A. Temporarily unavailable 题意: 给一个区间L,R通有网络,有个点x,在x+r和x-r范围内,没有网络,问在这个区间上有网络的长度范围 思路:枚举区间覆盖情况,注意细节 AC代码: #include<iostream> #include<string> #include<vector> #include<cstring> #include…
记录 Codeforces 2019年12月19日到 2020年2月12日 的部分比赛题 Educational Codeforces Round 82 (Rated for Div. 2) D Fill The Bag 给出m(≤1e5)个盒子,盒子的大小是2的幂次.可以选择把一个盒子分成大小相同的两部分,问最少执行几次分盒子的操作,可以装满大小为n(≤1e18)的背包. 把n转化为二进制,代表可以由若干种2的幂次的盒子各一个装满.从小往大贪心地使用已有的盒子,不足时把第一个比它大的盒子分开.…
Petya studies at university. The current academic year finishes with nn special days. Petya needs to pass mm exams in those special days. The special days in this problem are numbered from 11 to nn. There are three values about each exam: sisi — the…
配置时间:2015年11月27日 配置人:撰写人:微冷的雨   Happy 01.Linux安装图 欢迎页面 桌面 02.Linux命令之文件目录操作 给北大青鸟五道口校区创建三个机房(L4,L5,L6) 给三个机房创建一个管理者 每个机房有一个班长 找到L5master,给他准备一张点名表 找到L4master,个他准备一张点名表,并且给他准备了一张班训表 L5master提意见了,也需要一张班训表. 并且L5master想要统计下班训信息.例如:行数,字符数等. 然后L4master就不服气…
同事小学妹神好奇心,在陌生群里下载了个软件,接下来就是自动重启无法开机. 找我一看,凭我专业帮妹纸装系统多年的经验,起初也不觉得有啥困难,兼容模式下重启,接下来出现这个: 按下any key后: 试了U盘启动无法成功,还让咱买key! 丢脸就丢脸吧,我建议小学妹找售后.不管有多重要的数据,决不能让这种坏人得逞! 下面是360团队的解决办法: Petya勒索木马分析及手工修复方法 延伸阅读: 勒索木马也有山寨货?细数那些演砸了的黑客魔术…
http://codeforces.com/contest/111/problem/D Little Petya loves counting. He wants to count the number of ways to paint a rectangular checkered board of size n × m (n rows, m columns) in k colors. Besides, the coloring should have the following proper…
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 by side and became friends and if they take…
网址:http://codeforces.com/contest/576/problem/A A. Vasya and Petya's Game time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya and Petya are playing a simple game. Vasya thought of number x…
B. Petya and Divisors Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/111/problem/B Description Little Petya loves looking for numbers' divisors. One day Petya came across the following problem: You are given n queries in t…
A. Petya and Inequiations Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/111/problem/A Description Little Petya loves inequations. Help him find n positive integers a1, a2, ..., an, such that the following two conditions a…
 Exam time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output 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 suspect…
C. Vasya and Petya's Game Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/577/problem/C Description Vasya and Petya are playing a simple game. Vasya thought of number x between 1 and n, and Petya tries to guess the number. P…
好吧最近堕落没怎么看书,估计这个月前是考不过了,还是拖到国庆之后考试吧.想着自己复习考试顺便也写点自己的复习的概要,这样一方面的给不准备背题库的童鞋有简便的复习方法(好吧不被题库的同学和我一样看MSDN,看官方文档就不用看下去了),另一方面的也逼迫自己每天点文档,写点什么(好吧个人的表达能力一直有问题,语文是数学老师教的).为啥不是从 70-461开始写是因为本人已经考过了(好吧,还考了两次,第一次差一题),以前写的关于XML Query(1,2)就是因为那次考试留下阴影的问题,对于不平时不怎么…