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 Question260072 { | |
| public static void main (String [] args) { | |
| int [] [] dice = new int [3] [6]; | |
| int [] counter = new int [3]; | |
| int limit = (int) Math.pow (3,18); | |
| int max = 0; | |
| outer: | |
| for (int selection = 0;selection < limit;selection++) { |
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 Question261357 { | |
| final static boolean even = false; | |
| final static int percent = 74; | |
| final static double p = percent / 100.; | |
| final static int win = 7; | |
| final static int lose = 6; | |
| static double [] [] cache; | |
| static boolean [] [] done; |
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 Question262629 { | |
| final static String [] [] associations = | |
| { | |
| {"FRA","GER","SPA","GER","ITA","GER","SPA","ENG"}, | |
| {"POR","ENG","ITA","SPA","UKR","SPA","SCO","TUR"} | |
| }; | |
| static int count; | |
| static boolean [] paired = new boolean [8]; |
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.math.BigInteger; | |
| public class Question264698 { | |
| final static int max = 10000; | |
| final static BigInteger quotientFactor = BigInteger.valueOf ((1L << 63) - 1); | |
| public static double quotient (BigInteger num,BigInteger den) { | |
| return num.multiply (quotientFactor).divide (den).doubleValue () / quotientFactor.doubleValue (); | |
| } |
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.HashSet; | |
| import java.util.Set; | |
| public class Question273348 { | |
| public static long gcd (long p,long q) { | |
| if (p < 0) | |
| p = -p; | |
| if (q < 0) | |
| q = -q; |
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; | |
| import java.util.Locale; | |
| import java.util.Random; | |
| public class Question279924 { | |
| final static int ntrials = 100000; | |
| static Random random = new Random (0); | |
| static void makeRandomPermutation (int [] p,int n) { |
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.Random; | |
| public class Question280648 { | |
| final static int ntrials = 1000000; | |
| final static Random random = new Random (); | |
| static class CombinationTraversal { | |
| int k,n; | |
| int [] combination; |
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 Question281094 { | |
| static int m; | |
| static int [] p; | |
| static int count; | |
| public static void main (String [] args) { | |
| for (m = 2;;m++) { | |
| p = new int [m]; | |
| p [0] = 1; | |
| count = 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
| import java.util.Random; | |
| public class Question280793 { | |
| final static int n = 100; | |
| final static int M = 150; | |
| final static int N = (n * (n - 1)) / 2; | |
| final static Random random = new Random (); |
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 Question281993 { | |
| final static boolean square = false; | |
| final static int ntrials = 10000000; | |
| public static void main (String [] args) { | |
| int count = 0; | |
| double [] [] x = new double [4] [2]; | |
| for (int n = 0;n < ntrials;n++) { | |
| for (int i = 0;i < 4;i++) | |
| for (;;) { |