自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 收藏
  • 关注

原创 【无标题】【思特奇杯·云上蓝桥-算法集训营】第1周

1题 跑步训练 问题描述 小明要做一个跑步训练,初始时,小明充满体力,体力值计为 10000。 如果小明跑步,每分钟损耗 600 的体力。 如果小明休息,每分钟增加 300 的体力。 体力的损耗和增加都是 均匀变化的。 小明打算跑一分钟、休息一分钟、再跑一分钟、再休息一分钟……如此循环。 如果某个时刻小明的体力到达 0,他就停止锻炼, 请问小明在多久后停止锻炼。 为了使答案为整数,请以秒为单位输出答案,答案中只填写数,不填写单位。 答案提交 3880 public class Test1 { .

2022-01-12 19:55:47 3011

原创 【无标题】

class Solution { public int equalSubstring(String s, String t, int max) { int n = s.length(); s = " " + s; t = " " + t; char[] ss = s.toCharArray(); char[] tt = t.toCharArray(); int[] sum = new int[n + 1.

2022-01-10 21:16:49 134

原创 【无标题】猜数字游戏

class Solution { public String getHint(String secret, String guess) { int A = 0; int B = 0; List arrSecret = new ArrayList(); List arrGuess = new ArrayList(); if(secret.length() == 1){ if(sec.

2022-01-07 15:34:31 2054

原创 【无标题】

class Solution { public String convert(String s, int numRows) { String str = ""; int h = 0,l = 0,now = 0; if(s == null||numRows < 1){ return str; } if(numRows == 1){ return s; .

2022-01-06 14:49:13 47

原创 【无标题】进制问题

class Solution { public String convertToTitle(int columnNumber) { String str = ""; char c; int y; while(columnNumber > 26){ if(columnNumber % 26 == 0) y = 90; else y = (columnNumber % 26) + 64.

2022-01-04 22:43:26 117

原创 【无标题】错误的集合

classSolution{ publicint[]findErrorNums(int[]nums){ int[]arr=newint[2]; HashSetlist=newHashSet(); for(intnum:nums){ if(list.add(num)==false){ arr[0]=num; } ...

2022-01-03 16:20:30 201

原创 target

class Solution { public int[] twoSum(int[] numbers, int target) { int[] arr = new int[2]; for(int i = 0;i < numbers.length;i++){ arr[0] = i+1; for(int j = i + 1;j < numbers.length;j++){ if(.

2022-01-02 18:53:43 561

原创 回文子序列2

class Solution { public boolean validPalindrome(String s) { int l = 0,r = s.length() - 1; while(l < r){ if(s.charAt(l) != s.charAt(r)){ return isOK(s,l+1,r) || isOK(s,l,r-1) ; } l+.

2021-12-31 23:00:06 2955

原创 【无标题】提莫攻击gogogo

class Solution { public int findPoisonedDuration(int[] timeSeries, int duration) { int[] a = new int[timeSeries.length - 1]; int sum = 0; if(timeSeries.length == 1){ return duration; } else{ ..

2021-12-30 17:35:36 2795

原创 有效代码块问题

class Solution { public boolean checkValidString(String s) { int l = 0; int r = 0; for (int i = 0; i < s.length(); i++) { char tempt = s.charAt(i); if (tempt == '(') { l++; .

2021-12-28 22:26:03 964

原创 【无标题】Java解螺旋排序问题

/** * @author shkstart * @create 2021-12-27-9:59 */ public class Test1227 { public static void main(String[] args){ int a = 10; int i = 0,j = 0; int current = 1; int[][] arr = new int[a][a]; Boolean up = fals.

2021-12-27 15:41:33 108

原创 模拟java中的Math.pow

class Solution { public static double myPow(double x, int n) { if(n < 0){ x = 1/x; n = -n; } return help(x,n); } public static double help(double x,int n){ if(n == 1){ retu.

2021-12-10 22:32:47 344 1

原创 【无标题】从数组里面找缺数

import java.util.HashSet; import java.util.Iterator; import java.util.Set; /** * @author shkstart * @create 2021-12-09-10:27 */ public class Test1209 { public static void main(String[] args) { int[] arr = new int[]{0,1}; int[] arr1.

2021-12-09 10:59:00 399 2

原创 【无标题】找出中间数

/** * @author shkstart * @create 2021-12-08-9:30 */ public class Test1208 { public static void main(String[] args) { int[] arr = new int[]{2,1,-1}; int leftF = 0,left = 0; int rightF = 0,right = 0; boolean have = fal.

2021-12-08 15:59:04 265

原创 小镇法官问题

import java.util.HashSet; import java.util.Iterator; import java.util.Set; /** * @author shkstart * @create 2021-12-07-10:00 */ public class Test1207 { public static void main(String[] args) { int m = -1; int n = 4; int[][].

2021-12-07 22:22:22 175

原创 输入一个整数数组和一个整数k,按以下方式修改该数组1.选择某个下标 i 并将 nums[i] 替换为 -nums[i]2.重复这个过程恰好 k 次。可以多次选择同一个下标 i 。返回数组可能的最大和

import java.util.Scanner; /** * @author shkstart * @create 2021-12-06-9:50 */ public class Max { public static void paixu(int[] arr){ int m; for (int i = 0; i < arr.length - 1; i++) { for (int j = 0; j < arr.lengt.

2021-12-06 12:10:33 596 3

原创 题目简介:建立一个Po(点)类,包含数据成员X,Y(坐标点),构造器;以Po为父类,实现一个Circle(圆)类作为子类,增加数据成员R(半径),构造器、求圆面积方法getArea(),求圆周长方

/** * @author shkstart * @create 2021-12-03-11:11 */ public class Po { private int X; private int Y; public Po(int x, int y) { X = x; Y = y; } public int getX() { return X; } public int getY() { .

2021-12-03 11:46:47 196

原创 输入两个数,算他们两相乘与相除

import java.util.Scanner; /** * @author shkstart * @create 2021-12-02-13:35 */ public class Base { private int a,b; Base(int a,int b){ this.a = a; this.b = b; } public int getB() { return b; } public in.

2021-12-02 21:05:23 291

news.sql

news.sql

2022-09-20

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除