Fork me on GitHub
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 26 下一页
摘要: 题目, 我觉得最简单的方法就是用四个for循环把他解出来,一个一个枚举,用两个矩阵进行保存 public class Main { public void gameOfLife(int[][] board) { int length = board.length;// 得到数组的长 int wide 阅读全文
posted @ 2019-07-08 10:47 cznczai 阅读(255) 评论(0) 推荐(0) 编辑
摘要: 一个N位的十进制正整数,如果它的每个位上的数字的N次方的和等于这个数本身,则称其为花朵数。 例如: 当N=3时,153就满足条件,因为 1^3 + 5^3 + 3^3 = 153,这样的数字也被称为水仙花数(其中,“”表示乘方,53表示5的3次方,也就是立方)。 当N=4时,1634满足条件,因为 阅读全文
posted @ 2019-07-08 10:44 cznczai 阅读(586) 评论(0) 推荐(0) 编辑
摘要: 如释重负 自己看了很多视频自己手写出自己的java版本的nqueen问题 get 以下是自己的解法: import java.util. ; import java.math. ; public class Main { public void Nqueen(int i, int n, int ar 阅读全文
posted @ 2019-07-08 10:41 cznczai 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 2 n 的原因 class Solution { int count; boolean bool_col[]; boolean bool_x[]; boolean bool_y[]; int n; public int totalNQueens(int _n) { n = _n ; count = 阅读全文
posted @ 2019-07-08 10:39 cznczai 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 本人解法 ~略麻烦 其他的解法 有点简单~~~~ 不用采用A~Z保存在一个数组中 最牛逼的一行解决 阅读全文
posted @ 2019-07-08 10:36 cznczai 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 本人的解法: public class Main { public int trap(int[] height) { // 统计雨水总数//temp登记最大值 int sum = 0; if (height.length != 0) { int temp = height[0]; int temp2 阅读全文
posted @ 2019-07-08 10:34 cznczai 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 本人先讲自己比较笨的 方法 package homework; public class Main { public String convert(String s, int numRows) { int length = s.length(), x = 0, y = 0; String arr[] 阅读全文
posted @ 2019-07-08 10:30 cznczai 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 题目描述 已知:S_n= 1+1/2+1/3+…+1/nSn​=1+1/2+1/3+…+1/n。显然对于任意一个整数KK,当nn足够大的时候,S_nSn​大于KK。 现给出一个整数KK(1 \le k \le 151≤k≤15),要求计算出一个最小的nn;使得S_n KSn​ K。 输入输出格式 输 阅读全文
posted @ 2019-07-08 10:28 cznczai 阅读(1028) 评论(0) 推荐(0) 编辑
摘要: 题目描述 将1,2,⋯,9共9个数分成3组, 分别组成3个三位数,且使这3个三位数构成1:2:3的比例,试求出所有满足条件的3个三位数。 输入输出格式 输入格式: 木有输入 输出格式: 若干行,每行3个数字。按照每行第1个数字升序排列。 阅读全文
posted @ 2019-07-08 10:27 cznczai 阅读(664) 评论(0) 推荐(0) 编辑
摘要: The first big overhaul for Facebook came in 2012 14.Internet users were carrying out ever more tasks on smartphones rather than desktop or laptop comp 阅读全文
posted @ 2019-07-08 10:14 cznczai 阅读(400) 评论(0) 推荐(0) 编辑
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 26 下一页