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. nginx 二级目录高级写法

    nginx二级目录高级配置: location ~ .*\.(html)$ { expires 1m; error_page 404 = /test/index.html; access_log /d ...

  2. SQLSERVER 根据值查询表名

    CREATE PROCEDURE [dbo].[SP_FindValueInDB](@value VARCHAR(1024)) ASBEGIN-- SET NOCOUNT ON added to pr ...

  3. Powershell学习笔记:(一)、初识Powershell

    什么是Powershell? MSDN上的说明是:PowerShell 是构建于 .NET 上基于任务的命令行 shell 和脚本语言. PowerShell 可帮助系统管理员和高级用户快速自动执行用 ...

  4. Spark机器学习基础-特征工程

    对连续值处理 0.binarizer/二值化 from __future__ import print_function from pyspark.sql import SparkSession fr ...

  5. 六、eureka客户端自动注册服务

    所有文章 https://www.cnblogs.com/lay2017/p/11908715.html 正文 上一篇文章,我们稍微了解了一下eureka客户端是如何自动配置的,配置了哪些东西.在自动 ...

  6. springboot 常见的启动器

    <!--pringBoot提供了一个名为spring-boot-starter-parent的工程, 里面已经对各种常用依赖(并非全部)的版本进行了管理 我们的项目需要以这个项目为父工程,这样我 ...

  7. iOS 开发之模糊效果的五种实现

    前言 在iOS开发中我们经常会用到模糊效果使我们的界面更加美观,而iOS本身也提供了几种达到模糊效果的API,如:Core Image,使用Accelerate.Framework中的vImage A ...

  8. orangepi设置vnc开机自启动

    首先需要创建一个文件,执行以下命令,自动打开空白文件,在里面编辑内容即可 sudo gedit /etc/init.d/tightvncserver 把以下内容粘贴进去,然后点击保存即可. #!/bi ...

  9. mysql表设计注意点

    [原创]面试官:讲讲mysql表设计要注意啥 需要设计一个主键 因为你不设主键的情况下,innodb也会帮你生成一个隐藏列,作为自增主键.所以啦,反正都要生成一个主键,那你还不如自己指定一个主键,在有 ...

  10. sed进阶教程

    寻址规则 常规寻址 如果没有指定地址,那么命令将应用于每一行. 如果只有一个地址,那么命令应用于与这个地址匹配的任意行. 如果指定了由逗号分隔的两个地址,那么命令应用于匹配第一个地址(不包括第一个地址 ...