当前位置:网站首页>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;
}边栏推荐
- Digital twin smart factory develops digital twin factory solutions
- JVM foundation review
- Bean load control
- cocospods 的使用
- Returns the size of the largest binary search subtree in a binary tree
- [shutter] shutter photo wall (center component | wrap component | clickrrect component | stack component | positioned component | button combination component)
- MFC file operation
- Xcode real machine debugging
- Linux 下安装 redis
- 顶级 DevOps 工具链大盘点
猜你喜欢

Additional: token; (don't read until you finish writing...)
![[shutter] shutter open source project reference](/img/3f/b1d4edd8f8e8fd8e6b39548448270d.jpg)
[shutter] shutter open source project reference

Bean load control

接口差异测试——Diffy工具
![[shutter] shutter photo wall (center component | wrap component | clickrrect component | stack component | positioned component | button combination component)](/img/c5/2f65d37682607aab98443d7f1ba775.jpg)
[shutter] shutter photo wall (center component | wrap component | clickrrect component | stack component | positioned component | button combination component)
![洛谷_P1149 [NOIP2008 提高组] 火柴棒等式_枚举打表](/img/4a/ab732c41ea8a939fa0983fec475622.png)
洛谷_P1149 [NOIP2008 提高组] 火柴棒等式_枚举打表

JDBC練習案例

Difference between NVIDIA n card and amda card

JS interviewer wants to know how much you understand call, apply, bind no regrets series
![[ml] Li Hongyi III: gradient descent & Classification (Gaussian distribution)](/img/75/3f6203410dd2754e578e0baaaa9aef.png)
[ml] Li Hongyi III: gradient descent & Classification (Gaussian distribution)
随机推荐
QT 如何将数据导出成PDF文件(QPdfWriter 使用指南)
[error record] the flutter reports an error (could not resolve io.flutter:flutter_embedding_debug:1.0.0.)
Open Source | Wenxin Big Model Ernie Tiny Lightweight Technology, Accurate and Fast, full Open Effect
基于OpenCV实现口罩识别
Explain in detail the process of realizing Chinese text classification by CNN
Chinatelecom has maintained a strong momentum in the mobile phone user market, but China Mobile has opened a new track
Custom throttling function six steps to deal with complex requirements
開源了 | 文心大模型ERNIE-Tiny輕量化技術,又准又快,效果全開
Judge whether the binary tree is full binary tree
开发知识点
直击产业落地!飞桨重磅推出业界首个模型选型工具
Missing number
JSON data transfer parameters
[array] binary search
What are the projects of metauniverse and what are the companies of metauniverse
sourcetree 详细
洛谷_P1149 [NOIP2008 提高组] 火柴棒等式_枚举打表
Difference between NVIDIA n card and amda card
sysdig分析容器系统调用
Wechat applet basic learning (wxss)