当前位置:网站首页>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;
}
边栏推荐
猜你喜欢

log4j设置日志的时区

I ported GuiLite to STM32F4 board

Shenzhen Offline Registration|StarRocks on AWS: How to conduct rapid and unified analysis of real-time data warehouses

百度超级链:鼓励企业做自己的链

自考六级雅思托福备战之路

道通转债,微芯转债,博22转债上市价格预测

高等代数_笔记_配方法标准化二次型

ESP8266-Arduino编程实例-MCP3008-ADC转换器驱动

高等代数_证明_矩阵乘以自身的转置的特征值不小于0

v-on指令:为元素绑定事件
随机推荐
浏览器监听标签页关闭
vscode hide activity bar
找不到符号@SuperBuilder,你以为真的是Lombok的问题?
【无标题】2022-7-24
Base64编码原理
Oracle EMCC可以独立安装吗?还是必须安装到数据库服务器上?
WinForm(二):WinFrom中Main函数的入参和出参
Pro * C Jin Cang database migration guide (4) KingbaseES Pro * C migration guide)
Smart fitness gesture recognition: PP - TinyPose build AI virtual trainer!
22 ES6 knowledge points
Summary of some questions about the grain mall
数值类型转换02
记录一些遇见的bug——mapstruct和lombok同时使用时,转换实体类时数据丢失问题
js Fetch返回数据res.json()报错问题
AF-DNAT
积分商城可设置的四种兑换商品类型
汇编题答案
肖sir___面试就业课程____app
DC-3靶场搭建及渗透实战详细过程(DC靶场系列)
工程水文学试题库