题目描述: 方法一:dfs/bfs class Solution: def movingCount(self, m: int, n: int, k: int) -> int: def digitsum(n): ans = 0 while n: ans += n %10 n//=10 return a ...
分类:
其他好文 时间:
2020-04-09 00:29:48
阅读次数:
70
原题点这里 bfs可以实现。这里注意的是,机器人从00出发,我们只要向右,向下走就可以了 public static int movingCount(int m, int n, int k) { int[] dx=new int[] {-1,1,0,0}; int[] dy = new int[]{ ...
分类:
其他好文 时间:
2020-04-08 21:00:42
阅读次数:
77
Problem Description Benny has a spacious farm land to irrigate. The farm land is a rectangle, and is divided into a lot of samll squares. Water pipes ...
分类:
其他好文 时间:
2020-04-08 19:31:25
阅读次数:
68
我太难了 $HDU$ 卡前向星 , $POJ$ 卡 $vector$ 我真的是服了 Description "link" 给定一棵树,要求支持如下操作: $1.$ 单点修改权值 $2.$ 查询经过某点的权值和最大的链 Solution 其实挺简单的吧,就是先一遍 $dfs$ 把树上的权值搞个前缀和 ...
分类:
其他好文 时间:
2020-04-08 10:02:41
阅读次数:
58
#include <bits/stdc++.h> using namespace std; void dfs( int index , int a[] , int n ){ if( index == n ){ for( int i = 0 ; i < n ; i ++ ) cout << a[i]; ...
分类:
其他好文 时间:
2020-04-07 20:57:05
阅读次数:
98
Eight Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 41040 Accepted: 16901 Special Judge Description The 15-puzzle has been around for ove ...
分类:
其他好文 时间:
2020-04-07 20:40:18
阅读次数:
86
"1073. 树的中心" 给定一棵树,树中包含 n 个结点(编号1~n)和 n?1 条无向边,每条边都有一个权值。 请你在树中找到一个点,使得该点到树中其他结点的最远距离最近。 输入格式 第一行包含整数 n。 接下来 n?1 行,每行包含三个整数 ai,bi,ci,表示点 ai 和 bi 之间存在一 ...
分类:
其他好文 时间:
2020-04-07 12:23:11
阅读次数:
119
1.shell的操作命令 hdfs命令有两种风格:hadoop fs、hdfs dfs 两种命令均可使用,效果相同。 1)查看子命令 hadoop fs、hdfs dfs 2)如果查看hdfs或hadoop子命令信息 hdfs dfs -help shellCmd hadoop fs -help s ...
分类:
系统相关 时间:
2020-04-07 00:23:00
阅读次数:
155
hive、Hbase、mysql的区别 1、Hive和HBase的区别 1)hive是sql语言,通过数据库的方式来操作hdfs文件系统,为了简化编程,底层计算方式为mapreduce。 2)hive是面向行存储的数据库。 3)Hive本身不存储和计算数据,它完全依赖于HDFS和MapReduce, ...
分类:
数据库 时间:
2020-04-06 20:39:58
阅读次数:
71