Skip to content

Commit 154d918

Browse files
committed
refactor(pom): Downgrade Java compiler version to 21
1 parent 927559d commit 154d918

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<description>Consolidated project for algorithm solutions from multiple platforms</description>
1212

1313
<properties>
14-
<maven.compiler.source>24</maven.compiler.source>
15-
<maven.compiler.target>24</maven.compiler.target>
14+
<maven.compiler.source>21</maven.compiler.source>
15+
<maven.compiler.target>21</maven.compiler.target>
1616
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1717
<problem>p140</problem>
1818
<codeforcesProblem>p71A</codeforcesProblem>

src/main/java/com/lzw/solutions/codeforces/p2190B1/Main.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ private static void solve() throws IOException {
4343
if (n == 2) {
4444
ans = -1;
4545
} else {
46-
// if (s.contains("()((")) {
47-
// ans = n - 2;
48-
// } else {
46+
// if (s.contains("()((")) {
47+
// ans = n - 2;
48+
// } else {
4949
int[] array = new int[n];
5050
int acc = 0;
5151
for (int i = 0; i < n; i++) {
@@ -58,7 +58,7 @@ private static void solve() throws IOException {
5858
}
5959
printArray(array);
6060
ans = 0;
61-
// }
61+
// }
6262
}
6363
out.println(ans);
6464
}

src/main/java/com/lzw/solutions/codeforces/p2190B1/MainPlus.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ public static void main(String[] args) {
3232

3333
// now add the changed '('
3434
bal += 1;
35-
if (bal < 0) continue; // though unlikely here
35+
if (bal < 0) continue; // though unlikely here
3636

3737
// now from i+1 to end, greedily take as far as possible
3838
// while keeping bal >= 0, and stop when bal returns to 0
39-
int len = i + 1; // 0-based: positions 0..i
39+
int len = i + 1; // 0-based: positions 0..i
4040
int startBal = bal;
4141

4242
for (int j = i + 1; j < n; j++) {
@@ -46,7 +46,7 @@ public static void main(String[] args) {
4646
if (bal == 0) {
4747
// found a valid completion
4848
ans = Math.max(ans, len);
49-
break; // no need to go further — longer won't be prefix-equal
49+
break; // no need to go further — longer won't be prefix-equal
5050
}
5151
}
5252
}
@@ -55,4 +55,4 @@ public static void main(String[] args) {
5555
}
5656
sc.close();
5757
}
58-
}
58+
}

src/main/java/com/lzw/solutions/codeforces/p2190B1/MainPro.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static void main(String[] args) {
1313

1414
int ans = -1;
1515

16-
for (int split = 1; split <= n; split += 2) { // possible lengths of t
16+
for (int split = 1; split <= n; split += 2) { // possible lengths of t
1717
// check if we can form a regular seq of length 'split' that is better than s
1818
// i.e. first difference position has ( in t, ) in s
1919

@@ -33,17 +33,17 @@ public static void main(String[] args) {
3333
if (open > 0) {
3434
// we could close, but we decide to open instead
3535
foundDiff = true;
36-
open++; // pretend we put (
36+
open++; // pretend we put (
3737
} else {
38-
open--; // forced to follow s
38+
open--; // forced to follow s
3939
}
4040
}
4141
} else {
4242
// after difference, freely choose to make it valid
4343
if (open > 0 && i + 1 < split) {
44-
open--; // prefer close if possible
44+
open--; // prefer close if possible
4545
} else {
46-
open++; // open
46+
open++; // open
4747
}
4848
}
4949

@@ -62,4 +62,4 @@ public static void main(String[] args) {
6262
}
6363
sc.close();
6464
}
65-
}
65+
}

src/main/java/com/lzw/solutions/sample/pjava_sample_buf/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ public static void main(String[] args) throws IOException {
1717
solve();
1818
out.close();
1919
}
20-
}
20+
}

src/main/java/com/lzw/solutions/uva/p1671/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ public static void main(String[] args) throws IOException {
3434
solve();
3535
out.close();
3636
}
37-
}
37+
}

0 commit comments

Comments
 (0)