f1
stringlengths
6
6
f2
stringlengths
6
6
content_f1
stringlengths
149
20.2k
content_f2
stringlengths
149
20.2k
flag
int64
0
1
__index_level_0__
int64
0
3.83k
C20039
C20009
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
package com.forthgo.google.g2012r0; import com.forthgo.math.Helper; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.util.Scanner; /** * Created by Xan Gregg. * Date: 4/14/12 */ public class ProblemD { private static final int SELF = 2; pr...
0
400
C20039
C20060
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
package jp.funnything.competition.util; import java.math.BigInteger; /** * Utility for BigInteger */ public class BI { public static BigInteger ZERO = BigInteger.ZERO; public static BigInteger ONE = BigInteger.ONE; public static BigInteger add( final BigInteger x , final BigInteger y ) { return...
0
401
C20039
C20004
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
import java.util.*; public class D { public static boolean wall[][]; public static int X; public static int Y; public static int[] dxs; public static int[] dys; public static void main(String[] args) { Scanner in = new Scanner(System.in); int T = in.nextInt(); for(int c = 1; c <= ...
0
402
C20039
C20005
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
package gcj; import com.sun.org.apache.xerces.internal.impl.xs.opti.DefaultXMLDocumentHandler; import java.util.*; import java.io.*; public class HallOfMirrors { final static String PROBLEM_NAME = "mirrors"; final static String WORK_DIR = "D:\\Gcj\\" + PROBLEM_NAME + "\\"; int H, W, D; double stX, s...
0
403
C20039
C20065
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
package jp.funnything.prototype; import static java.lang.Math.abs; import java.io.File; import java.io.IOException; import jp.funnything.competition.util.CompetitionIO; import jp.funnything.competition.util.Packer; import org.apache.commons.io.FileUtils; import org.apache.commons.math.fraction.Fraction; import org....
0
404
C20039
C20006
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
package problemD; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class ProblemD { static Rational posX = null; static Rational posY = null; static Rational tarX = null; static Rational tarY = null; static boolean[][] array = null; public static void main(String[] ...
0
405
C20039
C20067
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
import java.io.*; import java.util.*; public class Solution { private StringTokenizer st; private BufferedReader in; private PrintWriter out; final String file = "D-large"; public void solve() throws IOException { int tests = nextInt(); for (int test = 0; test < tests; ++test) { int n = nextInt(); ...
0
406
C20039
C20008
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Set; public class SimpleMirrors { public static void ma...
0
407
C20039
C20063
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
package jp.funnything.competition.util; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import org.apache.commons.io.IOUtils; public class AnswerWriter { private static final String DEFAULT_FORMAT = "Case #%d: %s\n"; private final BufferedWriter _wr...
0
408
C20039
C20015
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
package qualification; import java.io.*; import java.util.Scanner; /** * @author Roman Elizarov */ public class D { public static void main(String[] args) throws IOException { new D().go(); } Scanner in; PrintWriter out; private void go() throws IOException { in = new Scanner(new File("src\\qualificatio...
0
409
C20039
C20050
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
package jp.funnything.competition.util; public enum Direction { UP , DOWN , LEFT , RIGHT; public int dx() { switch ( this ) { case UP: case DOWN: return 0; case LEFT: return -1; case RIGHT: return 1; default: throw...
0
410
C20039
C20085
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
import java.util.Scanner; import java.io.IOException; import java.util.Arrays; import java.util.ArrayList; import java.io.PrintStream; import java.io.OutputStream; import java.io.FileOutputStream; import java.io.PrintWriter; import java.io.FileInputStream; import java.io.InputStream; /** * Built using CHelper plug-in...
0
411
C20039
C20020
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
package template; import java.io.*; import java.util.ArrayList; import java.util.Random; public class Utils { static String logfile = ""; public static BufferedWriter newBufferedWriter(String filename, boolean append) { BufferedWriter bw = null; try { bw = new BufferedWriter(new ...
0
412
C20039
C20062
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
package jp.funnything.competition.util; public enum Direction { UP , DOWN , LEFT , RIGHT; public int dx() { switch ( this ) { case UP: case DOWN: return 0; case LEFT: return -1; case RIGHT: return 1; default: throw...
0
413
C20039
C20059
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
package jp.funnything.competition.util; import java.io.File; import java.math.BigDecimal; import java.math.BigInteger; import org.apache.commons.io.FileUtils; public class CompetitionIO { private final QuestionReader _reader; private final AnswerWriter _writer; /** * Default constructor. Use latest...
0
414
C20039
C20064
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
package jp.funnything.competition.util; public class Prof { private long _start; public Prof() { reset(); } private long calcAndReset() { final long ret = System.currentTimeMillis() - _start; reset(); return ret; } private void reset() { _start = Sys...
0
415
C20039
C20076
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
import java.io.*; import java.math.*; import java.util.*; public class D { final static boolean DEBUG = true; class S implements Comparable<S> { int a; int [] b; public int compareTo(S s) { if (a != s.a) return a - s.a; else return b[0] - s.b[0]; } boolean merge(S s) { if (a == s.a...
0
416
C20039
C20026
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
import java.io.*; import java.util.*; import java.math.*; class D { private static final boolean DEBUG_ON = true; private static final boolean ECHO_ON = true; private static BufferedReader input; private static BufferedWriter output; private static final int INF = Integer.MAX_VALUE / 2; private static final in...
0
417
C20039
C20078
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
import java.awt.Point; public class FracVec { public final Frac row, col; public FracVec(Frac row, Frac col) { this.row = row; this.col = col; } public FracVec(Point pos) { row = new Frac(pos.y); col = new Frac(pos.x); } public FracVec flipHoriz() { return new FracVec(row, col.neg()); } public Fr...
0
418
C20039
C20057
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
package jp.funnything.competition.util; import java.util.Arrays; import java.util.List; import com.google.common.collect.Lists; import com.google.common.primitives.Ints; import com.google.common.primitives.Longs; public class Prime { public static class PrimeData { public int[] list; public boole...
0
419
C20039
C20030
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public class RayVector { public final int x; public final int y; public RayVector(int x, int y) { this.x = x; this.y ...
0
420
C20039
C20002
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
import java.util.*; import java.io.*; import java.math.*; import java.awt.*; import static java.lang.Math.*; import static java.lang.Integer.parseInt; import static java.lang.Double.parseDouble; import static java.lang.Long.parseLong; import static java.lang.System.*; import static java.util.Arrays.*; import static jav...
0
421
C20039
C20056
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
package jp.funnything.competition.util; import java.math.BigDecimal; /** * Utility for BigDeciaml */ public class BD { public static BigDecimal ZERO = BigDecimal.ZERO; public static BigDecimal ONE = BigDecimal.ONE; public static BigDecimal add( final BigDecimal x , final BigDecimal y ) { return...
0
422
C20039
C20018
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
package template; import java.util.Objects; public class Pair<T1, T2> implements Comparable<Pair<T1, T2>>{ private T1 o1; private T2 o2; public Pair(T1 o1, T2 o2) { this.o1 = o1; this.o2 = o2; } @Override public boolean equals(Object other) { if (!(other instanceof P...
0
423
C20039
C20051
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
package jp.funnything.competition.util; import java.util.List; import com.google.common.collect.Lists; public class Lists2 { public static < T > List< T > newArrayListAsArray( final int length ) { final List< T > list = Lists.newArrayListWithCapacity( length ); for ( int index = 0 ; index < leng...
0
424
C20031
C20003
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
import java.io.*; import java.util.*; public class D { public static class Pair { public int r; public int c; public Pair(int r, int c) { this.r = r; this.c = c; } @Override public boolean equals(Object o) { if (o == null) return false; if (!(o instanceof Pair)) return false; ...
0
425
C20031
C20029
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public class Ray { private final Fraction expiryLengthSquared; public RayVector vector; private FractionPoint currentLocatio...
0
426
C20031
C20040
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.competition.util; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.math.BigDecimal; import java.math.BigInteger; import org.apache.commons.io.IOUtils; public class QuestionReader { pr...
0
427
C20031
C20035
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public class Surround { private Square[][] surround; public Surround(Square[][] surround) { this.surround = surround; } ...
0
428
C20031
C20045
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.competition.util; import java.math.BigDecimal; /** * Utility for BigDeciaml */ public class BD { public static BigDecimal ZERO = BigDecimal.ZERO; public static BigDecimal ONE = BigDecimal.ONE; public static BigDecimal add( final BigDecimal x , final BigDecimal y ) { return...
0
429
C20031
C20052
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.competition.util; import java.io.File; import java.math.BigDecimal; import java.math.BigInteger; import org.apache.commons.io.FileUtils; public class CompetitionIO { private final QuestionReader _reader; private final AnswerWriter _writer; /** * Default constructor. Use latest...
0
430
C20031
C20073
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
/* * Main.java * * Created on 14.04.2012, 10:03:46 * * To change this template, choose Tools | Templates * and open the template in the editor. */ package codejam12; import qualification.CodeJamQuali; /** * * @author Besitzer */ public class Main { /** * @param args the command line arguments ...
0
431
C20031
C20043
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.competition.util; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.apache.commons.io.FileUtils; import org.apache....
0
432
C20031
C20083
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; public class QuestionD { public static void doPuzzle() { try { File question...
0
433
C20031
C20023
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package template; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; public class TestCase { private boolean isSolved; private Object solution; private Map<String, Integer> intProperties; private Map<String, ArrayList<Integer>> intArrayProperties; private Map<String, Arra...
0
434
C20031
C20086
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
//input file must be in.txt in this directory //output file will be out.txt import java.io.*; import java.util.*; public class D { public static Scanner in; public static PrintStream out; public static void main(String [] args) throws Throwable { in = new Scanner(new File("in.txt")); int cases = in.nextInt()...
0
435
C20031
C20075
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.util.HashSet; import java.util.Scanner; public class CodeJamD { public static void main(String args[]) throws Exception { Scanner in = new Scanner(new File("in.txt")); BufferedWriter out = new BufferedWriter(new FileWriter...
0
436
C20031
C20048
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.competition.util; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import org.apache.commons.io.IOUtils; public class AnswerWriter { private static final String DEFAULT_FORMAT = "Case #%d: %s\n"; private final BufferedWriter _wr...
0
437
C20031
C20074
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package codejam2012.q; import java.io.FileInputStream; import java.io.IOException; import java.io.PrintStream; import java.util.Scanner; public class D { static int H, W, D; static char[][] hall; static int startx, starty; static public int test(int dx, int dy, int dirx, int diry) { //System.out.println("test "...
0
438
C20031
C20019
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package template; import java.util.ArrayList; import java.util.Set; import java.util.HashSet; public class TestCaseSolver implements Runnable { private ArrayList<TestCase> testCases; private int ref; public TestCaseSolver(ArrayList<TestCase> tcs, int ref) { testCases = tcs; this.ref = re...
0
439
C20031
C20021
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package template; import java.io.BufferedReader; import java.io.BufferedWriter; import java.util.ArrayList; public class TestCaseIO { public static ArrayList<TestCase> loadFromFile(String infile) { //inc checks on #lines, length of splits, etc. BufferedReader br = Utils.newBufferedReader(infile);...
0
440
C20031
C20044
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.competition.util; import java.util.Comparator; import com.google.common.base.Objects; public class Pair< T1 , T2 > { public static < T1 extends Comparable< T1 > , T2 extends Comparable< T2 > > Comparator< Pair< T1 , T2 > > getFirstComarator() { return new Comparator< Pair< T1 , T2 >...
0
441
C20031
C20066
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.competition.util; import java.util.Comparator; import com.google.common.base.Objects; public class Pair< T1 , T2 > { public static < T1 extends Comparable< T1 > , T2 extends Comparable< T2 > > Comparator< Pair< T1 , T2 > > getFirstComarator() { return new Comparator< Pair< T1 , T2 >...
0
442
C20031
C20041
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.competition.util; import java.util.Arrays; import java.util.Iterator; /** * Do NOT change the element in iteration */ public class Permutation implements Iterable< int[] > , Iterator< int[] > { public static int[] fromNumber( long value , final int n ) { final int[] data = new int[...
0
443
C20031
C20068
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package com.brootdev.gcj2012.common; import java.io.*; public class Data { public final BufferedReader in; public final PrintWriter out; public Data(String inFile, String outFile) throws IOException { in = new BufferedReader(new FileReader(inFile)); out = new PrintWriter(new BufferedWrit...
0
444
C20031
C20017
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package problem.d.hall.of.mirrors; import java.io.File; import java.io.IOException; import java.io.PrintStream; import java.util.Scanner; /** * * @author Park */ public class ProblemDHallOfMirrors { static int ...
0
445
C20031
C20042
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.prototype; import static java.lang.Math.abs; import java.io.File; import java.io.IOException; import jp.funnything.competition.util.CompetitionIO; import jp.funnything.competition.util.Packer; import org.apache.commons.io.FileUtils; import org.apache.commons.math.fraction.Fraction; import org....
0
446
C20031
C20013
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
import java.awt.Color; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintWriter; import java.util.*; import javax.imageio.ImageIO; class findRes { double angle; double...
0
447
C20031
C20000
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
import static java.lang.Math.*; import java.io.*; import java.util.*; /** * @author Chris Dziemborowicz <chris@dziemborowicz.com> * @version 2012.0415 */ public class HallOfMirrors { public static void main(String[] args) throws Exception { // Get input files File dir = new File...
0
448
C20031
C20071
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package qual; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileReader; import java.io.FileWriter; import java.util.ArrayList; import java.util.List; public class D { static class Ray{ // directions public static byte U = 0; // up public static byte L = 1; // left public sta...
0
449
C20031
C20010
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.Set; import java.util.Stack; public class codejamp4 { public sta...
0
450
C20031
C20070
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package com.brootdev.gcj2012.problemD; import com.brootdev.gcj2012.common.Data; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; public class Main { private static final Logger logger = Logger.getLogger(Main.class.getSimpleName()); private static final double PI2 ...
0
451
C20031
C20055
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.competition.util; import java.util.Arrays; import java.util.Iterator; /** * Do NOT change the element in iteration */ public class Permutation implements Iterable< int[] > , Iterator< int[] > { public static int[] fromNumber( long value , final int n ) { final int[] data = new int[...
0
452
C20031
C20077
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
import java.awt.Point; import java.util.Scanner; public class Mirrors { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int cases = scan.nextInt(); for (int trial = 1; trial <= cases; trial++) { System.out.print("Case #" + trial + ": "); int height = scan.nextInt() * 2; ...
0
453
C20031
C20024
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package pl.helman.codejam.Hall; import java.io.BufferedReader; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; public class Hall { private static int checkSpecialCases(boolean[][] map, int startX, int startY, int d) { int ret = 0; // horizontal to left int x = startX, y =...
0
454
C20031
C20001
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
import java.io.*; import java.util.*; class Mirrors { static class Direction { int x; int y; Direction(int a, int b){ x = a; y = b; } } static class Point { double x; double y; Point(double a, double b){ x = a; y = b; } } static class Cell { int x; int y; Cell(int a, int b){ ...
0
455
C20031
C20049
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.competition.util; import java.util.Arrays; import java.util.List; import com.google.common.collect.Lists; import com.google.common.primitives.Ints; import com.google.common.primitives.Longs; public class Prime { public static class PrimeData { public int[] list; public boole...
0
456
C20031
C20034
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import uk.co.epii.codejam.common.AbstractProcessor; /** * * @author jim */ public class HallO...
0
457
C20031
C20036
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public class Fraction implements Comparable<Fraction> { public final int n; public final int d; public Fraction(int i) { this...
0
458
C20031
C20081
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
import java.util.Scanner; public class Program { static final int RANGE = 50; static Board board; static double dist; public static void main(String[] args) throws Exception { Scanner in = new Scanner(new java.io.FileReader("in")); int t = in.nextInt(); for (int test = 0; test < t; test++) { board = ...
0
459
C20031
C20038
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
import java.io.*; import java.util.*; import static java.lang.System.*; public class D { public static void main (String [] args) throws IOException {new D().run();} public void run() throws IOException{ Scanner file = new Scanner(new File("D-large.in")); PrintWriter out = new PrintWriter(new BufferedWriter(new ...
0
460
C20031
C20058
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.competition.util; import java.util.List; import com.google.common.collect.Lists; public class Lists2 { public static < T > List< T > newArrayListAsArray( final int length ) { final List< T > list = Lists.newArrayListWithCapacity( length ); for ( int index = 0 ; index < leng...
0
461
C20031
C20011
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
public class CG { /** get the intersection between a segment (p1, p2), and a project line from the origin * with an angle. * @return Point(INF, INF) if there is no intersection * */ public static Point intersectSegmentOri(Point p1, Point p2, double angle) { Point ori = new Point(0.0, 0.0), out = new Point(...
0
462
C20031
C20032
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; import uk.co.epii.codejam.common.AbstractMain; /** * * @author jim */ public class Main { /** * @param args the command line arguments */ public static vo...
0
463
C20031
C20033
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum RayStep { EXPIRES, REFLECTS_HORIZONTALLY, REFLECTS_VERTICALLY, INVERTS, CONTINUES, HITS; }
0
464
C20031
C20014
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
public class Point { public double x, y; public Point(double x, double y) { this.x = x; this.y = y; } public Point() { x=0; y=0; } @Override public boolean equals(Object arg0) { Point pt = (Point)arg0; return CG.dblcmp(pt.x, x) == 0 && CG.dblcmp(pt.y, y) == 0; } public Point minus(Point p) ...
0
465
C20031
C20053
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.competition.util; import java.util.Iterator; /** * Do NOT change the element in iteration */ public class Combination implements Iterable< int[] > , Iterator< int[] > { private final int _n; private final int _k; private int[] _data; public Combination( final int n , final int...
0
466
C20031
C20046
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.competition.util; import java.math.BigInteger; /** * Utility for BigInteger */ public class BI { public static BigInteger ZERO = BigInteger.ZERO; public static BigInteger ONE = BigInteger.ONE; public static BigInteger add( final BigInteger x , final BigInteger y ) { return...
0
467
C20031
C20061
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.competition.util; import java.util.Iterator; /** * Do NOT change the element in iteration */ public class Combination implements Iterable< int[] > , Iterator< int[] > { private final int _n; private final int _k; private int[] _data; public Combination( final int n , final int...
0
468
C20031
C20087
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
import java.io.*; import java.util.*; public class CodeJam2012_Q_D { public int calc(int H, int W, int D, String[] mirror) { int[][] seen = new int[D*2+1][D*2+1]; int sx=0,sy=0; for(int i=0; i<D*2+1; i++) Arrays.fill(seen[i], -1); boolean[][] m = new boolean[H][W]; for(int i=0; i<H; i++) { if(mir...
0
469
C20031
C20079
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
public class Frac implements Comparable<Frac> { public static final Frac ZERO = new Frac(0); public static final Frac ONE = new Frac(1); public final int num, denom; public Frac(int num) { this(num, 1); } public Frac(int num, int denom) { if (denom == 0) { if (num < 0) this.num = -1; else if (num ...
0
470
C20031
C20047
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.competition.util; public class Prof { private long _start; public Prof() { reset(); } private long calcAndReset() { final long ret = System.currentTimeMillis() - _start; reset(); return ret; } private void reset() { _start = Sys...
0
471
C20031
C20007
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package qualificationRound; import java.io.BufferedReader; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; public class P4 { public static String[] map; public static int x = 0, y = 0; public static int calGCD(int n, int m) { if (m == 0) return n; if (n == 0) return m; ...
0
472
C20031
C20028
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; import java.awt.Point; /** * * @author jim */ public class Hall { public final int H; public final int W; public final int D; public final FractionPoint meLo...
0
473
C20031
C20022
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package template; //standard libraries potentially used: //Apache commons http://http://commons.apache.org/ //Google Guava http://code.google.com/p/guava-libraries/ import java.util.ArrayList; public class Template { public static void main(String[] args) { //test(); //Utils.die("Done testing"...
0
474
C20031
C20016
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
// Author: Alejandro Sotelo Arevalo package qualification; import java.awt.*; import java.awt.geom.*; import java.io.*; import java.util.*; public class D_HallOfMirrors { //-------------------------------------------------------------------------------- private static String ID="D"; private static String NAME="...
0
475
C20031
C20072
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
/* * CodeJamTester1A.java * * Created on 28.07.2008, 14:20:39 * * To change this template, choose Tools | Templates * and open the template in the editor. */ package qualification; import java.util.*; import java.io.*; import java.math.*; /** * * @author Besitzer */ public class CodeJamQuali { int tes...
0
476
C20031
C20037
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public class FractionPoint { public final Fraction x; public final Fraction y; public FractionPoint(Fraction x, Fraction y) { ...
0
477
C20031
C20054
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.competition.util; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.math.BigDecimal; import java.math.BigInteger; import org.apache.commons.io.IOUtils; public class QuestionReader { pr...
0
478
C20031
C20080
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
import static java.lang.Double.parseDouble; import static java.lang.Integer.parseInt; import static java.lang.Integer.signum; import static java.lang.Long.parseLong; import static java.lang.Math.abs; import static java.lang.System.exit; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStr...
0
479
C20031
C20084
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package google.codejam2012.qualification; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.StringTokenizer; import static java.lang.Math.*; final class BinaryMatrix { private int[] data; public BinaryMatrix(int height, int width) { data = new int[height]; } public void se...
0
480
C20031
C20027
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; import java.awt.Point; import java.util.ArrayList; import uk.co.epii.codejam.common.DatumConverter; /** * * @author jim */ public class HallFactory implements DatumConverter...
0
481
C20031
C20009
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package com.forthgo.google.g2012r0; import com.forthgo.math.Helper; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.util.Scanner; /** * Created by Xan Gregg. * Date: 4/14/12 */ public class ProblemD { private static final int SELF = 2; pr...
0
482
C20031
C20060
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.competition.util; import java.math.BigInteger; /** * Utility for BigInteger */ public class BI { public static BigInteger ZERO = BigInteger.ZERO; public static BigInteger ONE = BigInteger.ONE; public static BigInteger add( final BigInteger x , final BigInteger y ) { return...
0
483
C20031
C20004
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
import java.util.*; public class D { public static boolean wall[][]; public static int X; public static int Y; public static int[] dxs; public static int[] dys; public static void main(String[] args) { Scanner in = new Scanner(System.in); int T = in.nextInt(); for(int c = 1; c <= ...
0
484
C20031
C20005
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package gcj; import com.sun.org.apache.xerces.internal.impl.xs.opti.DefaultXMLDocumentHandler; import java.util.*; import java.io.*; public class HallOfMirrors { final static String PROBLEM_NAME = "mirrors"; final static String WORK_DIR = "D:\\Gcj\\" + PROBLEM_NAME + "\\"; int H, W, D; double stX, s...
0
485
C20031
C20065
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.prototype; import static java.lang.Math.abs; import java.io.File; import java.io.IOException; import jp.funnything.competition.util.CompetitionIO; import jp.funnything.competition.util.Packer; import org.apache.commons.io.FileUtils; import org.apache.commons.math.fraction.Fraction; import org....
0
486
C20031
C20006
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package problemD; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class ProblemD { static Rational posX = null; static Rational posY = null; static Rational tarX = null; static Rational tarY = null; static boolean[][] array = null; public static void main(String[] ...
0
487
C20031
C20067
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
import java.io.*; import java.util.*; public class Solution { private StringTokenizer st; private BufferedReader in; private PrintWriter out; final String file = "D-large"; public void solve() throws IOException { int tests = nextInt(); for (int test = 0; test < tests; ++test) { int n = nextInt(); ...
0
488
C20031
C20008
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Set; public class SimpleMirrors { public static void ma...
0
489
C20031
C20063
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.competition.util; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import org.apache.commons.io.IOUtils; public class AnswerWriter { private static final String DEFAULT_FORMAT = "Case #%d: %s\n"; private final BufferedWriter _wr...
0
490
C20031
C20015
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package qualification; import java.io.*; import java.util.Scanner; /** * @author Roman Elizarov */ public class D { public static void main(String[] args) throws IOException { new D().go(); } Scanner in; PrintWriter out; private void go() throws IOException { in = new Scanner(new File("src\\qualificatio...
0
491
C20031
C20050
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.competition.util; public enum Direction { UP , DOWN , LEFT , RIGHT; public int dx() { switch ( this ) { case UP: case DOWN: return 0; case LEFT: return -1; case RIGHT: return 1; default: throw...
0
492
C20031
C20085
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
import java.util.Scanner; import java.io.IOException; import java.util.Arrays; import java.util.ArrayList; import java.io.PrintStream; import java.io.OutputStream; import java.io.FileOutputStream; import java.io.PrintWriter; import java.io.FileInputStream; import java.io.InputStream; /** * Built using CHelper plug-in...
0
493
C20031
C20020
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package template; import java.io.*; import java.util.ArrayList; import java.util.Random; public class Utils { static String logfile = ""; public static BufferedWriter newBufferedWriter(String filename, boolean append) { BufferedWriter bw = null; try { bw = new BufferedWriter(new ...
0
494
C20031
C20062
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.competition.util; public enum Direction { UP , DOWN , LEFT , RIGHT; public int dx() { switch ( this ) { case UP: case DOWN: return 0; case LEFT: return -1; case RIGHT: return 1; default: throw...
0
495
C20031
C20059
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.competition.util; import java.io.File; import java.math.BigDecimal; import java.math.BigInteger; import org.apache.commons.io.FileUtils; public class CompetitionIO { private final QuestionReader _reader; private final AnswerWriter _writer; /** * Default constructor. Use latest...
0
496
C20031
C20064
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
package jp.funnything.competition.util; public class Prof { private long _start; public Prof() { reset(); } private long calcAndReset() { final long ret = System.currentTimeMillis() - _start; reset(); return ret; } private void reset() { _start = Sys...
0
497
C20031
C20076
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
import java.io.*; import java.math.*; import java.util.*; public class D { final static boolean DEBUG = true; class S implements Comparable<S> { int a; int [] b; public int compareTo(S s) { if (a != s.a) return a - s.a; else return b[0] - s.b[0]; } boolean merge(S s) { if (a == s.a...
0
498
C20031
C20026
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.hallofmirrors; /** * * @author jim */ public enum Square { ME, MIRROR, EMPTY; public static Square parse(char in) { if (in == '#') return MIRROR; else i...
import java.io.*; import java.util.*; import java.math.*; class D { private static final boolean DEBUG_ON = true; private static final boolean ECHO_ON = true; private static BufferedReader input; private static BufferedWriter output; private static final int INF = Integer.MAX_VALUE / 2; private static final in...
0
499