当前位置:网站首页>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;
}
边栏推荐
猜你喜欢
随机推荐
Browser listens for tab closing
中非合作论坛非洲产品电商推广季启动 外交部:推动中非合作转型升级
阿里面试官:聊聊如何格式化Instant
9 椭圆曲线密码体制
单元测试是什么?怎么写?主要测试什么?
Task Scheduler 计划定时任务,修改时报错: One or more of the specified arguments are not valid
网工知识角|华为网络工程师,华为、华三、思科设备三层交换机如何使用三层接口?命令敲起来
2022河南萌新联赛第(四)场:郑州轻工业大学 G - 迷宫
v-on指令:为元素绑定事件
【动态规划--01背包】HJ16 购物单
SeleniumWebDriver扩展插件开发
lc marathon 8.2
Oracle EMCC可以独立安装吗?还是必须安装到数据库服务器上?
基于Streamlit的YOLOv5ToX模型转换工具(适用YOLOv5训练出来的模型转化为任何格式)
安装ambari
找不到符号@SuperBuilder,你以为真的是Lombok的问题?
【 original 】 Auto. Js the get and post case
(2022牛客多校五)G-KFC Crazy Thursday(二分+哈希)
How to write test cases in software testing technology (2)
基于 jetpack compose,使用MVI架构+自定义布局实现的康威生命游戏









