Codeforces Round #438 (Div.1+Div.2) 总结
本来兴致勃勃的想乘着这一次上紫,于是很早很早的到了机房
但是好像并没有什么用,反而rating-=47
Codeforces Round #438(Div.1+Div.2)
今天就这样匆匆的总结一下,心情不好qaq
首先是 A.Bark to Unlock
启示:(1)不能直接把char数组进行比较!!!
(2)读题要读清,不能漏读条件!!!
#include<bits/stdc++.h>
using namespace std;
int bo[][],n;
string s,t;
int main(){
cin>>s;
scanf("%d",&n); cin>>t;
bo[][t[]-'a']=; bo[][t[]-'a']=;
if (bo[][s[]-'a']&&bo[][s[]-'a']||bo[][s[]-'a']&&bo[][s[]-'a']){
printf("YES"); return ;
}
for (int i=;i<=n;++i){
cin>>t;
if (s==t){
printf("YES"); return ;
}
bo[][t[]-'a']=; bo[][t[]-'a']=;
if (bo[][s[]-'a']&&bo[][s[]-'a']){
printf("YES"); return ;
}
}
printf("NO");
}
总之我的做法时先把时针,分针,秒针在秒意义下的位置,进行排序
然后把t1和t2也转化成相同状态,最后判断t1和t2分别在哪个位置
大概就是这样
#include<bits/stdc++.h>
using namespace std;
int h,m,s,t1,t2,s1,s2,s3,a1,a2;
int main(){
cin>>h>>m>>s>>t1>>t2;
s1=*(h%)+*m+s; s2=*m+*s; s3=*s;
a1=*(t1%); a2=*(t2%);
if(s1>s2)swap(s1,s2); if(s2>s3)swap(s2,s3); if(s1>s2)swap(s1,s2);
if(a1>a2)swap(a1,a2); bool bo=;
if(s1<=a1&&a2<=s2|| s2<=a1&&a2<=s3)bo=;
if(a2<=s1||a1>=s3)bo=; if(a1<=s1&&a2>=s3)bo=;
if(bo) puts("YES"); else puts("NO");
}
最后只希望今天的CF我的rating不会掉吧,上紫我的水平可能还不够吧
Codeforces Round #438 (Div.1+Div.2) 总结的更多相关文章
- Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship
Problem Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship Time Limit: 2000 mSec P ...
- Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems(动态规划+矩阵快速幂)
Problem Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems Time Limit: 3000 mSec P ...
- Educational Codeforces Round 43 (Rated for Div. 2)
Educational Codeforces Round 43 (Rated for Div. 2) https://codeforces.com/contest/976 A #include< ...
- Educational Codeforces Round 35 (Rated for Div. 2)
Educational Codeforces Round 35 (Rated for Div. 2) https://codeforces.com/contest/911 A 模拟 #include& ...
- Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings
Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings 题目连接: http://cod ...
- Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes
Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes 题目连接: http://code ...
- Educational Codeforces Round 63 (Rated for Div. 2) 题解
Educational Codeforces Round 63 (Rated for Div. 2)题解 题目链接 A. Reverse a Substring 给出一个字符串,现在可以对这个字符串进 ...
- Educational Codeforces Round 39 (Rated for Div. 2) G
Educational Codeforces Round 39 (Rated for Div. 2) G 题意: 给一个序列\(a_i(1 <= a_i <= 10^{9}),2 < ...
- Educational Codeforces Round 48 (Rated for Div. 2) CD题解
Educational Codeforces Round 48 (Rated for Div. 2) C. Vasya And The Mushrooms 题目链接:https://codeforce ...
随机推荐
- 安装pywinauto的步骤
team准备搞自动化测试(桌面WPF系统),这几天一直在找自动化测试工具.发现了pywinauto这款工具,许多网友反应很好用,于是下载下来试用.不得不说遇到的坑真不少,记录下来以备不时之需. 前段时 ...
- SpringBoot入门系列(转)
SpringBoot入门系列:第一篇 Hello World http://blog.csdn.net/lxhjh/article/details/51711148
- 【sqli-labs】 less32 GET- Bypass custom filter adding slashes to dangrous chars (GET型转义了'/"字符的宽字节注入)
转义函数,针对以下字符,这样就无法闭合引号,导致无法注入 ' --> \' " --> \" \ --> \\ 但是,当MySQL的客户端字符集为gbk时,就可能 ...
- 【sqli-labs】 less4 GET - Error based - Double Quotes - String (基于错误的GET双引号字符型注入)
提交id参数 加' http://localhost/sqli/Less-4/?id=1' 页面正常,添加" http://localhost/sqli/Less-4/?id=1" ...
- 504 Gateway Timeout 异常
生产销售系统出现 504 Gateway Timeout 异常,其实就是服务器响应太慢导致nginx带来超时,先不说服务端慢的优化问题:只是单纯的解决504.到网上发现了一篇文章fix it Add ...
- NOIP2012 DAY2 T2借教室
题目描述 在大学期间,经常需要租借教室.大到院系举办活动,小到学习小组自习讨论,都需要向学校申请借教室.教室的大小功能不同,借教室人的身份不同,借教室的手续也不一样. 面对海量租借教室的信息,我们自然 ...
- QT中tableview不能更新数据,why?
model->select(); //model->removeColumn(0);++++++++++++++++++++ //model->setHeaderData(model ...
- XHXJ's LIS
XHXJ's LIS Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Probl ...
- 洛谷 P2633 Count on a tree
P2633 Count on a tree 题目描述 给定一棵N个节点的树,每个点有一个权值,对于M个询问(u,v,k),你需要回答u xor lastans和v这两个节点间第K小的点权.其中last ...
- 我的红外arduino链接,!!!!
点击打开链接http://blog.csdn.net/g1342522389/article/details/46272473 一定要赞,小编非常辛苦.