ZUST蓝桥杯校内选拔赛(java,c)安吉校区

举报
小哈里 发表于 2022/05/11 00:51:38 2022/05/11
【摘要】 序(暂存) 蓝桥杯分为校内模拟赛(10题)->省赛(6题)->国赛(6题)三场按照难度分为A组(重点),B组(本科)和C组(专科)按照类型分为软件组(C,Java,Python)和电子组(开...

序(暂存)

  • 蓝桥杯分为校内模拟赛(10题)->省赛(6题)->国赛(6题)三场
  • 按照难度分为A组(重点),B组(本科)和C组(专科)
  • 按照类型分为软件组(C,Java,Python)和电子组(开发)

省赛时间:每年的3月份下旬到4月份上旬左右
国赛时间:每年的5月份左右
比赛时长:四个小时

比赛规则:
蓝桥杯比赛跟天梯赛、ACM还不太一样,比赛中提交的答案并没有反馈机制,也就是说你提交了答案以后,自己并不知道是对是错,就像考试一样,只有交了卷,成绩下来以后才能知道自己的奖项。
获奖比例:
省赛每个组别设置一、二、三等奖,比例分别为10%、20%、30%,总比例为实际参赛人数的60%,零分卷不得奖。省赛一等奖选手获得直接进入全国总决赛资格。
国赛个人赛根据相应组别分别设立特、一、二、三等奖及优秀奖。在决赛奖项设置中,每个组别设置特等奖1名,一等奖不高于5%,二等奖占20%,三等奖不低于25%,优秀奖不超过50%, 零分卷不得奖。

1.题目设置
蓝桥杯的题目并不像ACM那样都是编程题,前面会有几道填空题。
2.知识点
蓝桥杯涉及的算法基本上不多,每次基本上就有一两道是算法题,思维题偏多。

T1-T5

吐槽一下,说好的打四个小时,害得我又请假又没吃饭的,结果一个小时做完了没事干。。
而且蓝桥的dev5.4得先卸载了本地的dev5.1才能装的上去,还有模拟赛竟然不用摄像头,,

800
81
12
1001
BYS

附T4:
2021
n2=1000
2*n2+n1+1==n0+n1+n2
n0=n2+1
n0=n2+1=1001

T6-T10

//T6
#include<iostream>
#include<string>
using namespace std;
int main(){
	string s;  cin>>s;
	int t = s.size()%3;
	for(int i = 0; i < t; i++)
		cout<<s[i];
	cout<<",";
	int cnt = 0;
	for(int i = t; i < s.size(); i++){
		cout<<s[i];
		cnt++;
		if(cnt==3 && i!=s.size()-1){
			cout<<",";
			cnt = 0;
		}
	}
	return 0;
}

  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
//T7
#include<iostream>
#include<string>
using namespace std;
int main(){
	int n, p;
	cin>>n>>p;
	int t = n/p;
	if(n%p!=0)t+=1;
	cout<<t<<"\n";
	return 0;
}


  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
//T8
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int a[1010][1010], b[1010][1010];
int main(){
	int n, m;
	cin>>n>>m;
	for(int i = 1; i <= n; i++)
		for(int j = 1; j <= m; j++)
			cin>>a[i][j];
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= m; j++){
			for(int dx = -1; dx <= 1; dx++){
				for(int dy = -1; dy <= 1; dy++){
					if(i+dx<1 || i+dx>n || j+dy<1 || j+dy>m)continue;
					b[i][j] = max(b[i][j],a[i+dx][j+dy]);
				}
			}
		}
	}
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= m; j++){
			cout<<b[i][j]<<" ";
		}
		cout<<"\n";
	}
	return 0;
}


  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
//T9

/*
A+B+C
A+BC
B+AC
C+AB
ABC
*/
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
int main(){
	int n;  cin>>n;
	vector<int>A,B,C,AB,AC,BC,ABC;
	for(int i = 1; i <= n; i++){
		int w;  string s;  cin>>w>>s;
		int a=0, b=0, c=0;
		if(s.find('A')!=string::npos)a++;
		if(s.find('B')!=string::npos)b++;
		if(s.find('C')!=string::npos)c++;
		if(a==1)A.push_back(w);
		if(b==1)A.push_back(w);
		if(c==1)A.push_back(w);
		if(a==1 && b==1)AB.push_back(w);
		if(a==1 && c==1)AC.push_back(w);
		if(b==1 && c==1)BC.push_back(w);
		if(a==1 && b==1 && c==1)ABC.push_back(w);
	}
	if(A.size()!=0)sort(A.begin(),A.end());
	if(B.size()!=0)sort(B.begin(),B.end());
	if(C.size()!=0)sort(C.begin(),C.end());
	if(AB.size()!=0)sort(AB.begin(),AB.end());
	if(AC.size()!=0)sort(AC.begin(),AC.end());
	if(BC.size()!=0)sort(BC.begin(),BC.end());
	if(ABC.size()!=0)sort(ABC.begin(),ABC.end());
	int ans = 10000000;
	if(A.size()!=0 && B.size()!=0 && C.size()!=0)ans = min(ans, A[0]+B[0]+C[0]);
	if(A.size()!=0 && BC.size()!=0)ans = min(ans, A[0]+BC[0]);
	if(B.size()!=0 && AC.size()!=0)ans = min(ans, B[0]+AC[0]);
	if(C.size()!=0 && AB.size()!=0)ans = min(ans, C[0]+AB[0]);
	if(ABC.size()!=0)ans = min(ans, ABC[0]);
	if(ans == 10000000)cout<<"-1\n";
	else cout<<ans<<"\n";
	return 0;
}



  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
//T10-dfs

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
const int mod = 1000007;
const int maxn = 1010;
int a[maxn], f[maxn][20];
int n, k, ans = 0;
void dfs(int cur, int now){
	if(now == k){
		ans++;
		ans %= mod;
		return ;
	}
	if(cur == n){
		return ;
	}
	for(int i = cur+1; i <= n; i++){
		if(a[i]>a[cur])dfs(i,now+1);
	}
}
int main(){
	cin>>n>>k;
	for(int i = 1; i <= n; i++)cin>>a[i];
	ans = 0;
	for(int i = 1; i <= n; i++){
		dfs(i,1);
	}
	cout<<ans<<"\n";
	return 0;
}


  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
//T10-dp


#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
const int mod = 1000007;
const int maxn = 10010;
int a[maxn], f[20][maxn];
int n, k, ans = 0;
int main(){
	cin>>n>>k;
	int _mx=0;
	for(int i = 1; i <= n; i++){ cin>>a[i]; _mx=max(_mx,a[i]);}
	for(int i = 1; i <= n; i++){
		f[1][a[i]]++;
		for(int j = 2; j <= k; j++){
			for(int c=0; c<a[i]; c++){
				f[j][a[i]] += f[j-1][c];
				f[j][a[i]] %= mod;
			}
		}
	}
	for(int i = 0; i <= _mx; i++)
		ans = (ans+f[k][i])%mod;
	cout<<ans<<"\n";
	return 0;
}


  
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

文章来源: gwj1314.blog.csdn.net,作者:小哈里,版权归原作者所有,如需转载,请联系作者。

原文链接:gwj1314.blog.csdn.net/article/details/114547580

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。