This file contains hidden or 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
| import java.util.Arrays; | |
| public class ToastXToast { | |
| public int bake(int[] undertoasted, int[] overtoasted) { | |
| Arrays.sort(undertoasted); | |
| Arrays.sort(overtoasted); | |
| if (undertoasted[0] > overtoasted[0] || undertoasted[undertoasted.length - 1] > overtoasted[overtoasted.length - 1]) { | |
| return -1; | |
| } else if (undertoasted[undertoasted.length - 1] < overtoasted[0]) { |
This file contains hidden or 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
| /* | |
| ID: stphung1 | |
| LANG: JAVA | |
| TASK: milk | |
| */ | |
| import java.io.File; | |
| import java.io.IOException; | |
| import java.io.PrintWriter; | |
| import java.util.ArrayList; | |
| import java.util.Collections; |
This file contains hidden or 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
| /* | |
| ID: stphung1 | |
| LANG: JAVA | |
| TASK: dualpal | |
| */ | |
| import java.io.File; | |
| import java.io.IOException; | |
| import java.io.PrintWriter; | |
| import java.util.Scanner; |
This file contains hidden or 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
| /* | |
| ID: stphung1 | |
| LANG: JAVA | |
| TASK: barn1 | |
| */ | |
| import java.io.File; | |
| import java.io.IOException; | |
| import java.io.PrintWriter; | |
| import java.util.Arrays; | |
| import java.util.HashSet; |
This file contains hidden or 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
| import java.util.Arrays; | |
| public class ComparerInator { | |
| public int makeProgram(int[] A, int[] B, int[] wanted) { | |
| if (same(A, wanted)) | |
| return 1; | |
| else if (same(B, wanted)) | |
| return 1; | |
| else if (ltTest1(A, B, wanted)) |
This file contains hidden or 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
| import java.util.Stack; | |
| public class MathContest { | |
| public int countBlack(String ballSequence, int repetitions) { | |
| String newBallSequence = ballSequence; | |
| Stack<Integer> stack = new Stack<Integer>(); | |
| for (int i = newBallSequence.length() - 1; i >= 0; i--) { | |
| if (newBallSequence.charAt(i) == 'B') |
This file contains hidden or 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
| public class PerfectSequences { | |
| public String fixIt(int[] seq) { | |
| if (seq.length == 1) return "Yes"; | |
| else { | |
| for(int i=0; i<seq.length; i++) { | |
| int sum = sum(seq,i); | |
| int product = product(seq,i); | |
| if (product == 0) continue; | |
| else { |
This file contains hidden or 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
| import java.io.File; | |
| import java.io.FileNotFoundException; | |
| import java.util.Queue; | |
| import java.util.Scanner; | |
| import java.util.concurrent.LinkedBlockingQueue; | |
| public class BotTrust { | |
| public static void main(String[] args) throws FileNotFoundException { | |
| Scanner sc = new Scanner(new File("A-large.in")); |
This file contains hidden or 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
| import java.io.File; | |
| import java.io.FileNotFoundException; | |
| import java.util.ArrayList; | |
| import java.util.HashMap; | |
| import java.util.HashSet; | |
| import java.util.List; | |
| import java.util.Map; | |
| import java.util.Scanner; | |
| import java.util.Set; |
This file contains hidden or 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
| import java.io.File; | |
| import java.io.FileNotFoundException; | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.List; | |
| import java.util.Scanner; | |
| public class CandySplitting { | |
| public static void main(String[] args) throws FileNotFoundException { | |
| Scanner sc = new Scanner(new File("C-small-attempt0.in")); |