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 (13)
1. die Sicherheit, -en 安全(性) Was ist Ihnen wichtiger: Freiheit oder Sicherheit? Wie ist es mit der ...
- VHDL之code structure
1 VHDL units VHDL code is composed of at least 3 fundamental sections: 1) LIBRARY declarations: Con ...
- 新书《计算机图形学基础(OpenGL版)》PPT已发布
为方便有些老师提前备课,1-10章所有章节已发布到本博客中. 欢迎大家下载使用,也欢迎大家给我们的新书反馈与意见,谢谢!
- 读书笔记「Python编程:从入门到实践」_4.操作列表
4.1 遍历整个列表 4.1.1 深入地研究循环 4.1.2 在for循环中执行更多的操作 4.1.3 在for循环结束后执行一些操作 例 magicians = ['alice', ' ...
- 作业07之《MVC模式》
MVC(Model View Controller)模型-视图-控制器 MVC与模板概念的理解 MVC本来是存在于Desktop程序中的,M是指数据模型,V是指用户界面,C则是控制器.使用MVC的目的 ...
- post请求获取json数据 解析json数据
<script> window.onload = function () { var str; // console.log(@ViewBag.ID); $.post("/Ser ...
- 关于图片和auido预加载
预加载老生常谈: funtion preLoadImages(imageArr){ var self = this; var newimages=[], loadedimages=0 var post ...
- Scala语言学习笔记——方法、函数及异常
1.Scala 方法及函数区别 ① Scala 有方法与函数,二者在语义上的区别很小.Scala 方法是类的一部分,而函数是一个对象可以赋值给一个变量.换句话来说在类中定义的函数即是方法 ② Scal ...
- 修复Thinkphp框架5.0和5.1版本的远程代码执行安全漏洞
由于框架对控制器名没有进行足够的检测会导致在没有开启强制路由的情况下可能的getshell漏洞.最直接的影响为index.php直接被篡改成首页html的内容! 5.0版本 thinkphp/libr ...
- 最佳实践 | 源码升级gcc
1.下载升级包所需软件 boost_1_60_0.tar.gz http://www.boost.org/users/history/version_1_60_0.html gcc-4.8.0.tar ...