当前位置:网站首页>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;
}
边栏推荐
猜你喜欢
Bean load control
Talk with the interviewer about the pit of MySQL sorting (including: duplicate data problem in order by limit page)
maya渔屋建模
Digital twin visualization solution digital twin visualization 3D platform
[Verilog tutorial]
Many to one, one to many processing
Open Source | Wenxin Big Model Ernie Tiny Lightweight Technology, Accurate and Fast, full Open Effect
67 page overall planning and construction plan for a new smart city (download attached)
[ml] Li Hongyi III: gradient descent & Classification (Gaussian distribution)
Practical series - free commercial video material library
随机推荐
[shutter] shutter photo wall (center component | wrap component | clickrrect component | stack component | positioned component | button combination component)
Architecture: database architecture design
Architecture: load balancing
大学生课堂作业2000~3000字的小论文,标准格式是什么?
Should you study kubernetes?
接口差异测试——Diffy工具
Open Source | Wenxin Big Model Ernie Tiny Lightweight Technology, Accurate and Fast, full Open Effect
67 page overall planning and construction plan for a new smart city (download attached)
JVM foundation review
哪些软件可以整篇翻译英文论文?
[shutter] open the third-party shutter project
Unique line of "Gelu"
Realization of mask recognition based on OpenCV
Improvement of RTP receiving and sending PS stream tool (II)
Chapter 3 of getting started with MySQL: database creation and operation
QT 如何将数据导出成PDF文件(QPdfWriter 使用指南)
TypeError: Cannot read properties of undefined (reading ***)
Judge whether the binary tree is full binary tree
Open source | Wenxin big model Ernie tiny lightweight technology, which is accurate and fast, and the effect is fully open
Installing redis under Linux