
蓝桥杯
NCY_92377
Far from being a good programmer
展开
-
全球变暖
你有一张某海域NxN像素的照片,"."表示海洋、"#"表示陆地,如下所示:........##.....##........##...####....###........其中"上下左右"四个方向上连在一起的一片陆地组成一座岛屿。例如上图就有2座岛屿。 由于全球变暖导致了海面上升,科学家预测未来几十年,岛屿边缘一个像素的范围会被海水淹没。具体来说如果一块陆地像素与海洋相邻...原创 2019-03-19 19:14:48 · 439 阅读 · 0 评论 -
动态规划经典问题(1)
1.Pell数列 计蒜客T1207#include <iostream>#include <bits/stdc++.h>using namespace std;int dp[1000005];int main(){ int t,k; dp[1] = 1; dp[2] = 2; cin >> t; whi...原创 2019-03-23 15:04:52 · 1639 阅读 · 0 评论 -
高精度加法与乘法
高精度加法:高精度乘法:见链接:http://www.doc88.com/p-3397484077379.html原创 2019-03-23 10:48:40 · 316 阅读 · 0 评论 -
蓝桥杯B组2018-3 乘积尾零
#include <iostream>#include <bits/stdc++.h>using namespace std;int cnt_2;int cnt_5;void detach(int n){ while(n%2==0){ cnt_2++; n /= 2; } while(n%5==0){...原创 2019-03-18 19:55:50 · 300 阅读 · 0 评论 -
2019-3-24第十届蓝桥杯-有感而发
作为一个大三考研狗,这可能是最后一次蓝桥杯了叭~虽然这也是第二次还是记录一下感想吧看到题目第一感觉是比以前都简单了些(当然也有可能是我变强了呢第一题:就是计算最大和,注意不能有重复的,第一遍手算没问题,后来第二遍检查再算的时候差点出错了~其实不该在这种题上浪费时间的啊==应该一遍仔细快速的做完第二题:这道题困扰住我了orz 可能是真菜吧 打草稿的时候完全思绪接近混乱 第一遍算出BA...原创 2019-03-24 21:47:03 · 2115 阅读 · 8 评论 -
递归经典问题(1)-简单题
简单计算:1.阶乘n!int factorial(int n){ if(n<=1) return n; return n*factorial(n-1);}阶乘(非递归方法):int factorial(int n){ int sum = 1; while(n>1){ sum*=n; n--; ...原创 2019-03-20 22:02:58 · 3327 阅读 · 0 评论 -
黄金连分数
斐波那契数列(Fibonacci sequence),又称黄金分割数列;当n趋向于无穷大时,前一项与后一项的比值越来越逼近黄金分割0.618(或者说后一项与前一项的比值小数部分越来越逼近0.618);#include <iostream>#include <bits/stdc++.h>using namespace std;typedef long lon...原创 2019-03-20 19:04:02 · 664 阅读 · 0 评论 -
生日蜡烛
#include <iostream>#include <bits/stdc++.h>using namespace std;int main(){ int sum = 0; for(int i = 1; i <= 100; i++){ sum = 0; for(int j = i; j <= 100;...原创 2019-03-19 20:48:21 · 132 阅读 · 0 评论 -
凑算式
#include <iostream>#include <bits/stdc++.h>using namespace std;int ans = 0;bool vis[10];int p[10];bool judge(){ int A,B,C,D,E; A = p[1]; B = p[2]; C = p[3]; D...原创 2019-03-19 20:41:26 · 178 阅读 · 0 评论 -
搜索(DFS,BFS)
1.计蒜客T1211-红与黑非常简单经典的DFS#include <iostream>#include <bits/stdc++.h>using namespace std;char a[21][21];int ans = 0;bool vis[21][21];int w,h;int dx[] = {-1,0,1,0};int dy[] = {...原创 2019-03-23 19:24:24 · 250 阅读 · 0 评论