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

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【真的菜·】的更多相关文章
- D. Huge Strings Codeforces Round #438 by Sberbank and Barcelona Bootcamp (Div. 1 + Div. 2 combined)
http://codeforces.com/contest/868/problem/D 优化:两个串合并 原有状态+ 第一个串的尾部&第二个串的头部的状态 串变为第一个串的头部&第二个 ...
- 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个由两个字符组成的字符串 ...
- 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 ...
- Qualification Rounds(Codeforces Round #438 by Sberbank and Barcelona Bootcamp (Div. 1 + Div. 2 combined)+状态压缩)
题目链接 传送门 题意 现总共有\(n\)个题目\(k\)支参赛队伍,已知每个题目各队伍是否会写,现问你能否从题目中选出一个子序列使得每支队伍最多只会写一半的题目. 思路 对于每个题目我们用二进制压缩 ...
- Codeforces Round #438 (Div.1+Div.2) 总结
本来兴致勃勃的想乘着这一次上紫,于是很早很早的到了机房 但是好像并没有什么用,反而rating-=47 Codeforces Round #438(Div.1+Div.2) 今天就这样匆匆的总结一下, ...
- 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 ...
- Codeforces Round #438 C. Qualification Rounds
Description Snark and Philip are preparing the problemset for the upcoming pre-qualification round f ...
- Codeforces Round #438 C - Qualification Rounds 思维
C. Qualification Rounds time limit per test 2 seconds memory limit per test 256 megabytes input stan ...
- Codeforces Round #438 D. Huge Strings
Description You are given n strings s1, s2, ..., sn consisting of characters 0 and 1. m operations a ...
随机推荐
- 全能中间件 REST API 使用手册
全能中间件 REST API 使用手册 Ver:17.6.24 技术支持QQ:64445322 QQ群:339616649 任何第三方应用或网站都可以通过使用开放API为用户提供实时优质的服务. ...
- Python——成员变量
一.类变量 在类命名空间内定义的变量就属于类变量,python允许使用类来修改.读取类变量. 例: class a: b = '我是类变量' def c(self): print (a.b) # 通过 ...
- 01 IO流(一)—— 流的概念、File类
1 流的概念理解(重要) 理解流的概念非常重要. 流,就是程序到数据源或目的地的一个通道. 我们把这个通道实例化得到一个具体的流,相当于一个数据传输工具,它可以在程序与资源之间进行数据交换. 换言之, ...
- Scratch编程:初识Scratch及编程工具安装(一)
“ Scratch是一款由美国麻省理工学院(MIT)设计开发的少儿编程工具.” Scratch采用可视化.模块化的编程方式,非常适合青少年作为初次接触编程的工具和语言来学习,进而用其编写充满趣味的小程 ...
- PowerBuilder学习笔记之行删除卡死问题
在数据窗口勾选这两个选项后,在删除行数据时会导致系统直接崩溃退出
- mysql全面整理(用于复习、查阅)--正在更新
Mysql学习 1. 关键字与函数名称全部大写 2. 数据库名称.表名称.字段名称全部小写 3. SQL语句必须以分号结尾 一.数据库基本操作 1. 创建.查看数据库 CREATE {DATABASE ...
- windows主机上ORACLE生成awr报告的步骤
oracle数据库是一个大型的关系型数据库,那么如果有一天装载数据库的主机由于大量的IO操作导致主机cpu荷载超过100%会使得主机卡顿或者对数据库连接或者进行数据库进行正常的IO操作都会产生影响,所 ...
- 括号匹配问题 —— Deque双端队列解法
题目: 给定一个只包括 '(',')','{','}','[',']'?的字符串,判断字符串是否有效. 有效字符串需满足: 左括号必须用相同类型的右括号闭合.左括号必须以正确的顺序闭合.注意空字符串可 ...
- intel ipp6.0安装过程
由于最近看到一个代码中使用了intel ipp6.0库,了解到,ipp6.0是一个很强大的图像处理库,将其与opencv联合使用,还能够加速opencv的处理,在图像处理的过程中,是一个很重要的工具. ...
- 如何导出robotframework的工程
不知道是不是只有我一个小白,自己折腾了很久,也百度了很久,不知道怎么导出哇.现在来扫扫盲罗.我拿自己的项目举例:找到我的RF工程目录可以看到下面有3个项目,直接拷贝你想要的项目就ok啦,是不是so e ...