F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
B10361 | B11672 | 0 | package codejam;
import java.util.*;
import java.io.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("in.txt"));
PrintWriter out = new PrintWriter(new File("out.txt"));
int T = Integer.parseInt(in.readLine());... | import java.util.ArrayList;
import java.util.Scanner;
public class RecycleNumber {
/**
* @param args
*/
int NoOfTestCase = 0;
int A = 0;
int B = 0;
ArrayList<Integer> knownList = new ArrayList<Integer>();
public static void main(String[] args) {
// TODO Auto-generated method stub
RecycleNumber rn = ne... |
B21270 | B21278 | 0 | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
public class CopyOfCopyOfMain {
static int ndigits(int n) {
return (int) (Math.log10(n) + 1);
}
static i... |
public class Recycled {
static String test = "4\n1 9\n10 40\n100 500\n1111 2222";
static String val = "50\n1049802 1946314\n1019242 1999787\n332841 815293\n1443938 1907548\n5125 9748\n1037227 1960407\n1053187 1952673\n1043225 1910832\n100000 100000\n351349 556470\n68 80\n116204 961036\n504 844\n1086291 1964681\n1000... |
B20023 | B20315 | 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.HashSet;
import java.util.Set;
public class GoogleC {
public String szamol(String input){
String result="";
String... | import java.io.*;
import java.util.*;
class GoogleRecycle
{
public static void main(String[] args)
{
Integer a,b,m,n;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
Scanner sc=new Scanner(new InputStreamReader(System.in));
int t=sc.nextInt();
String ans[]=new String[t];
for(int i=... |
A11201 | A12298 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.lang.Math;
import java.util.Arrays;
public class DancingWithTheGooglers {
public static int testSi... |
B11696 | B13079 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recycled;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
public class ProblemC {
public static void main(String [] args)
{
new ProblemC();
}
public ProblemC()
{
try
{
String [] inputFiles = { "C-small" };//,"A-large" };
BufferedReader in;
... |
A11502 | A11929 | 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.BufferedOutputStream;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;
class results {
public int numgooglers,numsurprising,p,c... |
A22378 | A22166 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class CodeJam {
// public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt";
public static final String INP... | /**
*
*/
package GoogleCodeJam2012;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
/**
* @author MArunkumar
*
*/
public class DancingWithTheGooglers {
/**
* @param args
* @throws IOException
*/
public static ... |
B12085 | B10788 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class C {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int zz = 1; zz <= T;zz++){
Integer A = in.nextInt();
Integer B = in.nextInt();
Set<String> result = new Ha... |
B10361 | B11568 | 0 | package codejam;
import java.util.*;
import java.io.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("in.txt"));
PrintWriter out = new PrintWriter(new File("out.txt"));
int T = Integer.parseInt(in.readLine());... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.BitSet;
public class ProbC {
public static long solve(int A, int B) {
int[] basePower = new int[8];
basePower[0] =1;
for(int i=1; i<8; i++)
basePower[i] = basePower[i-1] * 10;
... |
B11361 | B12077 | 0 | import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
public class C{
Scanner sc=new Scanner(System.in);
int INF=1<<28;
double EPS=1e-9;
int caze, T;
int A, B;
void run(){
T=sc.n... | 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... |
A20490 | A21217 | 0 | /**
*
*/
package hu.herba.codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io... | import java.util.Scanner;
public class B {
public static void main(String args[]) {
new B();
}
public B() {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int t=1; t<=T; t++) {
int N = in.nextInt();
int S = in.nextInt();
int p = in.nextInt();
int y = 0;
for(int n=0; n<N; n+... |
A12544 | A10029 | 0 | package problem1;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Arrays;
public class Problem1 {
public static void main(String[] args) throws FileNotFoundException, IOException{
try {
TextIO... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
public class DancingWithGooglers {
static class Googler implements Comparable<Googler>{
int averageScore;
int remainder;
Googler(int averageScore, int remainder) {
this.averageScore = ave... |
B11361 | B11822 | 0 | import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
public class C{
Scanner sc=new Scanner(System.in);
int INF=1<<28;
double EPS=1e-9;
int caze, T;
int A, B;
void run(){
T=sc.n... | import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
File file = new File("in.txt");
Scanner sca... |
B12085 | B12786 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Parser {
File instance;
Scanner sc;
public Parser(String f){
instance = new File(f);
}
public List<List<List<String>>> parse(int nbLinePerCase) throws FileNotFoundException{
sc = new Scanner(insta... |
B10858 | B11769 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| package de.johanneslauber.codejam.model;
/**
*
* @author Johannes Lauber - joh.lauber@googlemail.com
*
*/
public interface ICase {
public void setLine(int lineNumber, String lineValue);
public int getNumberOfAttributes();
}
|
B21049 | B20760 | 0 | package it.simone.google.code.jam2012;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumber implements GoogleCodeExercise {
int a = 0;
int b = 0;
Set<Couple> distinctCouple = null;
long maxTime = 0;
private class Couple {
int x = 0;
int y = 0;
public Couple(int x, int y) {
this... | package codejam;
import fixjava.Pair;
public class Utils {
public static long minLong(long firstVal, long... otherVals) {
long minVal = firstVal;
for (int i = 0; i < otherVals.length; i++)
minVal = Math.min(firstVal, otherVals[i]);
return minVal;
}
public static int minInt(int firstVal, int... otherVals... |
B10702 | B10281 | 0 | import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Recycle {
private static HashMap<Integer, HashSet<Integer>> map = new HashMap<Integer, HashSet<Integer>>();
private static HashSet<Integer> toSkip = new HashSet<Integer>();
/**
* @param args
*/
public static void main(S... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Reader;
import java.io.StreamTokenizer;
public class MySolution {
public static void main(String[] a) throws IOException {
sumfile("C-small-attempt0.in");
}
static void sumfile(String ... |
B10231 | B11632 | 0 | import java.io.*;
class code1
{
public static void main(String args[]) throws Exception
{
File ii = new File ("C-small-attempt1.in");
FileInputStream fis = new FileInputStream(ii);
BufferedReader br = new BufferedReader(new InputStreamReader (fis));
int cases = Integer.parseInt(br.readLine());
FileOutput... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
public class EagleProblemC {
public static vo... |
B10361 | B11675 | 0 | package codejam;
import java.util.*;
import java.io.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("in.txt"));
PrintWriter out = new PrintWriter(new File("out.txt"));
int T = Integer.parseInt(in.readLine());... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Calendar;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class C {
private static CodeJamIO io = new CodeJamIO();
/**
* @param args
*/
public... |
B12115 | B10982 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... | // Google Code Jam Qualification Round 2012
// Problem C. Recycled Numbers
import java.util.*;
import java.io.*;
public class RecycledNumbers{
static String inname = "C-small-attempt0.in"; // input file name here
static String outname = "C-small-attempt0.out"; // output file name here
public static vo... |
B10245 | B12768 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | package gcj2012.qr;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
/**
*
* @author Scott DellaTorre
*/
public class C {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("src/gcj201... |
B12941 | B12315 | 0 | package com.menzus.gcj._2012.qualification.c;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class CProcessorFactory extends AbstractProcessorFactory<CInput, COutputEntry> {
public CProcessorFactory(Str... | import java.io.*;
public class Recycle {
public static void main(String args[]) {
try {
InputStreamReader inReader = new InputStreamReader(new FileInputStream("input.txt"));
BufferedReader br = new BufferedReader(inReader);
File out = new File("output.txt");
Writer output = new BufferedWriter(new Fi... |
A12846 | A12251 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam.common;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Lance Chen
*/
public class CodeHelper {
private static String FILE_ROOT = "D:/workspace/googlecodejam/meta";
publi... | package year2012.qualification.b;
import java.io.File;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;
public class DancingWithTheGooglers {
public static void main(String[] args) throws Exception{
/... |
A13029 | A10892 | 0 | import java.util.List;
public class Case implements Runnable {
private int id;
private String output;
private int n;
private int s;
private int p;
private List<Integer> g;
public Case(int id) {
this.id = id;
}
public Case(int id, int n, int s, int p, List<Integer> g) {
super();
this.id = id;
this... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package utils;
/**
*
* @author fabien
*/
public interface JamCaseSolver {
public void parse();
public void solve();
} |
B21049 | B20871 | 0 | package it.simone.google.code.jam2012;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumber implements GoogleCodeExercise {
int a = 0;
int b = 0;
Set<Couple> distinctCouple = null;
long maxTime = 0;
private class Couple {
int x = 0;
int y = 0;
public Couple(int x, int y) {
this... | package codejam;
import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.PrintStream;
import java.util.HashSet;
public class _Q_C {
public static void main(String[] args) throws Exception {
String input_file = "C-large.in";
String output_file = "_Q_C_large_out.tx... |
A20490 | A21996 | 0 | /**
*
*/
package hu.herba.codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io... | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class dancing {
public static void main(String[] args) {
dancing dance = new dancing();
dance.readFile("test.txt");
}
... |
B11327 | B10029 | 0 | package recycledNumbers;
public class OutputData {
private int[] Steps;
public int[] getSteps() {
return Steps;
}
public OutputData(int [] Steps){
this.Steps = Steps;
for(int i=0;i<this.Steps.length;i++){
System.out.println("Test "+(i+1)+": "+Steps[i]);
}
}
}
| import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.StringTokenizer;
public class RecycledNumbers {
public static int calcRecycled(int A, int B) {
int total = 0;
for(int i = 0; i < B-A+1; i++) {
int[] temp = getCycles(i+A);
for(int x: temp) {
if(x == -... |
A21396 | A20153 | 0 | import java.util.*;
public class Test {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int i = 1; i<=T; i++) {
int n = in.nextInt();
int s = in.nextInt();
int p = in.nextInt();
int result = 0;
for(int j = 0; j<n; j++){
... | import java.util.*;
public class B {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int T = s.nextInt();
for (int ca = 1; ca <= T; ca++) {
int N = s.nextInt(), S = s.nextInt(), p = s.nextInt();
int good = 0, used =0;
for (int ... |
B12082 | B13254 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.util.HashSet;
public class ProblemB {
static HashSet<String> pairs = new HashSet<String>();
public static void main(S... |
B10858 | B12356 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
|
import java.util.HashSet;
import java.util.Scanner;
/**
* @author Anil Kishore, India
*/
public class Qual_C
{
static int get(int x, int A, int B)
{
int r = 0;
String s =""+x;
HashSet<Integer> set = new HashSet<Integer>();
for(int i=1;i<s.length();i++)
if(s.charA... |
B12570 | B11326 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | package recycledNumbers;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class Flow {
public static InputData Readin(String filename){
try {
FileReader fr = new FileReader(filena... |
A20382 | A21259 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... | import java.util.ArrayList;
import java.util.Collections;
public class Solver {
int S;
int p;
ArrayList<Integer> scores;
Solver(int S, int p, ArrayList<Integer> scores) {
this.S = S;
this.p = p;
this.scores = scores;
}
static int getMaxScoreNoSuprise(int n) {
int base = n / 3 - 1;
if (base < 0)
ba... |
A12846 | A11170 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam.common;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Lance Chen
*/
public class CodeHelper {
private static String FILE_ROOT = "D:/workspace/googlecodejam/meta";
publi... | package codezam.exercise.WR1B2012;
public class Triplet {
long numberA;
long numberB;
long numberC;
boolean isSurprising = false;
long numberMax;
public Triplet(long numberA, long numberB, long numberC) {
this.numberA = numberA;
this.numberB = numberB;
this.numberC = numberC;
//Valid ÇÏ°Ô µé¾î¿Â´Ù°í... |
B20006 | B20278 | 0 | import java.io.*;
import java.math.BigInteger;
import java.util.*;
import org.jfree.data.function.PowerFunction2D;
public class r2a
{
Map numMap = new HashMap();
int output = 0;
/**
* @param args
*/
public static void main(String[] args)
{
r2a mk = new r2a();
try {
... | import java.io.*;
import java.util.*;
import java.math.*;
import java.awt.geom.*;
import static java.lang.Math.*;
public class Solution implements Runnable {
static final int [] mul = {1, 10, 100, 1000, 10000, 100000, 1000000};
int getLen (int num) {
int ret = 0;
while (num > 0) {
num /= 10;
ret++;
... |
A20382 | A20153 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... | import java.util.*;
public class B {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int T = s.nextInt();
for (int ca = 1; ca <= T; ca++) {
int N = s.nextInt(), S = s.nextInt(), p = s.nextInt();
int good = 0, used =0;
for (int ... |
A10699 | A12588 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Dancing {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) ... | import java.lang.reflect.Array;
import java.util.*;
public class ArrayUtil {
static<T> T[] revers (T[] t){
List<T> list = Arrays.asList(t);
Collections.reverse(list);
return (T[]) list.toArray();
}
static<T> Map<T,Integer> listToMap(List<T> list) {
HashMap<T, Integer> map =... |
B10485 | B12826 | 0 |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class Recycle
{
public static void main(String[] args)
{
/* Set<Integer> perms = getPermutations(123456);
for(Integer i: p... | import java.io.*;
import java.util.*;
public class Cre
{
public static void main(String args[])throws FileNotFoundException,IOException
{
RandomAccessFile in=new RandomAccessFile("C-small-attempt0.in","r");
FileOutputStream out= new FileOutputStream("out.txt");
int o=Integer.parseInt(in.readLine())... |
B11318 | B12537 | 0 | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
int casos=1, a, b, n, m, cont;
while(t!=0){
a=sc.nextInt();
b=sc.nextInt();
if(a>b){
int aux=a;
a=b;
b=aux;
}
System.out.printf("Case #%d: ",casos... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class CodeJam {
// public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt";
public static final String INP... |
A11135 | A12657 | 0 | /**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/3/12
* Time: 11:00 AM
* To change this template use File | Settings | File Templates.
*/
import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;
import java.io.*;
import java.util.*;
import java.uti... | import java.io.FileInputStream;
import java.util.*;
import java.math.*;
public class Main {
public static void main(String[] args) throws Exception{
Scanner scan = new Scanner(System.in);
//Scanner scan = new Scanner(new FileInputStream("C:\\Users\\wd\\Desktop\\"));
char[] map = "yhes... |
A13029 | A11964 | 0 | import java.util.List;
public class Case implements Runnable {
private int id;
private String output;
private int n;
private int s;
private int p;
private List<Integer> g;
public Case(int id) {
this.id = id;
}
public Case(int id, int n, int s, int p, List<Integer> g) {
super();
this.id = id;
this... | package gjc.googledancer;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.StringTokenizer;
public class Solution {
/**
* @param args
*/
public static void main(String[] args) throws IOException {
... |
B21968 | B21486 | 0 | import java.util.*;
import java.io.*;
public class recycled_numbers {
public static void main(String[]a) throws Exception{
Scanner f = new Scanner(new File(a[0]));
int result=0;
int A,B;
String n,m;
HashSet<String> s=new HashSet<String>();
int T=f.nextInt(); //T total case count
for (int t=1; t<=T... | import java.io.*;
public class C
{
public static void main(String[] args) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int T = Integer.parseInt(br.readLine());
String[] line;
for(int i=1;i<=T;i++)
{
line = br.readLine().split("\\W+");
int a = Inte... |
A21396 | A22532 | 0 | import java.util.*;
public class Test {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int i = 1; i<=T; i++) {
int n = in.nextInt();
int s = in.nextInt();
int p = in.nextInt();
int result = 0;
for(int j = 0; j<n; j++){
... | import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
public class googler {
/**
* @param args
*/
static Scanner kb ;
public static void main(String[] args) throws FileNotFoundException {
// TODO Auto-generated method stub
PrintWriter out = new PrintWriter("answergoogle... |
B21968 | B21630 | 0 | import java.util.*;
import java.io.*;
public class recycled_numbers {
public static void main(String[]a) throws Exception{
Scanner f = new Scanner(new File(a[0]));
int result=0;
int A,B;
String n,m;
HashSet<String> s=new HashSet<String>();
int T=f.nextInt(); //T total case count
for (int t=1; t<=T... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.*;
import java.util.*;
/**
*
* @author Alex
*/
public class ReduceReuseButDont
{
public static void main(String sArgs[]) throws IOException
{
Scanner oScan = new Scanner(n... |
B10858 | B11281 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| package com.google.codejam;
public class RecycledNumbers {
public int solve(int[] n){
int res = 0;
int len = getLen(n[0]);
int[] sh = new int[len-1];
for (int i = n[0]; i <= n[1]; i++) {
for (int j = 1; j < len; j++) {
int ni = shift(i, j, len);
sh[j-1] = ni;
if(ni > i && ni <= n[1]) {
bo... |
B12941 | B10906 | 0 | package com.menzus.gcj._2012.qualification.c;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class CProcessorFactory extends AbstractProcessorFactory<CInput, COutputEntry> {
public CProcessorFactory(Str... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.List;
public class Main {
p... |
A21010 | A21413 | 0 | package codejam;
import fixjava.Pair;
public class Utils {
public static long minLong(long firstVal, long... otherVals) {
long minVal = firstVal;
for (int i = 0; i < otherVals.length; i++)
minVal = Math.min(firstVal, otherVals[i]);
return minVal;
}
public static int minInt(int firstVal, int... otherVals... |
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.Observable;
import java.io.FileNotFoundException;
import java.io.IOExcep... |
A10699 | A12753 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Dancing {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) ... | import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Dancing
{
public static void main(String[] args) throws FileNotFoundException
{
Scanner sc = new Scanner(new File("inputs/dancing.in"));
int cases = sc.nextInt();
for (int... |
A12846 | A10242 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam.common;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Lance Chen
*/
public class CodeHelper {
private static String FILE_ROOT = "D:/workspace/googlecodejam/meta";
publi... | package com.googlecode.contest.dancing;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.List;
import java... |
A22078 | A22452 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
public class GooglersDancer {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated metho... | package util.graph;
public abstract class State implements Comparable{
}
|
B12082 | B12766 | 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.HashSet;
import java.util.Scanner;
public class RecycledNumbers {
static String outputFile, inputFile;
public static void main(String[] args) throws IOException {
if (args.length != 2)
return;
inputFile = args[0];
outputFile = args[1];
// Create FileReader Object
... |
B11327 | B12612 | 0 | package recycledNumbers;
public class OutputData {
private int[] Steps;
public int[] getSteps() {
return Steps;
}
public OutputData(int [] Steps){
this.Steps = Steps;
for(int i=0;i<this.Steps.length;i++){
System.out.println("Test "+(i+1)+": "+Steps[i]);
}
}
}
| package util.graph;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
public class DynDjikstra {
public static State FindShortest(Node start, Node target) {
PriorityQueue<Node> openSet = new PriorityQueue<>();
Set<Node> closedSet = new HashSet<>();
openSet.add... |
A20382 | A22532 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... | import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
public class googler {
/**
* @param args
*/
static Scanner kb ;
public static void main(String[] args) throws FileNotFoundException {
// TODO Auto-generated method stub
PrintWriter out = new PrintWriter("answergoogle... |
A10996 | A12988 | 0 | import java.util.Scanner;
import java.io.*;
class dance
{
public static void main (String[] args) throws IOException
{
File inputData = new File("B-small-attempt0.in");
File outputData= new File("Boutput.txt");
Scanner scan = new Scanner( inputData );
PrintStream print= new PrintStream(outputData);
... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package question2;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
/**
*
* @author karim
*/
p... |
A11201 | A12266 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.StringTokenizer;
public class GoogleDancers{
public static void main(String[] args) throws Exception{
FileReader fr = new FileReader("C:\\Projects\\Learning\\src\\B-small-attempt1.in");
BufferedReader br = new B... |
B20006 | B20593 | 0 | import java.io.*;
import java.math.BigInteger;
import java.util.*;
import org.jfree.data.function.PowerFunction2D;
public class r2a
{
Map numMap = new HashMap();
int output = 0;
/**
* @param args
*/
public static void main(String[] args)
{
r2a mk = new r2a();
try {
... | package be.mokarea.gcj.recyclednumbers;
import be.mokarea.gcj.common.TestCase;
public class RecycledNumbersTestCase extends TestCase {
private final int a;
private final int b;
protected RecycledNumbersTestCase(int caseNumber, int a, int b) {
super(caseNumber);
this.a = a;
this.b = b;
}
public int getA(... |
A10793 | A13232 | 0 | import java.io.*;
import java.math.*;
import java.util.*;
import java.text.*;
public class b {
public static void main(String[] args) {
Scanner sc = new Scanner(new BufferedInputStream(System.in));
int T = sc.nextInt();
for (int casenumber = 1; casenumber <= T; ++casenumber) {
... | package codejam2012.qr.dancing;
import codejam2012.qr.googlerese.Translator;
import codejam2012.util.ReadWriteUtil;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author fedez
*/
public class Main
{
/**
* Args0 in file
* Args1 out file
* @param args the command line arguments
*... |
A22078 | A20343 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
public class GooglersDancer {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated metho... | import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class B {
public static void main(String[] args) throws IOException {
int nCases;
String filename="B-large";
//String filename="B-small-attempt0";
//String filename=... |
A12570 | A12968 | 0 | package util.graph;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
public class DynDjikstra {
public static State FindShortest(Node start, Node target) {
PriorityQueue<Node> openSet = new PriorityQueue<>();
Set<Node> closedSet = new HashSet<>();
openSet.add... | package mgg.utils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
public class CorrespondenceUtils {
public static String getT9Correspondence(char c) {
/** Generating code:
for(int i = 0; i<=25; i++){
System.out.println("case '"+((char)(i+((int)'a')))+"':");
System.ou... |
B11327 | B11800 | 0 | package recycledNumbers;
public class OutputData {
private int[] Steps;
public int[] getSteps() {
return Steps;
}
public OutputData(int [] Steps){
this.Steps = Steps;
for(int i=0;i<this.Steps.length;i++){
System.out.println("Test "+(i+1)+": "+Steps[i]);
}
}
}
|
import java.awt.Point;
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import static java.lang.Math.*;
public class ProblemC_Qual_2012 implements Runnable{
BufferedReader in;
PrintWriter out;
StringTokenizer tok = new StringTokenizer("");
void init() throws FileNotFoundException{
in = n... |
B21968 | B20335 | 0 | import java.util.*;
import java.io.*;
public class recycled_numbers {
public static void main(String[]a) throws Exception{
Scanner f = new Scanner(new File(a[0]));
int result=0;
int A,B;
String n,m;
HashSet<String> s=new HashSet<String>();
int T=f.nextInt(); //T total case count
for (int t=1; t<=T... |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class Recycle
{
public static void main(String[] args)
{
/* Set<Integer> perms = getPermutations(123456);
for(Integer i: p... |
B12115 | B10680 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... | /*
GCJ2012-Q
*/
import java.io.*;
import java.util.*;
import java.math.*;
public class GCJ2012QC {
static BufferedReader fin;
static PrintWriter fout;
// change numefile
static String file="qcs2";
static String infile=file+".in";
static String outfile=file+".out";
//
// write result to o... |
B12074 | B11876 | 0 | 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... | package com.google.codejam;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Scanner;
import java.util.regex.Pattern;
public class CodeJam3 {
private static int testCase;
private static FileOutputStream fostream;
private static Data... |
A12211 | A10257 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class Dancing_improved {
static int f_Superan_limites(String params){
int superan_limite=0;
String[] para... |
import java.util.Scanner;
public class B {
/**
* @param args
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int i = 1; i <= T; i++) {
int N = sc.nextInt();
int S = sc.nextInt();
int p = sc.nextInt();
int t[] = new int[N];
for (i... |
B21968 | B20181 | 0 | import java.util.*;
import java.io.*;
public class recycled_numbers {
public static void main(String[]a) throws Exception{
Scanner f = new Scanner(new File(a[0]));
int result=0;
int A,B;
String n,m;
HashSet<String> s=new HashSet<String>();
int T=f.nextInt(); //T total case count
for (int t=1; t<=T... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for (int ti = 0; ti < t; ti++) {
int a = sc.nextInt(), b = sc.nextInt();
int sum = 0;
for (int i = a; i <= b; i++) {
int numOfDigits, power;
if (i < ... |
B10155 | B12050 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
/**
*
* @author eblanco
*/
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
impo... | import java.util.Scanner;
public class RecycleNum {
static int digit(int x){
int d = 0;
while( x>0 ){
d++;
x /= 10;
}
return d;
}
static int power(int x){
int n = 1;
while(x>0){
n *= 10;
x--;
}
return n;
}
static int cirNum(int n, int m){
int d = digit(n);
n = (n%power(d-m))*power(... |
A20261 | A21174 | 0 | package com.gcj.parser;
public class MaxPoints {
public static int normal(int value){
int toReturn = 0;
switch (value) {
case 0 : toReturn = 0 ; break;
case 1 : toReturn = 1 ; break;
case 2 : toReturn = 1 ; break;
case 3 : toReturn = 1 ; break;
case 4 : toReturn = 2 ; break;
case 5 : toReturn = 2 ; b... | package codejam2012.qualified;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class ProblemB {
static BufferedReader buffReader = null;
static BufferedWriter buffWriter = nu... |
A20490 | A20192 | 0 | /**
*
*/
package hu.herba.codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io... | import java.util.*;
import static java.lang.Math.*;
public class BB {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int zz = 1; zz <= T;zz++){
int N = in.nextInt();
int S = in.nextInt();
int p = in.nextInt();
int res = 0;
for(int i = 0; i <... |
B10702 | B12949 | 0 | import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Recycle {
private static HashMap<Integer, HashSet<Integer>> map = new HashMap<Integer, HashSet<Integer>>();
private static HashSet<Integer> toSkip = new HashSet<Integer>();
/**
* @param args
*/
public static void main(S... | package google.solver;
public interface ChallengeConstants {
public static final String DELIMITER = "\\";
public static final String CHALLENGE_DEFINITION = "challengeDefinition";
public static final String BASE_DIR= "D:\\Development\\Workspaces\\test1\\googleChallanges\\src\\google\\contest";
public static final... |
A12846 | A11241 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam.common;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Lance Chen
*/
public class CodeHelper {
private static String FILE_ROOT = "D:/workspace/googlecodejam/meta";
publi... | /**
* Copyright 2012 Christopher Schmitz. All Rights Reserved.
*/
package com.isotopeent.codejam;
import com.isotopeent.codejam.lib.SolverBase;
import com.isotopeent.codejam.lib.Utils;
import com.isotopeent.codejam.lib.converters.IntArrayLine;
public class Solver extends SolverBase<int[]> {
private static final ... |
A12570 | A12102 | 0 | package util.graph;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
public class DynDjikstra {
public static State FindShortest(Node start, Node target) {
PriorityQueue<Node> openSet = new PriorityQueue<>();
Set<Node> closedSet = new HashSet<>();
openSet.add... | import java.io.*;
public class B
{
public static void main(String args[]) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int T = Integer.parseInt(br.readLine());
String[] line;
int N,S,p;
int[][] tuple = new int[1000][3];
int[][] stuple = new int[1000][3];... |
B12570 | B12360 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | package codejam.qualification;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(new File("input.txt"));
FileWriter out = new FileWriter("output.txt");
... |
A12460 | A11506 | 0 | /**
*
*/
package pandit.codejam;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Scanner;
/**
* @author Manu Ram Pandit
*
*/
public class DancingWithGoogle... |
import java.io.*;
import java.util.Scanner;
public class Dancers {
public static void main(String[] args) throws FileNotFoundException, IOException {
Scanner sc = new Scanner(new File("D:/testing/B-small-attempt0.in"));
BufferedWriter bf = new BufferedWriter(new FileWriter("D:/testing/b.txt", fal... |
B12085 | B11905 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | import java.util.*;
public class C
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int test = 1, cases = sc.nextInt();
int a, b, curr, count;
String aStr, bStr, num, shift;
while(test <= cases)
{
count = 0;
a = sc.nextInt();
b = sc.nextInt();
aStr = Integer.t... |
A10699 | A10457 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Dancing {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) ... | import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Solution {
/**
* @param args
* @throws Exception
*/
public static void doMain() throws Excep... |
A12460 | A11990 | 0 | /**
*
*/
package pandit.codejam;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Scanner;
/**
* @author Manu Ram Pandit
*
*/
public class DancingWithGoogle... | package codejam2012;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.PrintStream;
public class ProblemB
{
public static void main(String[] args) throws Exception
{
BufferedReader in = new BufferedReader(new FileReader("in.txt"));
PrintStream out = System.out;
out = new PrintStream("ou... |
B21270 | B20792 | 0 | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
public class CopyOfCopyOfMain {
static int ndigits(int n) {
return (int) (Math.log10(n) + 1);
}
static i... | import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Scanner;
public class C {
public static void main(String[] args) throws Exception {
Scanner in = new Scanner(new FileReader(new File("C.in")));
PrintWriter out = new PrintWriter(new FileWriter(... |
B10155 | B11135 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
/**
*
* @author eblanco
*/
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
impo... | package recyclednumbers.recycler;
import junit.framework.Assert;
import org.junit.Test;
public class RecyclerTest {
@Test
public void exampleTest() {
Recycler recycler = new Recycler();
Assert.assertTrue(recycler.isRecycledPair(12345, 34512));
Assert.assertEquals(0, recycler.countP... |
B20734 | B20178 | 0 | package fixjava;
public class StringUtils {
/** Repeat the given string the requested number of times. */
public static String repeat(String str, int numTimes) {
StringBuilder buf = new StringBuilder(Math.max(0, str.length() * numTimes));
for (int i = 0; i < numTimes; i++)
buf.append(str);
return buf.toStr... | package codejam2.recycled;
import java.util.HashSet;
import java.util.Scanner;
import codejam2.CodejamCase;
import codejam2.CodejamRunner;
public class Recycled extends CodejamRunner implements CodejamCase {
private int min;
private int max;
private String result;
@Override
public void compute() {
int r = 0;
... |
B10485 | B12257 | 0 |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class Recycle
{
public static void main(String[] args)
{
/* Set<Integer> perms = getPermutations(123456);
for(Integer i: p... | package codejam.round1;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;
public class ProblemC {
public static void main(String[] args) throws Exception {
BufferedReader bufferedReader = new Buffe... |
B12115 | B11483 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
public class RecycledNumbers {
public static int outputLine(String inputLine){
int count = 0;
String[] inputArray = inputLine.split(" ");
ArrayList line = new ArrayList(Arrays.asList(inputArray));
int min = Integer.parseInt((Stri... |
B20734 | B21603 | 0 | package fixjava;
public class StringUtils {
/** Repeat the given string the requested number of times. */
public static String repeat(String str, int numTimes) {
StringBuilder buf = new StringBuilder(Math.max(0, str.length() * numTimes));
for (int i = 0; i < numTimes; i++)
buf.append(str);
return buf.toStr... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator... |
B12074 | B10353 | 0 | 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... | import java.io.*;
public class RecycledNumbers {
public static void main(String[] args) {
if(args.length < 1) {
System.out.println("Need a filename.");
}
else {
File file = new File(args[0]);
try {
BufferedReader fin = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
int n... |
A12846 | A13007 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam.common;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Lance Chen
*/
public class CodeHelper {
private static String FILE_ROOT = "D:/workspace/googlecodejam/meta";
publi... | import java.util.*;
import java.io.*;
public class DancingWithTheGooglers{
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Formatter formatter = new Formatter(System.out);
int T = Integer.parseInt(br.readLine());
... |
A11502 | A10186 | 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 CodeJam2012.Qualification;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
public class ProblemB {
private static final String DIRECTORIO = "D:\\CodeJam\\CodeJam2012\\Qualification\\ProblemB\... |
A12460 | A11111 | 0 | /**
*
*/
package pandit.codejam;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Scanner;
/**
* @author Manu Ram Pandit
*
*/
public class DancingWithGoogle... | import java.util.Scanner;
public class JuanjeProblemaB
{
/*
* Juan Jesus Gutierrez
* Solucion al problema - B
*/
public static void main(String[] args)
{
//lector de la entrada
Scanner in = new Scanner(System.in);
//in.nextLine();
//numero de frases en Googlerese
int T = in.nextInt();
in.nextLin... |
B12074 | B12492 | 0 | 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... | package RecycledNumber;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashMap;
public class RecycledNumber
{
public static void main(String[] args) throws IOException
{
//open the file
FileReader ... |
B13196 | B12084 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Q3M {
public static void main(String[] args) throws Exception {
compute();
}
private ... | import java.io.*;
import java.util.*;
public class C
{
public static void main(String[] args) throws Exception
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int numCases = Integer.parseInt(br.readLine());
for(int i = 0; i < numCases; i++) {
solveCase(i+1, br.readLine());
... |
A12544 | A12066 | 0 | package problem1;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Arrays;
public class Problem1 {
public static void main(String[] args) throws FileNotFoundException, IOException{
try {
TextIO... | import java.io.*;
import java.util.*;
public class DancingGooglers {
public static void main(String args[]) {
try {
String strFileName = args[0];
BufferedReader bfReader = new BufferedReader(new FileReader(strFileName));
long nTestCases = Integer.parseInt(bfReader.readLine());
for(int testCaseCounte... |
A22771 | A21749 | 0 | package com.menzus.gcj._2012.qualification.b;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class BProcessorFactory extends AbstractProcessorFactory<BInput, BOutputEntry> {
public BProcessorFactory(Str... | import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.FileReader;
@SuppressWarnings("CallToThreadDumpStack")
public class Utils
{
private static FileOutputStream outStream;
private static BufferedReader reader;
private static boolean debug = false;
public static void openOutFi... |
A21010 | A20171 | 0 | package codejam;
import fixjava.Pair;
public class Utils {
public static long minLong(long firstVal, long... otherVals) {
long minVal = firstVal;
for (int i = 0; i < otherVals.length; i++)
minVal = Math.min(firstVal, otherVals[i]);
return minVal;
}
public static int minInt(int firstVal, int... otherVals... | import java.io.*;
import java.util.StringTokenizer;
import java.lang.Math;
public class qualifycodejamB{
public static int surprisePVal(int score){
if(score < 4){
if(score == 0){
return 0;
}else if(score == 1){
return 1;
}else{
return 2;
}
}
double dscore = (double) score;
if((dscor... |
A12460 | A11223 | 0 | /**
*
*/
package pandit.codejam;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Scanner;
/**
* @author Manu Ram Pandit
*
*/
public class DancingWithGoogle... | import java.io.*;
import java.util.*;
public class Solution {
public static int calc(int N, int S, int p, int[] t){
int ret = 0;
ArrayList<Integer> list = new ArrayList<Integer>();
for(int i=0; i<t.length; i++){
if(Math.ceil((double)t[i]/3) >= p){
ret ++;
}
// surprisingåè£
else{
... |
B11327 | B10608 | 0 | package recycledNumbers;
public class OutputData {
private int[] Steps;
public int[] getSteps() {
return Steps;
}
public OutputData(int [] Steps){
this.Steps = Steps;
for(int i=0;i<this.Steps.length;i++){
System.out.println("Test "+(i+1)+": "+Steps[i]);
}
}
}
| package io;
import java.io.File;
import java.util.Scanner;
public class Reader {
public static String[] getInput(File f){
try {
Scanner reader = new Scanner(f);
int numLines = Integer.parseInt(reader.nextLine());
String[] res = new String[numLines];
for (int i = 0; i < res.length; i++)res[i] = reader.n... |
B10245 | B11624 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | import java.io.IOException;
import java.util.ArrayList;
import java.util.Vector;
public class RecycledNumbers {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
ReadFile.read("C:\\test\\input.txt");
ArrayList<Stri... |
B10149 | B10237 | 0 | import java.io.FileInputStream;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeSet;
// Recycled Numbers
// https://code.google.com/codejam/contest/1460488/dashboard#s=p2
public class C {
private static String process(Scanner in) {
int A = in.nextInt();
int B = in.nextInt();
int res =... | package codejam2;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Date;
import java.util.Scanner;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
public a... |
B10231 | B10680 | 0 | import java.io.*;
class code1
{
public static void main(String args[]) throws Exception
{
File ii = new File ("C-small-attempt1.in");
FileInputStream fis = new FileInputStream(ii);
BufferedReader br = new BufferedReader(new InputStreamReader (fis));
int cases = Integer.parseInt(br.readLine());
FileOutput... | /*
GCJ2012-Q
*/
import java.io.*;
import java.util.*;
import java.math.*;
public class GCJ2012QC {
static BufferedReader fin;
static PrintWriter fout;
// change numefile
static String file="qcs2";
static String infile=file+".in";
static String outfile=file+".out";
//
// write result to o... |
B20006 | B21699 | 0 | import java.io.*;
import java.math.BigInteger;
import java.util.*;
import org.jfree.data.function.PowerFunction2D;
public class r2a
{
Map numMap = new HashMap();
int output = 0;
/**
* @param args
*/
public static void main(String[] args)
{
r2a mk = new r2a();
try {
... | import static java.util.Arrays.deepToString;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.concurrent.Callable;
import java.util.concurrent.... |
B10702 | B12163 | 0 | import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Recycle {
private static HashMap<Integer, HashSet<Integer>> map = new HashMap<Integer, HashSet<Integer>>();
private static HashSet<Integer> toSkip = new HashSet<Integer>();
/**
* @param args
*/
public static void main(S... | import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class C {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("C-small-attempt1.in"));
FileWriter fw = new FileWriter("C-small.out");
/*BufferedReader in = new BufferedReade... |
A12113 | A11085 | 0 | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class B {
static int[][] memo;
static int[] nums;
static int p;
public static void main(String[] args)throws IOException
{
Scanner br=new Scanner(new File("B-small-attempt0.in"... | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class B {
public static void main(String[] args) throws IOException {
BufferedReader br = ne... |
B20291 | B20901 | 0 | import java.io.*;
import java.util.*;
class B
{
public static void main(String[] args)
{
try
{
BufferedReader br = new BufferedReader(new FileReader("B.in"));
PrintWriter pw = new PrintWriter(new FileWriter("B.out"));
int X = Integer.parseInt(br.readLine());
for(int i=0; i<X; i++)
{
String[]... | /**
* Copyright 2012 Christopher Schmitz. All Rights Reserved.
*/
package com.isotopeent.codejam.lib.converters;
import com.isotopeent.codejam.lib.InputConverter;
public class MultiLineConverter implements InputConverter<Object[]> {
private InputConverter<?>[] converters;
private int count;
private Object[] i... |
B21752 | B21337 | 0 | package Main;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
/**
* Created with IntelliJ IDEA.
* User: arran
* Date: 14/04/12
* Time: 3:12 PM
* To change ... | package com.google.codejam;
import java.util.HashSet;
import java.util.Set;
import com.google.codejam.util.CodeJamInputFile;
import com.google.codejam.util.CodeJamOutputFile;
public class Recycle {
/**
* @param args
*/
public static void main(String[] args) {
Integer count;
CodeJamInputFile f = new Code... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.