当前位置:网站首页>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;
}边栏推荐
- Realization of mask recognition based on OpenCV
- Happy Lantern Festival, how many of these technical lantern riddles can you guess correctly?
- [reading notes] phased summary of writing reading notes
- How to apply for company email when registering in company email format?
- 流媒体技术优化
- MFC文件操作
- S12. Verify multi host SSH mutual access script based on key
- 程序分析与优化 - 9 附录 XLA的缓冲区指派
- Where can I find foreign papers?
- Chapter 4 of getting started with MySQL: data types stored in data tables
猜你喜欢

Open source | Wenxin big model Ernie tiny lightweight technology, which is accurate and fast, and the effect is fully open

写论文可以去哪些网站搜索参考文献?

Improvement of RTP receiving and sending PS stream tool (II)

Mutual exclusion and synchronization of threads

Maybe you read a fake Tianlong eight

Optimization of streaming media technology

sysdig分析容器系统调用

RTP 接发ps流工具改进(二)

秒杀系统设计

MySQL advanced learning notes (III)
随机推荐
MySQL Foundation
顶级 DevOps 工具链大盘点
Top Devops tool chain inventory
MySQL advanced learning notes (III)
130 pages of PPT from the brick boss introduces the new features of Apache spark 3.2 & 3.3 in depth
sourcetree 详细
leetcode 650. 2 Keys Keyboard 只有两个键的键盘(中等)
Architecture: database architecture design
Speech recognition Series 1: speech recognition overview
MFC文件操作
Convolution和Batch normalization的融合
Installing redis under Linux
zhvoice
Fusion de la conversion et de la normalisation des lots
Digital twin visualization solution digital twin visualization 3D platform
Open Source | Wenxin Big Model Ernie Tiny Lightweight Technology, Accurate and Fast, full Open Effect
MFC gets the current time
MFC file operation
How much do you know about synchronized?
[Verilog tutorial]