From ef2fc75854cf819dc5ec9acef9e0ce2bd82c7c2f Mon Sep 17 00:00:00 2001 From: fst1996 <2411194573@qq.com> Date: Wed, 4 Oct 2023 22:56:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E7=BB=84=E7=AE=97=E6=B3=95=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E5=88=9D=E5=A7=8Bpom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/.gitignore | 8 ++ .idea/compiler.xml | 13 +++ .idea/encodings.xml | 6 ++ .idea/inspectionProfiles/Project_Default.xml | 36 +++++++ .idea/jarRepositories.xml | 20 ++++ .idea/misc.xml | 14 +++ pom.xml | 97 ++++++++++++++++++ src/main/java/com/bwie/test/Test01.java | 25 +++++ target/classes/com/bwie/test/Test01.class | Bin 0 -> 652 bytes target/maven-archiver/pom.properties | 5 + .../compile/default-compile/createdFiles.lst | 1 + .../compile/default-compile/inputFiles.lst | 1 + .../default-testCompile/inputFiles.lst | 0 target/test-10.01-1.0-SNAPSHOT.jar | Bin 0 -> 2703 bytes test-10.01.iml | 2 + 15 files changed, 228 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/compiler.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/jarRepositories.xml create mode 100644 .idea/misc.xml create mode 100644 pom.xml create mode 100644 src/main/java/com/bwie/test/Test01.java create mode 100644 target/classes/com/bwie/test/Test01.class create mode 100644 target/maven-archiver/pom.properties create mode 100644 target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst create mode 100644 target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst create mode 100644 target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst create mode 100644 target/test-10.01-1.0-SNAPSHOT.jar create mode 100644 test-10.01.iml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..73f69e0 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..b81ac35 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..c2bae49 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..6560a98 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,36 @@ + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..2a89eda --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..4b661a5 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..7777b04 --- /dev/null +++ b/pom.xml @@ -0,0 +1,97 @@ + + + 4.0.0 + + com.bwie + test-10.01 + 1.0-SNAPSHOT + + + org.junit.jupiter + junit-jupiter-api + 5.10.0-M1 + + + + org.springframework.boot + spring-boot-configuration-processor + true + 2.7.8 + + + cn.hutool + hutool-all + 5.8.18 + + + org.springframework.boot + spring-boot-starter-web + 2.7.8 + + + com.alibaba + fastjson + 1.2.67 + + + org.java-websocket + Java-WebSocket + 1.3.8 + + + com.squareup.okhttp3 + okhttp + 4.10.0 + + + org.projectlombok + lombok + 1.18.24 + + + org.slf4j + slf4j-log4j12 + 1.7.30 + + + mysql + mysql-connector-java + 5.1.32 + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + 2.3.1 + + + org.springframework.boot + spring-boot-starter-aop + 2.7.2 + + + org.json + json + 20210307 + + + commons-codec + commons-codec + 1.15 + + + com.amazonaws + aws-java-sdk-s3 + 1.12.68 + + + + com.amazonaws + aws-java-sdk-core + 1.12.68 + + + + + diff --git a/src/main/java/com/bwie/test/Test01.java b/src/main/java/com/bwie/test/Test01.java new file mode 100644 index 0000000..646f02e --- /dev/null +++ b/src/main/java/com/bwie/test/Test01.java @@ -0,0 +1,25 @@ +package com.bwie.test; + +import org.junit.jupiter.api.Test; + +/** + * 算法 + */ +public class Test01 { + @Test + public int canJump(int[] nums) { + int maxIndex = 0; // 每次跳跃后的最大边界 + int step = 0; // 记录跳跃步数 + int end = 0; // 每一次搜完一层后更新end,并且将步数加1,直到可以跳到最后一格 + for (int i = 0; i < nums.length - 1; i++) { + if (maxIndex >= i) { + maxIndex = Math.max(maxIndex, i + nums[i]); // 找到下次可以到达的最远边界。 + if (i == end) { // 如果已经搜完了这一层,就将步数加1,并更新end的位置。 + end = maxIndex; + step++; + } + } + } + return step; + } +} diff --git a/target/classes/com/bwie/test/Test01.class b/target/classes/com/bwie/test/Test01.class new file mode 100644 index 0000000000000000000000000000000000000000..d9f6315d1166187fe29a09723ba2822610c08113 GIT binary patch literal 652 zcmZuuO>YuW6g_V~fC8mRJ5`jbU6|01Fjf;{)RGtz6AWsi4V!L!z)SlG^M=41?GNY= zQ8#YfxYD@b2e|j|sOQlpZk%N9efQjZ&OLAD=kFg200-DEB0#-}>$s6eBabbC++%ID z?FjhIoxVWuG#x2{wVpQWWtI%o>_`qKL~6ZsC?|b6)2_Y*1AD6H0-L>In#6VC zov6N^YwmnvOlqaosUfk^OJ^tXIHPyQskUks%c)+j=HlX;G@A|8GwrOGF8s8{@|`Rr zL@tk;W!%DTfsOwe7pS_?cp}Y7{Aw^(Ln~1E2fdK?lpg8Y-K)!cVH-Zbtb05VM2<1f zDrOeU;qEtxugi9U(Y1jBRv60{11O@zO0Zs~h$Am3nPYzFANn1?9r*1q3ilSl=o6Za zDEx>9<6acD-hPL77==;r0V|DmaPEuqP<;OLYwHWy9`^vPrFw}~nX0SQuV5W(sH2KI zxPpDuXm%a( literal 0 HcmV?d00001 diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties new file mode 100644 index 0000000..0c2efea --- /dev/null +++ b/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Wed Oct 04 22:55:50 CST 2023 +version=1.0-SNAPSHOT +groupId=com.bwie +artifactId=test-10.01 diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..408068a --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1 @@ +com\bwie\test\Test01.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..e00223c --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1 @@ +D:\lv6\test-10.01\src\main\java\com\bwie\test\Test01.java diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..e69de29 diff --git a/target/test-10.01-1.0-SNAPSHOT.jar b/target/test-10.01-1.0-SNAPSHOT.jar new file mode 100644 index 0000000000000000000000000000000000000000..58af6c8e0a83dee37c0d74dd88d055990fba7b18 GIT binary patch literal 2703 zcmWIWW@h1H0D)iIT*AQ&D8UJ&eO*Hwbv^yu^aG&EI2e8cm08~J`j-QgZU$lzWM#gN zex7cw!6ACSZl8V6oc8h7)w{^+t*dqJ%=yhh23L$9JT21kI(I_HTi1z${mGKB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