试题A :组队


490

试题B :年号字串

// BYQ
#include <iostream>
#include <algorithm>
using namespace std;int main()
{string res = "";int n = 2019;while (n){n -- ;res += (char)('A' + n % 26);n /= 26;}reverse(res.begin(), res.end());cout << res;
}

试题C :数列求值

// 4659
#include <iostream>
#include <algorithm>
using namespace std;const int N = 3e7;int f[N];int main()
{f[1] = 1;f[2] = 1;f[3] = 1;for (int i = 4; i <= 20190324; i ++ )f[i] = (f[i - 3] + f[i - 2] + f[i - 1]) % 10000;cout << f[20190324];
}

试题D :数的分解

// 40785
#include <iostream>
#include <algorithm>
using namespace std;bool check(int n)
{while (n){int now = n % 10;if (now == 2 || now == 4) return true;n /= 10;}return false;
}int main()
{int res = 0;for (int i = 1; i < 2019; i ++ ){if (check(i)) continue;for (int j = i + 1; j < 2019; j ++ ){if (check(j)) continue;for (int k = j + 1; k < 2019; k ++ ){if (check(k)) continue;if (i + j + k == 2019) res ++ ;}}}cout << res;
}

试题E :迷宫

#include <iostream>
#include <queue>
using namespace std;const int N = 55;struct Point
{int x, y;string road;
};int n = 30, m = 50;
char g[N][N];
bool vis[N][N];
int dx[] = {1, 0, 0, -1}, dy[] = {0, -1, 1, 0};
char op[] = {'D', 'L', 'R', 'U'};void bfs()
{queue<Point> que;vis[0][0] = true;que.push({0, 0, ""});while (que.size()){auto t = que.front(); que.pop();if (t.x == n - 1 && t.y == m - 1){cout << t.road;return ;}for (int i = 0; i < 4; i ++ ){int ax = t.x + dx[i], ay = t.y + dy[i];if (ax < 0 || ax >= n || ay < 0 || ay >= m) continue;if (!vis[ax][ay] && g[ax][ay] == '0'){Point pt = {ax, ay, t.road + op[i]};vis[ax][ay] = true;que.push(pt);}}}
}int main()
{for (int i = 0; i < n; i ++ ){scanf("%s", g[i]);getchar();}bfs();
}

试题F :特别数的和

#include <iostream>
using namespace std;bool check(int x)
{while (x){int now = x % 10;if (now == 2 || now == 0 || now == 1 || now == 9) return true;x /= 10;}return false;
}int main()
{int n; cin >> n;int res = 0;for (int i = 1; i <= n; i ++ ){if (check(i)) res += i;}cout << res;
}

试题G :完全二叉树的权值

#include <iostream>
#include <vector>
using namespace std;vector<int> ve[20];
int ww[20];
int level;int calc(int b)
{int res = 1;for (int i = 1; i <= b + 1; i ++ ) res *= 2;return res - 1;
}int main()
{int n; cin >> n;int power = calc(0);for (int i = 1, w; i <= n && scanf("%d", &w); i ++ ){if (i > power){level ++ ;power = calc(level);}ve[level].push_back(w);}int mx = 0, ans;for (int i = 0; i <= level; i ++ ){for (auto j : ve[i])ww[i] += j;if (ww[i] > mx){mx = ww[i];ans = i;}}cout << ans + 1;
}

试题H :等差数列

#include <iostream>
#include <algorithm>
using namespace std;const int N = 1e5 + 10;int n, a[N];int main()
{scanf("%d", &n);for (int i = 0; i < n && scanf("%d", &a[i]); i ++ );sort(a, a + n);int d = 1e9 + 10;for (int i = 1; i < n; i ++ )d = min(d, a[i] - a[i - 1]);if (d == 0){cout << n;return 0;}printf("%d", (a[n - 1] - a[0]) / d + 1);
}

试题I :后缀表达式

#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;typedef long long ll;const int N = 2e5 + 10;int n, m;
int a[N];int main()
{scanf("%d%d", &n, &m);for (int i = 0; i < n + m + 1 && scanf("%d", &a[i]); i ++ );sort(a, a + n + m + 1);ll res = 0;if (!m){for (int i = 0; i < n + m + 1; i ++ ) res += a[i];}else{res = a[n + m] - a[0];for (int i = 1; i < n + m; i ++ )res += abs(a[i]);}cout << res;
}

试题J :灵能传输


第十届蓝桥杯大赛软件赛省赛 C/C++ 大学B组相关推荐

  1. 2019第十届蓝桥杯大赛软件类省赛C++ C组真题题解

    ============================== 2019-2021蓝桥杯C++ C组真题题解: 2019第十届蓝桥杯大赛软件类省赛C++ C组真题题解 2020第十一届蓝桥杯大赛软件类省 ...

  2. 2019第十届蓝桥杯大赛软件类省赛C++ B组真题题解

    ========================================== 2019-2021蓝桥杯C++ B组真题题解: 2019第十届蓝桥杯大赛软件类省赛C++ B组真题题解 2020第 ...

  3. 蓝桥杯软件类比赛java,第十届蓝桥杯大赛软件类省赛

    第十届蓝桥杯大赛软件类省赛 这些题官网还没有解答的,我主要参考了b站UP主大雪菜的解法(绝大部分题先自己做了一遍),当然也网上查了一些解答,但发现现在网上的一些解法并不正确,希望可以给大家一个参考. ...

  4. 第十届蓝桥杯大赛软件类省赛

    其他组见以下链接. 第十届蓝桥杯所有的题 一.研究生组 试题 A: 立方和 本题总分:5 分 [问题描述] 小明对数位中含有 2.0.1.9 的数字很感兴趣,在 1 到 40 中这样的数包 括 1.2 ...

  5. 2019 第十届蓝桥杯大赛软件类省赛 C/C++ 大学 A 组 【部分题解】

    声明: 这些的答案不是官方答案,都是我自己做的,仅供参考.一起加油 试题 A: 平方和 本题总分:5′5 '5′ [问题描述] 小明对数位中含有 2.0.1.92. 0. 1. 92.0.1.9 的数 ...

  6. 2、数的分解 - 2019年第十届蓝桥杯大赛软件类省赛

    问题 [问题描述] 把 2019 分解成 3 个各不相同的正整数之和,并且要求每个正整数都不包 含数字 2 和 4,一共有多少种不同的分解方法? 注意交换 3 个整数的顺序被视为同一种方法,例如 10 ...

  7. 1、数列求值 - 2019年第十届蓝桥杯大赛软件类省赛

    问题 [问题描述] 给定数列 1, 1, 1, 3, 5, 9, 17, -,从第 4 项开始,每项都是前 3 项的和.求第 20190324项的最后 4 位数字. #include <iost ...

  8. 第十届蓝桥杯大赛软件类省赛 JAVA 大学 A 组

    迷宫 本题总分:10 分 [问题描述] 下图给出了一个迷宫的平面图,其中标记为 1 的为障碍,标记为 0 的为可 以通行的地方. 010000 000100 001001 110000 迷宫的入口为左 ...

  9. 第十届蓝桥杯大赛软件类省赛C++研究生组

    这比赛题目 A 立方和(5,√) B 字串数字(5, √) C 质数(10, √) D 最短路(10, √) E RSA解密(15) F Fibonacci数列与黄金分割(15, √) G 扫地机器人 ...

  10. 第十届蓝桥杯大赛软件类省赛Java大学B组 试题 G: 外卖店优先级

    时间限制: 1.0s 内存限制: 512.0MB 本题总分:20 分 [问题描述] "饱了么"外卖系统中维护着 N 家外卖店,编号 1 ∼ N.每家外卖店都有 一个优先级,初始时 ...

最新文章

  1. 【经验】Lenovo/ThinkPad 进入BIOS的方法汇总
  2. java云应用,JAVA基础教程:云环境下单一应用服务搭建
  3. swagger-bootstrap-ui 1.9.3 发布,i18n及自定义文档支持
  4. 强制卸载软件包linux,强制删除rpm包的方法
  5. 他是浙大 19 岁大一新生,三个月斩获 WWDC 19 奖学金!
  6. CAS方式实现单点登录
  7. [Mongodb] 3.使用mongodb -----------使用compass
  8. sql,linq,lamd比较使用
  9. 小企业会计准则 ——主要账务处理和财务报表(1)
  10. 通过 wordexport插件 js jq 生成word文档 并导出
  11. 北京清大美博节能技术研究院励志人生格言
  12. Go中的MPG模式解析
  13. python基础编程题(一)
  14. 偷偷地告诉学弟学妹们一个高效学习编程的秘密!大学四年悄悄惊艳他们,嘘
  15. 2020.7.25多态、抽象
  16. 当前日期的周一,下周日期,下月日期;批次号生成
  17. shell——forwhileselect
  18. 爷们必看的东西,女生勿入
  19. Windows server 2003怎么安装iis?Windows server 2003安装IIS教程
  20. matlab图像处理-中值滤波原理

热门文章

  1. PHP调用wsdl文件类型的接口代码分享
  2. 采购Invoice校验_事后借记和事后贷记
  3. 使用js实现时钟效果
  4. SM01 事务代码的加锁以及解锁
  5. 从IT人士到IT经理倪应该学会的30 项技能
  6. SAP-ABAP程序发送邮件
  7. SAP 金额在表中的存储及货币转换因子
  8. BAPI:KBPP_EXTERN_UPDATE_CO, TCODE:CJ30/CJ40
  9. java中有哪几种注释方式_在 Java 中, 有多种注释方法,其中 __________ 适用于单行注释。...
  10. 全站仪数据导入电脑_三鼎762R系列全站仪的SD卡传输教程