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. 【转】linux卸载mysql

    查看是否安装了MySQL执行命令rpm -qa | grep mysql 执行过程[root@localhost ~]# rpm -qa | grep mysqlmysql-community-lib ...

  2. C++ 重载运算符返回值 和 返回引用的原因

    原因是: +,-,*等返回不了引用,比如+运算符,可以如下重载(为了简单,假设A 只有int x:int y) A operator+(A a,A b) {A sum;   sum.x=a.x+b.x ...

  3. 通过tushare获取股票价格

    # Author llll # coding=utf-8 # ---描述# 完成股票 价格查询和展示# 不直接根据网页进行爬虫获取股票价格,而是通过已有组件查询股票价格,并保存到csv文件或者exce ...

  4. Practice

    一.简介 Scrapy是一个为了爬取网站数据,提取结构性数据而编写的应用框架. 其可以应用在数据挖掘,信息处理或存储历史数据等一系列的程序中.其最初是为了页面抓取 (更确切来说, 网络抓取 )所设计的 ...

  5. docker 实践六:dockerfile 详解

    本篇开始来学习关于 dockerfile 的知识. 注:环境为 CentOS7,docker 19.03. dockerfile 是⼀个⽂本格式的配置⽂件, ⽤户可以使⽤ dockerfile 来快速 ...

  6. kafka的安装及使用(单节点)

    介绍了linux环境下,kafka 服务的安装与配置 安装 jdk 环境 下载 kafka 源码包放到服务器,解压 开启 zookeeper 开启 kafka server 创建主题 开启生产者 开启 ...

  7. Pycharm和Android工具之github使用

    请查看以下链接https://blog.csdn.net/m0_37306360/article/details/79322947 基本操作步骤 打开setting->version contr ...

  8. OpenStack kilo版(7) 部署dashboard

    安装dashboard  root@controller:~# apt-get install openstack-dashboard  配置 /etc/openstack-dashboard/loc ...

  9. 2-Spark-1-性能调优-数据倾斜2-Join/Broadcast的使用场景

    技术点:RDD的join操作可能产生数据倾斜,当两个RDD不是非常大的情况下,可以通过Broadcast的方式在reduce端进行类似(Join)的操作: broadcast是进程级别的,只读的. b ...

  10. SQL SERVER-Login搬迁脚本

    USE master GO IF OBJECT_ID ('sp_hexadecimal') IS NOT NULL DROP PROCEDURE sp_hexadecimal GO CREATE PR ...