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 ...
随机推荐
- Deutsch lernen (12)
1. hinweisen - wies hin - hingewiesen 向...指出,指明 auf etw.(A) hinweisen Ich möchte (Sie) darauf hiweis ...
- (转)Bootstrap 之 Metronic 模板的学习之路 - (3)源码分析之 body 部分
https://segmentfault.com/a/1190000006697252 body 的组成结构 body 部分包含了 HEADER.CONTAINER.FOOTER,其中 CONTAIN ...
- How to add jdk8 in Eclipse Indigo
I just read How to have Eclipse use JDK8 to compile a project? What i added jdk8 to eclipse as, Fro ...
- python核心编程中的对象值比较VS对象身份比较(转载)
转载地址: https://blog.csdn.net/Mluka/article/details/51076786 在python核心编程第四章中,P69在优化下面这段代码时提出了:对象值比较VS对 ...
- openstack--memecache
一.缓存系统 静态web页面: 1.工作流程: 在静态Web程序中,客户端使用Web浏览器(IE.FireFox等)经过网络(Network)连接到服务器上,使用HTTP协议发起一个请求(Reques ...
- Python匿名函数/排序函数/过滤函数/映射函数/递归/二分法
一. lamda匿名函数 为了解决一些简单的需求而设计的一句话函数 # 计算n的n次方 def func(n): return n**n print(func(10)) f = lambda n: n ...
- 算法工程师首先是工程师系列01 - 服务器篇 - 物理服务器安装centos7
尤其在互联网公司中,如果不是分工特别明确的独立业务组,通常需要自己处理很多东西,例如一个算法工程师,虽然不要求你装机,但是和负责部署服务的同事对接口,总不能连json是啥都不知道(工作中遇到过一个ET ...
- 如何在 vuex action 中获取到 vue 实例
问题:在做运营开发工具的时候 我想要请求后台服务器保存成功后 弹出一个弹框(饿了吗 的 message 弹框), 由于$message 是挂在 Vue原型链上的方法 (Vue.prototype.$m ...
- noip模板复习
自己敲模板还是有很多容易错的地方 写在注释里面了 LCA #include<bits/stdc++.h> #define REP(i, a, b) for(register int i = ...
- 1.VMware虚拟机的安装
1.找到安装软件 2.使用如下操作安装 3.选择接受协议 4.修改安装目录 5.如果上一步有修改,此步骤不用改路径 7.安装后创建桌面快捷方式 8.安装成功可以看到桌面上有快捷方式图标 安装结束 声明 ...