http://codeforces.com/contest/868/problem/D 优化:两个串合并 原有状态+ 第一个串的尾部&第二个串的头部的状态 串变为第一个串的头部&第二个串的尾部 注意: 头尾不能重复 如串A合并串A 这就意味着串的头尾不能有重合, 详见代码 #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <…
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…
题目链接 传送门 题意 现总共有\(n\)个题目\(k\)支参赛队伍,已知每个题目各队伍是否会写,现问你能否从题目中选出一个子序列使得每支队伍最多只会写一半的题目. 思路 对于每个题目我们用二进制压缩所有队伍的情况,然后通过枚举状态看是否存在两种完全不同的状态是否同时出现过. 代码实现如下 #include <set> #include <map> #include <deque> #include <queue> #include <stack>…
8说了 #include<bits/stdc++.h> using namespace std; #define int long long signed main(){ string str; cin>>str; int _; cin>>_; ; ; ; ; while(_--){ string s; cin>>s; if(s==str){ flag4=; continue; } ]==str[]&&s[]==str[]){ flag3=;…
本来兴致勃勃的想乘着这一次上紫,于是很早很早的到了机房 但是好像并没有什么用,反而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(){…
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…
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…
Description You are given n strings s1, s2, ..., sn consisting of characters 0 and 1. m operations are performed, on each of them you concatenate two existing strings into a new one. On the i-th operation the concatenation saisbi is saved into a new…