当前位置:网站首页>蓝桥杯2015年CA省赛(填坑中)
蓝桥杯2015年CA省赛(填坑中)
2022-06-29 15:37:00 【华为云】
1、方程整数解
#include<bits/stdc++.h>using namespace std;int main(){ for(int a=1;a<35;a++){ for(int b=1;b<35;b++){ for(int c=1;c<35;c++){ if(a*a+b*b+c*c==1000){ cout<<a<<" "<<b<<" "<<c<<" "<<endl; } } } } return 0;}
答案:10
2、星系炸弹
用excel算的
A1写死为2014-11-9
C1=B1-A1
调整B1直到C1=1000
答案: 2017-08-05
3、奇妙的数字
将平方和立方转换成字符串,拼接字符串,字符串排序,判断字符串是否等于0123456789
#include<bits/stdc++.h>using namespace std;string num2str( double i) { stringstream ss; string s; ss<<i; ss>>s; return s;}int main(){ for(int a=1;a<10000;a++){ int b=a*a; int c=a*a*a; string temp=num2str(b)+num2str(c); sort(temp.begin(),temp.end()); if(temp=="0123456789"){ cout<<a<<endl; return 0; } } return 0;}
答案:69
6、牌型种数
想到的是高中数学题目排列组合的知识
模糊的记得大概是这样
DFS写法
#include<bits/stdc++.h>using namespace std;int pais[13];vector<int> path;int ans=0;int countof(vector<int> path,int pai){ int count=0; for(int i=0;i<path.size();i++){ if(path[i]==pai){ count++; } } return count;}void dfs(int n,vector<int>&path){ if(n==0){ ans++; return; } for(int i=0;i<13;i++){ if(countof(path,pais[i])<4){ path.push_back(pais[i]); dfs(n-1,path); path.pop_back(); } } } int main(){ for(int i=1;i<=13;i++) { pais[i-1]=i; } dfs(13,path); cout<<ans<<endl;}
7、手链样式
8、饮料换购
模拟即可
#include<bits/stdc++.h>using namespace std;int main(){ int n; cin>>n; int res=n; while(n>=3){ int temp=n/3; n-=(temp*3); n+=(temp); res+=(temp); } cout<<res;}
9、垒骰子
10、
边栏推荐
- swoole TCP 分布式实现
- C. Where‘s the Bishop?
- 小程序判断数据为不为空
- CSDN无法复制问题
- JD health responded that it planned to acquire JD assets with us $355.4 million: related to pet health product category
- TDesign, which gave us benefits last time, will tell us its open source story today
- Houdini图文笔记:VAT(3.0)导入UE4/5的设置向导[官方文档翻译]
- C language homework - matching system
- Volcano engine was selected into the first "panorama of edge computing industry" in China
- When easygbs calls the interface for obtaining real-time snapshots, how to solve the problem of white squares?
猜你喜欢
随机推荐
墨天轮“高可用架构”干货文档分享(含Oracle、MySQL、PG资料124篇)
14.IP协议-bite
如何用好数据科学?
C language big job - Matching System
Alibaba cloud experience Award: use polardb-x and Flink to build a large real-time data screen
关于 麒麟系统启动应用报错“undefined symbol: __cxa_throw_bad_array_new_length, version Qt_5“ 的解决方法
PostgreSQL source code learning (25) -- transaction log ⑥ - wait for log writing to complete
等保测评结论为差,是不是表示等保工作白做了?
微信公告号自动回复使用图灵机器人实现智能回复
11.应用层数据传输格式/端口号-bite
Cmake learning-2
12.UDP协议-bite
Polarimetric SAR surface classification
13.TCP-bite
three.js和高德地图结合引入obj格式模型-效果演示
"Game engine shallow in shallow out" 98 Substancepainer plug-in development
京东健康回应拟以 3.554 亿美元收购京东资产:与宠物健康产品品类相关
JD health responded that it planned to acquire JD assets with us $355.4 million: related to pet health product category
Where has lifeifei reached in his key "embodied intelligence"?
架构实战营模块五作业