-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testsuite: add more Java tests for seed2
- Loading branch information
1 parent
8bda48f
commit ee64225
Showing
4 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
public class Seed2 { | ||
public static void main(String[] args) { | ||
int[] arr = new int[1]; | ||
arr[1] = 1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
language: JAVA8 | ||
time: 2 | ||
memory: 65536 | ||
source: seed2.java | ||
expect: IR | ||
feedback: java.lang.ArrayIndexOutOfBoundsException |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import java.util.*; | ||
|
||
public class Seed2 { | ||
public static void main(String[] args) { | ||
int[] arr = new int[1000000000]; | ||
Scanner sc = new Scanner(System.in); | ||
String result; | ||
long lo = 1; | ||
long hi = 2000000000; | ||
long num; | ||
while (lo < hi) { | ||
num = (lo + hi) / 2; | ||
System.out.println(num); | ||
result = sc.nextLine(); | ||
if (result.equals("FLOATS")) | ||
hi = num; | ||
else if (result.equals("SINKS")) | ||
lo = num + 1; | ||
else | ||
break; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
language: JAVA8 | ||
time: 2 | ||
memory: 65536 | ||
source: seed2.java | ||
expect: MLE |