当前位置:网站首页>Luogu_ P2010 [noip2016 popularization group] reply date_ Half enumeration
Luogu_ P2010 [noip2016 popularization group] reply date_ Half enumeration
2022-07-03 00:13:00 【This question AC sleep again】
Luogu _P2010 [NOIP2016 Popularization group ] Palindrome date _ Half enumeration


//
#include<bits/stdc++.h>
using namespace std;
// 1 2 3 4 5 6 7 8 9 10 11 12
int mon[]={ 0,31,28,31,30,31,30,31,31,30,31,30,31 };
bool is_leap( int a )
{
return ( a%4==0 && a%100 || a%400==0 );
}
bool f( int a,int b,int c )
{
// cout<<a<<" "<<b<<" "<<c<<endl;
if( !( b>=1 && b<=12 ) ) return false; // b
int tt=mon[b];
if( b==2 ) tt+=is_leap(a);
return ( c>=1 && c<=tt ); // c
}
int main()
{
int x,y,t,tt,i,ans;
while( cin>>x>>y )
{
ans=0;
for( i=x/10000;i<=y/10000;i++ ) // tx ty Easy and behind x y confusion
{
t=i; tt=0;
while( t ) // Half Flip the year to ensure palindromes
{
tt=tt*10+t%10;
t/=10;
} // Before and after the cross-border should be judged
if( i<=x/10000 && tt<x%10000 || i>=y/10000 && tt>y%10000 ) continue;
if( f( i,tt/100,tt%100 ) ) ans++;
}
cout<<ans<<endl;
}
return 0;
}边栏推荐
- Load balancing cluster (LBC)
- yolov5detect. Py comment
- AcWing_188. 武士风度的牛_bfs
- Happy Lantern Festival, how many of these technical lantern riddles can you guess correctly?
- Chapter 4 of getting started with MySQL: data types stored in data tables
- MATLAB signal processing [Q & a notes-1]
- leetcode 650. 2 Keys Keyboard 只有两个键的键盘(中等)
- Use of cocospods
- 秒杀系统设计
- 【OJ】两个数组的交集(set、哈希映射 ...)
猜你喜欢
![洛谷_P2010 [NOIP2016 普及组] 回文日期_折半枚举](/img/a3/55bb71d39801ceeee421a0c8ded333.png)
洛谷_P2010 [NOIP2016 普及组] 回文日期_折半枚举

Digital twin visualization solution digital twin visualization 3D platform

67页新型智慧城市整体规划建设方案(附下载)

程序分析与优化 - 9 附录 XLA的缓冲区指派

Xcode real machine debugging

What are the projects of metauniverse and what are the companies of metauniverse

JDBC練習案例

实用系列丨免费可商用视频素材库

Container runtime analysis

接口差异测试——Diffy工具
随机推荐
JS interviewer wants to know how much you understand call, apply, bind no regrets series
[reading notes] phased summary of writing reading notes
MFC gets the current time
35页危化品安全管理平台解决方案2022版
In February 2022, the ranking list of domestic databases: oceanbase regained its popularity with "three consecutive increases", and gaussdb is expected to achieve the largest increase this month
请求与响应
Linux 下安装 redis
Returns the maximum distance between two nodes of a binary tree
sourcetree 详细
95 pages of smart education solutions 2022
顶级 DevOps 工具链大盘点
130 pages of PPT from the brick boss introduces the new features of Apache spark 3.2 & 3.3 in depth
Hit the industry directly! The propeller launched the industry's first model selection tool
Integration of revolution and batch normalization
英文论文有具体的格式吗?
来自数砖大佬的 130页 PPT 深入介绍 Apache Spark 3.2 & 3.3 新功能
秒杀系统设计
How much do you know about synchronized?
返回二叉树中最大的二叉搜索子树的大小
[ml] Li Hongyi III: gradient descent & Classification (Gaussian distribution)