当前位置:网站首页>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;
}边栏推荐
- Custom throttling function six steps to deal with complex requirements
- Optimization of streaming media technology
- MySQL Foundation
- 洛谷_P2010 [NOIP2016 普及组] 回文日期_折半枚举
- CADD course learning (4) -- obtaining proteins without crystal structure (Swiss model)
- Dishes launcher small green program and directory management (efficiency tool)
- Interpretation of new plug-ins | how to enhance authentication capability with forward auth
- Master the development of facial expression recognition based on deep learning (based on paddlepaddle)
- Agnosticism and practice makes perfect
- Load balancing cluster (LBC)
猜你喜欢

Container runtime analysis

MySQL Foundation

Practical series - free commercial video material library

Chinatelecom has maintained a strong momentum in the mobile phone user market, but China Mobile has opened a new track

Matlab 信号处理【问答笔记-1】

Happy Lantern Festival, how many of these technical lantern riddles can you guess correctly?

PR FAQ, what about PR preview video card?

哪些软件可以整篇翻译英文论文?

JSON data transfer parameters

Architecture: load balancing
随机推荐
Digital collection trading website domestic digital collection trading platform
Happy Lantern Festival, how many of these technical lantern riddles can you guess correctly?
哪些软件可以整篇翻译英文论文?
JDBC教程
Improvement of RTP receiving and sending PS stream tool (II)
顶级 DevOps 工具链大盘点
Fusion de la conversion et de la normalisation des lots
Dishes launcher small green program and directory management (efficiency tool)
TypeError: Cannot read properties of undefined (reading ***)
开发知识点
来自数砖大佬的 130页 PPT 深入介绍 Apache Spark 3.2 & 3.3 新功能
Bean加载控制
Digital twin smart factory develops digital twin factory solutions
返回二叉树两个节点间的最大距离
MySQL Foundation
[OJ] intersection of two arrays (set, hash mapping...)
直击产业落地!飞桨重磅推出业界首个模型选型工具
MFC 获取当前时间
洛谷_P2010 [NOIP2016 普及组] 回文日期_折半枚举
开源了 | 文心大模型ERNIE-Tiny轻量化技术,又准又快,效果全开