当前位置:网站首页>2022 Henan Mengxin League Game (4): Zhengzhou University of Light Industry E - Sleep Well
2022 Henan Mengxin League Game (4): Zhengzhou University of Light Industry E - Sleep Well
2022-08-03 04:05:00 【WA_ automata】
E - 睡大觉
Because it is converted to the nearest date,So we record a current moment,If the next given time is greater than the current time we can be considered still
这一天,Otherwise go back a day.同时需要注意的是,Because he sleeps at least every time1s,So if it's the same as our current moment, push it back by one as well
天,The next step is to figure out which day is the current day to determine whether the month and day are the same.
#include<bits/stdc++.h>
using namespace std;
int mon[13]={
0,31,28,31,30,31,30,31,31,30,31,30,31};
int main()
{
int y,m,d;scanf("%d-%d-%d",&y,&m,&d);
int q;scanf("%d",&q);
string b="00:00:00";
int res=0;
while(q--)
{
string a;cin>>a;
if(a<=b)
{
d++;
if(m==2)
{
if(y%400==0 || y%4==0&&y%100!=0)
{
if(d>29) d=1,m++;
}
else
{
if(d>28) d=1,m++;
}
}
else
{
if(d>mon[m]) d=1,m++;
}
if(m==13) y++,m=1;
}
if(m%2 == d%2) res++;
b=a;
}
cout<<res<<endl;
return 0;
}
边栏推荐
猜你喜欢
随机推荐
22 ES6 knowledge points
工程制图点的投影练习
数字3d虚拟交互展厅顺应时代发展需求和趋势
解析,强势供应商的管理方法
shell之条件语句(条件测试、if语句,case语句)
(2022牛客多校五)H-Cutting Papers(签到)
Smart fitness gesture recognition: PP - TinyPose build AI virtual trainer!
Kotlin multiplication, how do I multiply smaller and smaller?
【剑指offer】——16.数值的整数次方
【uni-APP搭建项目】
How to write test cases in software testing technology (2)
汇编书摘抄
让环境自己说话,论环境自描述的重要性
HI3521D 烧录128M nand flash文件系统过程-一定要注意flash的容量
利用索引机制进行绕过
一文了解SAP IBP是什么?
视频中场的概念(1080I和1080P)和BT601/656/709/1120/2020/2077
SeleniumWebDriver扩展插件开发
Dialog manager in the fourth chapter: the dialog message loop
js的组成及js样式









