首页 > 编程知识 正文

第十届蓝桥杯比赛题目,第十届蓝桥杯嵌入式省赛题目

时间:2023-05-05 01:28:52 阅读:10228 作者:4209

前言复习…我是a组,但我认为b组的主题也值得一看。 而且,a、b组有一些相似之处。

蓝桥的刷问题聚集在一起

请参阅:

蓝桥杯省比赛C/C ABC小组问题解决(第4届~第12届) )。

2021年第12届蓝桥杯省赛b组丙/丙问题解决

2021年第12届蓝桥杯C B集团省赛个人问题解决

问题a空间

# includeiostreamusingnamespacestd; int main () {long long n=256; cout n * 1024 * 1024/4 endl; //67108864}答案: 67108864

问题f时间显示问题图片为https://blog.csdn.net/weixin _ 4660078/article/details/115919426

# include iostream # includeiomanipusingnamespacestd; int main () {long long n; cin n; n /=1000; //ms-sn%=(3600*24 ); int hour=n/3600; int min=n/60 % 60; int sec=n % 60; coutsetw(2) setfill('0) ) setiosflags ) IOs33603360right; cout hour ': '; coutsetw(2) setfill) ) min (: ); coutsetw(2) setfill('0) ) sec endl; }在这里为了便于测试,进行了循环。

# include iostream # includeiomanipusingnamespacestd; int main () {long long n; while(CINn ) ) {n /=1000; //ms-sn/=(3600*24 ); int hour=n/3600; int min=n/60 % 60; int sec=n % 60; coutsetw(2) setfill('0) ) setiosflags ) IOs33603360right; cout hour ': '; coutsetw(2) setfill) ) min (: ); coutsetw(2) setfill('0) ) sec endl; }

问题h杨辉三角形问题图片为https://blog.csdn.net/weixin _ 4660078/article/details/115919426

事先贴上他人代码:

# includeiostreamusingnamespacestd; int main () {long long n,res=1; cin n; for(intI=1; I ) {long long j,cnt=1,flag=0; if () I*(I-1 ) )/2 n ) RES=n* ) ) n1 )/2; 布雷克; (if ) CNT==n ) break; for(j=0; j=(I1 )/2; j ) if(CNTn ) break; ELSEif(CNT==n ) {res =j 1; flag=1; 布雷克; } if (标志) break; elseres =i 1; }cout res endl; }

问题I双向排序问题图片为https://blog.csdn.net/QQ _ 35975367/article/details/116277383

暂时只有暴力,后天开始比赛。 不想正确回答…(今后如果有更多的时间,会留下不学无术的眼泪进行qaq ) )。

代码已从:https://局域网. zhi Hu.com/p/366002603中修复

# include iostream # includealgorithmusingnamespacestd; BOLB2SCMP(inta,int b ) {return a b; }boolS2BCMP(inta,int b ) {return a b; //暴力分n*n*lognint main () ({int a[100005]; int n,m; cin n m; for(intI=1; i=n; I ) a(I )=I; while(m-- ) { //1e5int p,q; cin p q; //nlognif(p==0) ) sort ) a1、a q 1、B2Scmp ); (else ) sort ) aq、a n 1、S2Bcmp; //for(intI=1; i=n; //cout a[i] '; //cout endl; }for(intI=1; i=n; I ) {cout a[i]; if(I!=n ) cout ' '; elsecout endl; }

问题j括号序列问题的照片为https://blog.csdn.net/weixin _ 46660078/article/details/115919426

代码源(略有更改) :3359 blog.csdn.net/weixin _ 46660078/article/details/115919426

暂时看不懂…

# include iostream # include cstring # includealgorithmusingnamespacestd; const int mod=1e9 7; const int N=5e3 7; int n; 字符串s; 龙龙DP [ n ] [ n ]; 长期呼叫() memset ) DP,0,sizeof ) ) DP ); dp[0][0]=1; for(intI=1; i=n; I ) if ) s[I-1]==' (' ) ) for(intj=1; j=n; j ) dp[i][j]=dp[i-1][j-1]; else { DP [ I ] [0]=(DP [ I-1 ] [0] DP [ I-1 ] [1] ) % mod; for(intj=1; j=n; j ) DP [ I ] [ j ]=(DP [ I-1 ] [ J1 ] DP [ I ] [ j-1 ] ) % mod; }for(intI=0; i=n; I ) if(DP[n][I] )返回DP [ n ] [ I ]; 返回- 1; (}int main ) ) { cin s; n=s.length (; long long l=cale (; reverse(s.Begin )、s.end ); for(intI=0; i n; I ) if(s(I )==' ) s (I )=' ); else s[i]=' '; long long r=cale (; cout l * r % mod; }

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。