Codeforces Round #438 A. Bark to Unlock】的更多相关文章

题意:给你一个原串和n个子串,问你这n个子串任意组合起来能不能使原串出现,串的长度为2. Examples Input ya4ahoytoha Output YES Input hp2http Output NO Input ah1ha Output YES 思路: 首先如果输入的就有原串那么肯定可以:若没有,那么就记录一下每个子串的第一个字母是否等于原串的第二个字母, 第二个字母是否等于原串的第一个字母,因为这样可以拼接起来构成原串,按照最后一个样例,好像每个子串可以用多次. 代码:#incl…
本来兴致勃勃的想乘着这一次上紫,于是很早很早的到了机房 但是好像并没有什么用,反而rating-=47 Codeforces Round #438(Div.1+Div.2) 今天就这样匆匆的总结一下,心情不好qaq 首先是 A.Bark to Unlock 启示:(1)不能直接把char数组进行比较!!! (2)读题要读清,不能漏读条件!!! #include<bits/stdc++.h> using namespace std; ][],n; string s,t; int main(){…
A. Bark to Unlock 题目链接:http://codeforces.com/contest/868/problem/A 题目意思:密码是两个字符组成的,现在你有n个由两个字符组成的字符串,现在问是否可以用你手上的这些字符串通过拼接其中两个的基础上使得密码是这个拼接而成的字符串的子串,一个字符串可以使用多次,这意味这自己拼接自己也是可以的. 题目思路:暴力枚举这个过程,因为总共就n最大也就100 代码: /* *************************************…
最近只想喊666,因为我是真得菜,大晚上到网吧打代码还是很不错的嘛 A. Bark to Unlock time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output As technologies develop, manufacturers are making the process of unlocking a phone as us…
题目所在比赛的地址在这里呀 A. Bark to Unlock ·述大意:       输入一个目标串.然后输入n(1<=n<=100)个串,询问是否可以通过这些串收尾相接或者它本身拼出目标串(比如ab rt 可拼出ab rt br ta),输出就是 Yes或者No.提到的串长度都为2. ·分析:       直接按照题目说的,一种是自己本身等于目标串,一种是两个串拼出了目标串所以前者O(n)后者O(n2),就没啦. #include<stdio.h> #define go(i,a…
[链接]h在这里写链接 [题意] 在这里写题意 [题解] 枚举它是在连接处,还是就是整个字符串就好. [错的次数] 0 [反思] 在这了写反思 [代码] #include <bits/stdc++.h> using namespace std; const int N = 100; string s; string ts[N+10]; int main() { //freopen("F:\\rush.txt","r",stdin); ios::sync_…
Description Have you ever tried to explain to the coordinator, why it is eight hours to the contest and not a single problem has been prepared yet? Misha had. And this time he has a really strong excuse: he faced a space-time paradox! Space and time…
Description Snark and Philip are preparing the problemset for the upcoming pre-qualification round for semi-quarter-finals. They have a bank of n problems, and they want to select any non-empty subset of it as a problemset. k experienced teams are pa…
http://codeforces.com/contest/868/problem/D 优化:两个串合并 原有状态+ 第一个串的尾部&第二个串的头部的状态 串变为第一个串的头部&第二个串的尾部 注意: 头尾不能重复 如串A合并串A 这就意味着串的头尾不能有重合, 详见代码 #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <…
C. Qualification Rounds time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Snark and Philip are preparing the problemset for the upcoming pre-qualification round for semi-quarter-finals. They…