8说了

 #include<bits/stdc++.h>

 using namespace std;
#define int long long signed main(){
string str;
cin>>str;
int _;
cin>>_;
int flag1=;
int flag2=;
int flag3=;
int flag4=;
while(_--){
string s;
cin>>s;
if(s==str){
flag4=;
continue;
}
if(s[]==str[]&&s[]==str[]){
flag3=;
continue;
}
if(str[]==s[]){
flag1=;
}
if(str[]==s[]){
flag2=;
}
}
// cout<<flag1<<" "<<flag2<<" "<<flag3<<" "<<flag4;
if(flag3||flag4||(flag1+flag2==)){
printf("YES\n");
}else{
printf("NO\n");
}
return ;
}
/*
ah
oy aa ha
yo
*/

思路:直接暴力---居然能过.钟表问题转换是真滴难QAQ【小学就没整懂】

 #include<bits/stdc++.h>

 using namespace std;
#define int long long
int vis[];
signed main(){
int h,m, s, t1, t2;
cin>>h>>m>>s>>t1>>t2;
h*=;t1*=;
t2*=;
vis[h]++;
vis[m]++;
vis[s]++;
int ss=;
if(t1>t2)
swap(t1,t2);
for(int i=t1;i<t2;i++){
ss+=vis[i];
}
if(ss==||ss==){
cout<<"YES";
}
else{
cout<<"NO";
}
return ;
}

题解:二进制+暴力。

 #include<bits/stdc++.h>
using namespace std;
int a[];
int vis[];int n,k;
signed main(){
memset(vis,,sizeof(vis));
cin>>n>>k;
for(int i=;i<=n;i++){
for(int j=;j<=k;j++){
scanf("%d",&a[j]);
}
vis[a[]+a[]*+a[]*+a[]*]=;
}
for(int i=;i<=(<<k);i++){
for(int j=i;j<=(<<k);j++){
if(vis[i]&&vis[j]&&(!(i&j))){
printf("YES");
return ;
}
}
}
printf("NO");
return ;
}

Codeforces Round #438 by Sberbank and Barcelona Bootcamp (Div. 1 + Div. 2 combined) A,B,C【真的菜·】的更多相关文章

  1. D. Huge Strings Codeforces Round #438 by Sberbank and Barcelona Bootcamp (Div. 1 + Div. 2 combined)

    http://codeforces.com/contest/868/problem/D 优化:两个串合并 原有状态+ 第一个串的尾部&第二个串的头部的状态 串变为第一个串的头部&第二个 ...

  2. Codeforces Round #438 by Sberbank and Barcelona Bootcamp (Div. 1 + Div. 2 combined)

    A. Bark to Unlock 题目链接:http://codeforces.com/contest/868/problem/A 题目意思:密码是两个字符组成的,现在你有n个由两个字符组成的字符串 ...

  3. Codeforces Round #438 by Sberbank and Barcelona Bootcamp (Div. 1 + Div. 2 combine

    最近只想喊666,因为我是真得菜,大晚上到网吧打代码还是很不错的嘛 A. Bark to Unlock time limit per test 2 seconds memory limit per t ...

  4. Qualification Rounds(Codeforces Round #438 by Sberbank and Barcelona Bootcamp (Div. 1 + Div. 2 combined)+状态压缩)

    题目链接 传送门 题意 现总共有\(n\)个题目\(k\)支参赛队伍,已知每个题目各队伍是否会写,现问你能否从题目中选出一个子序列使得每支队伍最多只会写一半的题目. 思路 对于每个题目我们用二进制压缩 ...

  5. Codeforces Round #438 (Div.1+Div.2) 总结

    本来兴致勃勃的想乘着这一次上紫,于是很早很早的到了机房 但是好像并没有什么用,反而rating-=47 Codeforces Round #438(Div.1+Div.2) 今天就这样匆匆的总结一下, ...

  6. Codeforces Round #438 B. Race Against Time

    Description Have you ever tried to explain to the coordinator, why it is eight hours to the contest ...

  7. Codeforces Round #438 C. Qualification Rounds

    Description Snark and Philip are preparing the problemset for the upcoming pre-qualification round f ...

  8. Codeforces Round #438 C - Qualification Rounds 思维

    C. Qualification Rounds time limit per test 2 seconds memory limit per test 256 megabytes input stan ...

  9. Codeforces Round #438 D. Huge Strings

    Description You are given n strings s1, s2, ..., sn consisting of characters 0 and 1. m operations a ...

随机推荐

  1. Python26之字典2(内置函数)

    一.工厂函数的概念 和序列类型的工厂函数一样,dict()也是一个工厂函数,本质上是一个类,Python程序无处不对象的概念可见一斑 二.字典类型内置函数的用法 1.fromkeys(iterable ...

  2. Web服务器和Tomcat

    Web服务器常用: WebLogic:是BEA公司的推出的产品,现在已经被oracle收购,是目前应用最广泛的Web服务器,支持JavaEE规范,商用收费,开发者可以免费使用. WebSphere:I ...

  3. 小游戏UFO Fled

    UFO Fled:https://play.google.com/store/apps/details?id=cn.crane.game.flappyufo UFO Fled -- 点击屏幕帮助UFO ...

  4. io.ByteIO和open操作二进制流的区别(转)

    转自Stack Overflow:https://stackoverflow.com/questions/42800250/difference-between-open-and-io-bytesio ...

  5. 在论坛中出现的比较难的sql问题:38(字符拆分 字符串检索问题)

    原文:在论坛中出现的比较难的sql问题:38(字符拆分 字符串检索问题) 最近,在论坛中,遇到了不少比较难的sql问题,虽然自己都能解决,但发现过几天后,就记不起来了,也忘记解决的方法了. 所以,觉得 ...

  6. 在论坛中出现的比较难的sql问题:22(触发器专题3)

    原文:在论坛中出现的比较难的sql问题:22(触发器专题3) 最近,在论坛中,遇到了不少比较难的sql问题,虽然自己都能解决,但发现过几天后,就记不起来了,也忘记解决的方法了. 所以,觉得有必要记录下 ...

  7. .NET Standards

    .net的创始者们在一开始的时候,就意识到了他们的编程技术可以用在不通的操作系统和不同类型的cpu上.他们改进了20世纪90年代编程语言实现技术.最主要的一条是,不同的编程语言对应统一个运行时,及CL ...

  8. Mybatis之collection与association标签

    collection与association标签的功能就是为了解决查询条件映射到一个类或一个集合上,适用于对于多对一,一对多的映射结果,现在我们就探究其具体使用吧. 环境搭建: 数据库搭建 CREAT ...

  9. metasploit情报收集

    1.msf连接数据库 service postgresql start(postgresql默认用户名scott,密码tiger) msf > db_connect 用户名:密码@127.0.0 ...

  10. day14-python之集合函数字符串格式化

    1.集合 #!/usr/bin/env python # -*- coding:utf-8 -*- # s=set(['alex','alex','sb']) # print(s) # s=set(' ...