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. QT release版QAudioDeviceInfo获取不到音频设备,而debug版可以获取到

    新添加了两个模块:QCharts和Multimedia 但自己没有重新打包更新里面的库文件什么的... 坑爹... 害我找了这么久... 解决办法: 方法一: 将Qt安装目录下的plugins文件夹中 ...

  2. nodejs模块fs——文件操作api

    // fs模块常用api // 读取文件 .写入文件 .追加文件. 拷贝文件 .删除文件 // 读取文件 // fs.readFile(path[, options], callback) // fs ...

  3. linux学习之路(一)--centos7安装JDK

    一.卸载centos自带jdk 1.rpm -qa | grep java 查看包含“java”关键字的安装包. 2.然后通过    rpm -e --nodeps   后面跟系统自带的jdk名    ...

  4. 启动 docker 容器时报错

    错误信息: iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 9300 -j DNAT --to-dest ...

  5. 查看IIS错误日志

    部署在IIS中的程序,难免出现数据产生异常 在事件查看器中,可以看出来具体的错误信息,代码定位

  6. .NET调用腾讯云API实例

    最近项目有用到腾讯云的身份识别接口,话不多说,直接上代码: private void IDCardVerification(HttpContext context) { string imgStr = ...

  7. css 点击样式,水波纹(记录备用)

    <!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8" ...

  8. KaiWu 的体验

    KaiWu 的体验 来源 https://www.zhihu.com/question/28950444 >>>>>>>>>>>> ...

  9. python之统计字符串中字母出现次数

    dic=dict() d={} s=set() s='helloworld' (1)d=dict() for x in s: if x not in d.keys(): d[x]=1 else: d[ ...

  10. 浅谈javascript中变量作用域和内存(2)

    1.无块级作用域 javascript没有块级作用域,这会让其他程序员在理解js代码上很痛苦.在其他很多语言,比如C,大括号括起来的代码块都有自己的作用域 举个例子 if(true) { var na ...