当前位置:网站首页>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;
}
边栏推荐
- v-on指令:为元素绑定事件
- Guys, I don't understand a bit: why the documentation of oracle-cdc writes that the connector can be done exactly-o
- 基于Streamlit的YOLOv5ToX模型转换工具(适用YOLOv5训练出来的模型转化为任何格式)
- Dialog manager in the fourth chapter: the dialog message loop
- 记录一些遇见的bug——mapstruct和lombok同时使用时,转换实体类时数据丢失问题
- 正则表达式绕过
- MediaRecorder录制屏幕时在部分机型上报错prepare failed:-22
- 基于 jetpack compose,使用MVI架构+自定义布局实现的康威生命游戏
- 肖sir__面试接口测试
- 数字3d虚拟交互展厅顺应时代发展需求和趋势
猜你喜欢
随机推荐
那些让电子工程师崩溃瞬间,你经历了几个呢?
ClickHouse - Getting Started
Mysql如何建立索引实现语句优化
OpenFOAM提取等职面并计算面积
基于 jetpack compose,使用MVI架构+自定义布局实现的康威生命游戏
银微转债,洁特转债上市价格预测
Auto.js Pro write the first script hello world
TCP 和UDP 的详细介绍
肖sir ——自动化讲解
LeetCode算法日记:面试题 03.04. 化栈为队
让环境自己说话,论环境自描述的重要性
GD32学习笔记(3)NAND Flash管理
数字3d虚拟交互展厅顺应时代发展需求和趋势
汇编书摘抄
富瑞宣布战略交易,以简化运营,持续专注于打造领先的独立全服务型全球投行公司
瑞鹄转债上市价格预测
【leetcode热题Hot100】——任务调度器
shell之条件语句(条件测试、if语句,case语句)
Summary of some questions about the grain mall
OpenFOAM extracts equivalency and calculates area