Lruihao

Lruihao's Note

不怕萬人阻擋,只怕自己投降

Lruihao's Github chart

hdu-1241-Oil Deposits (dfs)

1 Oil Deposits翻译 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 41406 Accepted Submission(s): 23977 1.1 Problem DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides the land into numerous square plots. It then analyzes each plot separately, using sensing equipment to determine whether or not the plot contains oil. A plot containing oil is called a pocket. If two pockets are adjacent, then they are part of the same oil deposit. Oil deposits can be quite large and may contain numerous pockets. Your job is to determine how many different oil deposits are contained in a grid. 1.2 InputThe input file contains one or more grids. Each grid begins with a line containing m and

BFS 求最短路

假设有一个 n 行 m 列的迷宫,每个单位要么是空地(用 1 表示)要么是障碍物(用 0 表示).
如和找到从起点到终点的最短路径?利用 BFS 搜索,逐步计算出每个节点到起点的最短距离,
以及最短路径每个节点的前一个节点。最终将生成一颗以起点为根的 BFS 树。此时 BFS 可以求出任意一点到起点的距离。

Educational Codeforces Round 47 (Rated for Div. 2)

那天晚上报名了没打,第二天早上打的,也只出了两题。 1 A. Game Shopping 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 #include<iostream> using namespace std; int main(){ int n,m,s=0; cin>>n>>m; int i,j; int c[1000],a[1000]; for(i=0;i<n;i++) cin>>c[i]; for(i=0;i<m;i++) cin>>a[i]; for(i=0,j=0;i<n;){ if(j==m) break; if(c[i]<=a[j]){ s++; j++; i++; } else i++; } if(i==n&&s==0) cout<<"0\n"; else cout<<s<<endl; return 0; } 2 B. Minimum Ternary String 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 #include <bits/stdc++.h> using namespace std; string s, ans; int main(){ cin >> s;

TaoTao 要吃鸡

2018 年全国多校算法寒假训练营练习比赛(第二场)B(0 1 背包变化 特殊处理一个物品) 链接:https://www.nowcoder.com/acm/contest/74/B 来源:牛客网 1 题目描述Taotao 的电脑带不动绝地求生,所以 taotao 只能去玩 pc 版的荒野行动了,和绝地求生一样,游戏人物本身可以携带一定重量 m

深搜广搜

0.1 广度优先搜索(BFS)广度优先搜索在进一步遍历图中顶点之前,先访问当前顶点的所有邻接结点。访问了就入队。 0.2 深度优先搜索(DFS)深度优先搜索在搜索过程中访问某个顶点后,需要递归地访问此顶点的所有未访问过的相邻顶点。 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

Wannafly 挑战赛 18-序列

时间限制:C/C++ 1 秒,其他语言 2 秒 空间限制:C/C++ 262144K,其他语言 524288K 64bit IO Format: %lld 1 题目描述有一个长度为 n 的序列 a,已知 a[1]=a[n]=1,且对于 2 <= x <= n,a[x] / a[x-1] 是以下三个数字之一 [ 1,-2,0.5 ], 问有多少种不同的序列满足题意。 两个序列不同当且仅当它们有至少一个位置上的数字不

简单背包

弱鸡还是弱鸡啊最简单的背包问题——。——!

1 问题描述

假设有一个能装入总体积为 T 的背包和 n 件体积分别为 W1,W2,···,Wn 的物品,能否从 n 件物品中挑选若干件恰好装满背包,即使 W1+W2+···+Wn=T,要求找出所有满足上述条件的解。例如:当 T=10,共 6 件物品,物品的体积为{1,2,3,4,5,8},那么可找到下列 4 组解:(1,2,3,4)、(1,4,5)、(2,3,5)、(2、8)。

18 湘潭邀请赛参赛队员代表发言

来自一位大佬的演讲 尊敬的领导、教练,亲爱的参赛选手们: 大家好,我是来自广东工业大学的 tmk。今天很荣幸能够站在这里代表全体参赛选手发言,与大家分享我的经历和感受。 刚开始来到大学的时候,我一心向学,本着“好好学习,天天向上,为校争光,不搞对象”的信念,想在大学一展宏图。因为高中 OI 的挫败,我在刚上大学的

18 湘潭邀请赛总结

题目链接(hdu 复赛) 2018 年湘潭邀请赛,在湘大举行,当时一起打的过去的,因为没出市就方便点。第一次参加现场赛,首先反省一下自己,比赛前算法先不说(没有好好搞过),就连普通的题,数学性质的题都很少刷,什么都不会,然后英语不说四六级的东西,很多专业英语词汇都没有好好了解过,主要的原因还是刷题刷少了,英文题
0%