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
C20081
C20038
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 = ...
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
2,700
C20081
C20058
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 = ...
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
2,701
C20081
C20011
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 = ...
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
2,702
C20081
C20032
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 = ...
/* * 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
2,703
C20081
C20033
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 = ...
/* * 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
2,704
C20081
C20014
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 = ...
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
2,705
C20081
C20053
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 = ...
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
2,706
C20081
C20046
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 = ...
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
2,707
C20081
C20061
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 = ...
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
2,708
C20081
C20087
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 = ...
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
2,709
C20081
C20079
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 = ...
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
2,710
C20081
C20047
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 = ...
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
2,711
C20081
C20007
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 = ...
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
2,712
C20081
C20028
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 = ...
/* * 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
2,713
C20081
C20022
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 = ...
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
2,714
C20081
C20016
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 = ...
// 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
2,715
C20081
C20072
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 = ...
/* * 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
2,716
C20081
C20037
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 = ...
/* * 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
2,717
C20081
C20054
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 = ...
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
2,718
C20081
C20080
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 = ...
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
2,719
C20081
C20084
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 = ...
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
2,720
C20081
C20027
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 = ...
/* * 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
2,721
C20081
C20009
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 = ...
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
2,722
C20081
C20060
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 = ...
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
2,723
C20081
C20004
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 = ...
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
2,724
C20081
C20005
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 = ...
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
2,725
C20081
C20065
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 = ...
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
2,726
C20081
C20006
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 = ...
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
2,727
C20081
C20067
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 = ...
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
2,728
C20081
C20008
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 = ...
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
2,729
C20081
C20063
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 = ...
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
2,730
C20081
C20015
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 = ...
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
2,731
C20081
C20050
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 = ...
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
2,732
C20081
C20085
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 = ...
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
2,733
C20081
C20020
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 = ...
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
2,734
C20081
C20062
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 = ...
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
2,735
C20081
C20059
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 = ...
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
2,736
C20081
C20064
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 = ...
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
2,737
C20081
C20076
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 = ...
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
2,738
C20081
C20026
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 = ...
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
2,739
C20081
C20078
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 = ...
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
2,740
C20081
C20057
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 = ...
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
2,741
C20081
C20030
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 = ...
/* * 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
2,742
C20081
C20002
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 = ...
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
2,743
C20081
C20056
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 = ...
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
2,744
C20081
C20018
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 = ...
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
2,745
C20081
C20051
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 = ...
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
2,746
C20038
C20058
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 ...
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
2,747
C20038
C20011
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 ...
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
2,748
C20038
C20032
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 ...
/* * 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
2,749
C20038
C20033
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 ...
/* * 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
2,750
C20038
C20014
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 ...
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
2,751
C20038
C20053
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 ...
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
2,752
C20038
C20046
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 ...
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
2,753
C20038
C20061
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 ...
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
2,754
C20038
C20087
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 ...
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
2,755
C20038
C20079
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 ...
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
2,756
C20038
C20047
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 ...
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
2,757
C20038
C20007
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 ...
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
2,758
C20038
C20028
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 ...
/* * 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
2,759
C20038
C20022
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 ...
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
2,760
C20038
C20016
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 ...
// 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
2,761
C20038
C20072
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 ...
/* * 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
2,762
C20038
C20037
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 ...
/* * 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
2,763
C20038
C20054
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 ...
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
2,764
C20038
C20080
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 ...
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
2,765
C20038
C20084
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 ...
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
2,766
C20038
C20027
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 ...
/* * 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
2,767
C20038
C20009
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 ...
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
2,768
C20038
C20060
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 ...
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
2,769
C20038
C20004
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 ...
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
2,770
C20038
C20005
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 ...
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
2,771
C20038
C20065
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 ...
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
2,772
C20038
C20006
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 ...
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
2,773
C20038
C20067
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 ...
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
2,774
C20038
C20008
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 ...
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
2,775
C20038
C20063
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 ...
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
2,776
C20038
C20015
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 ...
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
2,777
C20038
C20050
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 ...
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
2,778
C20038
C20085
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 ...
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
2,779
C20038
C20020
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 ...
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
2,780
C20038
C20062
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 ...
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
2,781
C20038
C20059
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 ...
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
2,782
C20038
C20064
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 ...
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
2,783
C20038
C20076
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 ...
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
2,784
C20038
C20026
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 ...
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
2,785
C20038
C20078
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 ...
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
2,786
C20038
C20057
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 ...
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
2,787
C20038
C20030
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 ...
/* * 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
2,788
C20038
C20002
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 ...
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
2,789
C20038
C20056
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 ...
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
2,790
C20038
C20018
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 ...
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
2,791
C20038
C20051
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 ...
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
2,792
C20058
C20011
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...
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
2,793
C20058
C20032
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...
/* * 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
2,794
C20058
C20033
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...
/* * 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
2,795
C20058
C20014
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...
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
2,796
C20058
C20053
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...
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
2,797
C20058
C20046
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...
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
2,798
C20058
C20061
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...
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
2,799