当前位置:网站首页>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;
}
边栏推荐
- 基于flowable的upp(统一流程平台)运行性能优化(3)
- 高等代数_证明_不同特征值的特征向量线性无关
- t条件判断语句与if循环
- Summary of some questions about the grain mall
- easyswoole的mysqli 事务怎么写
- ESP8266-Arduino编程实例-MCP3008-ADC转换器驱动
- 2022河南萌新联赛第(四)场:郑州轻工业大学 G - 迷宫
- 找不到符号@SuperBuilder,你以为真的是Lombok的问题?
- 正则表达式与绕过案例
- Jincang Database Pro*C Migration Guide ( 5. Program Development Example)
猜你喜欢
随机推荐
ClickHouse - Getting Started
How to write test cases in software testing technology (2)
lc marathon 8.2
工程制图第九章作业
种草一个让程序员男友编程时,记住一辈子的 IDEA 神仙插件!
synchronized原理
ClickHouse uninstall and reinstall
DC-3靶场搭建及渗透实战详细过程(DC靶场系列)
leetcode刷题学习之路
视频中场的概念(1080I和1080P)和BT601/656/709/1120/2020/2077
voliate关键字
v-on指令:为元素绑定事件
flink sql任务变更,在sql里面增加几个字段后,从以前保存的savepoint恢复启动出错。
easyswoole的mysqli 事务怎么写
ClickHouse delete table
urlencode 和rawurlencode的区别
电子设备行业智能供应链系统:打破传统供应链壁垒,提升电子设备企业管理效能
寄存器(内存访问)
测开:项目管理模块-项目curd开发
js Fetch返回数据res.json()报错问题