F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
C20069 | C20046 | 0 | package com.brootdev.gcj2012.common;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
public class DataUtils {
public static int readIntLine(BufferedReader in) throws IOException {
return Integer.valueOf(in.readLine());
}
public static long readLongLine(Buff... | 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... |
C20005 | C20057 | 0 | 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... | 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... |
C20052 | C20055 | 0 | 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... | 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[... |
C20066 | C20064 | 0 | 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 >... | 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... |
C20072 | C20027 | 0 | /*
* 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... | /*
* 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... |
C20012 | C20064 | 0 |
public class CGConst {
public static final int INF = 99999999;
public static final double EPS = 1e-9;
public static final double pi = Math.PI;
}
| 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... |
C20042 | C20018 | 0 | 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.... | 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... |
C20084 | C20030 | 0 | 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... | /*
* 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 ... |
C20054 | C20026 | 0 | 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... | 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... |
C20044 | C20024 | 0 | 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 >... | 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 =... |
C20058 | C20009 | 0 | 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 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... |
C20031 | C20078 | 0 | /*
* 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;
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... |
C20031 | C20030 | 0 | /*
* 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 RayVector {
public final int x;
public final int y;
public RayVector(int x, int y) {
this.x = x;
this.y ... |
C20021 | C20067 | 0 | 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);... | 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();
... |
C20012 | C20041 | 0 |
public class CGConst {
public static final int INF = 99999999;
public static final double EPS = 1e-9;
public static final double pi = Math.PI;
}
| 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[... |
C20066 | C20041 | 0 | 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 >... | 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[... |
C20079 | C20059 | 0 | 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 ... | 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... |
C20007 | C20018 | 0 | 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;
... | 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... |
C20069 | C20087 | 0 | package com.brootdev.gcj2012.common;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
public class DataUtils {
public static int readIntLine(BufferedReader in) throws IOException {
return Integer.valueOf(in.readLine());
}
public static long readLongLine(Buff... |
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... |
C20015 | C20057 | 0 | 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... | 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... |
C20086 | C20036 | 0 | //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()... | /*
* 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... |
C20039 | C20075 | 0 | 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.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... |
C20013 | C20057 | 0 | 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... | 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... |
C20000 | C20061 | 0 | 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... | 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... |
C20052 | C20066 | 0 | 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... | 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 >... |
C20058 | C20027 | 0 | 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 java.awt.Point;
import java.util.ArrayList;
import uk.co.epii.codejam.common.DatumConverter;
/**
*
* @author jim
*/
public class HallFactory implements DatumConverter... |
C20026 | C20056 | 0 | 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... | 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... |
C20036 | C20050 | 0 | /*
* 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... | 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... |
C20082 | C20010 | 0 | import java.util.*;
import java.io.*;
class Frac
{
public static int gcd(int u, int v)
{
while (v != 0)
{
int t = v;
v = u % v;
u = t;
}
return Math.abs(u);
}
public int n;
public int d;
public Frac(int n, int d)
... | 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... |
C20028 | C20072 | 0 | /*
* 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... | /*
* 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... |
C20082 | C20051 | 0 | import java.util.*;
import java.io.*;
class Frac
{
public static int gcd(int u, int v)
{
while (v != 0)
{
int t = v;
v = u % v;
u = t;
}
return Math.abs(u);
}
public int n;
public int d;
public Frac(int n, int d)
... | 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... |
C20077 | C20006 | 0 | 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;
... | 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[] ... |
C20077 | C20002 | 0 | 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;
... | 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... |
C20023 | C20006 | 0 | 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... | 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[] ... |
C20023 | C20002 | 0 | 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... | 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... |
C20024 | C20006 | 0 | 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 =... | 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[] ... |
C20024 | C20002 | 0 | 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 =... | 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... |
C20003 | C20033 | 0 | 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;
... | /*
* 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;
}
|
C20081 | C20054 | 0 | 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... |
C20085 | C20056 | 0 | 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... | 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... |
C20074 | C20071 | 0 | 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 "... | 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... |
C20074 | C20028 | 0 | 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 "... | /*
* 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... |
C20068 | C20042 | 0 | 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... | 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.... |
C20044 | C20010 | 0 | 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 >... | 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... |
C20022 | C20064 | 0 | 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"... | 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... |
C20023 | C20058 | 0 | 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... | 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... |
C20044 | C20051 | 0 | 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 >... | 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... |
C20070 | C20065 | 0 | 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 ... | 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.... |
C20031 | C20052 | 0 | /*
* 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... |
C20071 | C20058 | 0 | 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... | 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... |
C20024 | C20058 | 0 | 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 =... | 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... |
C20027 | C20026 | 0 | /*
* 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... | 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... |
C20086 | C20072 | 0 | //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()... | /*
* 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... |
C20077 | C20008 | 0 | 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;
... | 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... |
C20063 | C20051 | 0 | 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... | 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... |
C20020 | C20026 | 0 | 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 ... | 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... |
C20023 | C20008 | 0 | 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... | 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... |
C20021 | C20071 | 0 | 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);... | 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... |
C20017 | C20037 | 0 | /*
* 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 ... | /*
* 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) {
... |
C20035 | C20046 | 0 | /*
* 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;
}
... | 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... |
C20000 | C20081 | 0 | 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... | 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 = ... |
C20024 | C20008 | 0 | 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 =... | 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... |
C20068 | C20024 | 0 | 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... | 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 =... |
C20048 | C20058 | 0 | 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... | 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... |
C20000 | C20080 | 0 | 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... | 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... |
C20021 | C20028 | 0 | 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);... | /*
* 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... |
C20019 | C20046 | 0 | 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... | 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... |
C20052 | C20078 | 0 | 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... | 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... |
C20052 | C20030 | 0 | 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... | /*
* 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 ... |
C20000 | C20076 | 0 | 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... | 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... |
C20081 | C20022 | 0 | 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"... |
C20003 | C20023 | 0 | 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;
... | 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... |
C20011 | C20057 | 0 |
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(... | 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... |
C20045 | C20059 | 0 | 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... | 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... |
C20036 | C20062 | 0 | /*
* 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... | 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... |
C20049 | C20063 | 0 | 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... | 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... |
C20035 | C20087 | 0 | /*
* 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;
}
... |
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... |
C20010 | C20084 | 0 | 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... | 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... |
C20009 | C20067 | 0 | 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... | 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();
... |
C20010 | C20015 | 0 | 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... | 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... |
C20028 | C20005 | 0 | /*
* 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... | 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... |
C20029 | C20006 | 0 | /*
* 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... | 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[] ... |
C20029 | C20002 | 0 | /*
* 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... | 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... |
C20069 | C20037 | 0 | package com.brootdev.gcj2012.common;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
public class DataUtils {
public static int readIntLine(BufferedReader in) throws IOException {
return Integer.valueOf(in.readLine());
}
public static long readLongLine(Buff... | /*
* 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) {
... |
C20075 | C20046 | 0 | 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... | 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... |
C20038 | C20084 | 0 | 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... |
C20008 | C20078 | 0 | 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... | 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... |
C20008 | C20030 | 0 | 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... | /*
* 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 ... |
C20003 | C20077 | 0 | 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;
... | 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;
... |
C20049 | C20053 | 0 | 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... | 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... |
C20034 | C20016 | 0 | /*
* 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... | // 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="... |
C20066 | C20079 | 0 | 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 >... | 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 ... |
C20010 | C20018 | 0 | 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... | 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... |
C20012 | C20079 | 0 |
public class CGConst {
public static final int INF = 99999999;
public static final double EPS = 1e-9;
public static final double pi = Math.PI;
}
| 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 ... |
C20043 | C20026 | 0 | 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... |
C20001 | C20063 | 0 | 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){
... | 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... |
C20062 | C20059 | 0 | 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... | 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... |
C20049 | C20020 | 0 | 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... | 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 ... |
C20075 | C20087 | 0 | 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... |
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... |
C20043 | C20047 | 0 | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.