当前位置:网站首页>Ccf-csp 201503-3 Festival
Ccf-csp 201503-3 Festival
2022-06-09 02:42:00 【Confident little screw】
Original link :CCF-CSP 201503-3 festival 
#include <bits/stdc++.h>
using namespace std;
vector<int> mon={
0,31,28,31,30,31,30,31,31,30,31,30,31};
bool isrun(int y)
{
if((y%4==0 && y%100!=0) || y%400==0) return true;
return false;
}
int dayofweek(int y,int m,int d)
{
int sum=0;
int p=1850;
while(p<y)
{
if(isrun(p)) sum+=366;
else sum+=365;
p++;
}
for(int i=1;i<m;i++)
{
sum+=mon[i];
if(isrun(y) && i==2) sum++;
}
sum+=d;
return (sum+1)%7;
}
int main()
{
std::ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int a,b,c,y1,y2;
cin>>a>>b>>c>>y1>>y2;
if(c==7) c=0;
while(y1<=y2)
{
int m=mon[a];
if(isrun(y1) && a==2) m++;
int num=0,f=0;
for(int i=1;i<=m;i++)
{
if(dayofweek(y1,a,i)==c) num++;
if(num==b)
{
f=1;
cout<<y1<<"/";
cout<<setw(2)<<setfill('0')<<a<<"/";
cout<<setw(2)<<setfill('0')<<i<<endl;
break;
}
}
if(f==0) cout<<"none"<<endl;
y1++;
}
return 0;
}
边栏推荐
- LocalTime 、LocalDate 、LocalDateTime
- The latest investment report of animoca brands: 340+ investment projects, with a total investment of US $1.5 billion and a total reserve capital of more than 5billion
- Ccf-csp 201803-3 URL mapping 100 points
- Reflection principle and application in C #
- New textbook for self taught examination-p292
- Go Technology Daily (June 7, 2022) - go programmer development efficiency artifact summary
- One month soft test | experience sharing of intermediate test for software designers (with learning materials)
- 杰理之SPI 从机如何配置驱动程序?【篇】
- Should flying books be ecological? Analyze the first independent SaaS case of all in flybook
- 【编码推流】SRS流媒体服务器安装及使用
猜你喜欢

Redis data storage
![[coding streaming] installation and use of SRS streaming media server](/img/8a/e3462db8425377d32ec2ef22c1ccf3.png)
[coding streaming] installation and use of SRS streaming media server

Basic method of missing data filling (3) -- multiple imputation by chained equations (mice)

Tiflash source code reading (III) design and implementation analysis of tiflash deltatree storage engine - Part 1

蓝桥杯_青蛙的约会_扩展欧几里得

Leetcode 560. And is the prefix and of the subarray of K

Karmada v1.2 release: open a new era of full-text search

Ccf-csp 201903-1 small, medium and large

(10.3)【隐写缓解】隐写防护、隐写干扰、隐写检测

New textbook for self taught examination-p292
随机推荐
Under what circumstances do you need to find a third-party testing agency to do software testing?
杰理之若用户不需要使用所有的按键,其他按键应该如何设置?【篇】
How does JVM handle exceptions? The principle that finally blocks must execute?
gradle 查看某个包的依赖树
Docker安装Redis
[MySQL from Xiaobai to expert] Part 6: transaction and JDBC programming in MySQL
Acwing 792 high precision subtraction
The high-end is weak. Can Yanghe still keep the third place in the industry?
Exclusive application for consumer finance license by Weixin Jinke failed
Qt: get sender in slot (the control that triggers signal)
飞书要不要做生态?剖析第一家 All in 飞书的独立 SaaS 案例
蓝桥杯_丢番图方程
Common commands for detecting Huawei network devices
How does Jerry's SPI host configure the driver? [chapter]
Go to MFC from Win32
蓝桥杯_青蛙的约会_扩展欧几里得
qt重载的信号槽函数绑定方式
SQLite3 syntax (2)
【网络协议】| 【01】网络字节序大端、小端
C# 类和对象