暴力出奇迹!#8#9#10测试点在线求调;
查看原帖
暴力出奇迹!#8#9#10测试点在线求调;
846554
XiMeng_2077楼主2023/8/6 16:39

暴力就完了!!!


#include<bits/stdc++.h>
using namespace std;
int op,ed,date1,date2,ans,good;
int days[13] = {0,31,29,31,30,31,30,31,31,30,31,30,31};
int main(){
	cin>>op>>ed;
	for(int i=0;i<=9;i++){
		for(int j=0;j<=9;j++){
			for(int k=0;k<=9;k++){
				for(int l=0;l<=9;l++){
					ans=i*10000000+j*1000000+k*100000+l*10000+l*1000+k*100+j*10+i;
					if(ans>=op&&ans<=ed){
						if(days[l*10+k]>=j*10+i){
							good++;
						}
					}
				}
			}
		}
	}
	cout<<good;
	return 0;
}
2023/8/6 16:39
加载中...