F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
A12846 | A13071 | 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.vp.common;
import com.vp.fact.SolutionFactory;
import com.vp.iface.Problem;
public class ExecutorApp {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String inputFileName = "C:/Workspace/GCJ2012/src/com/vp/data/sample_input.txt";
S... |
B12085 | B13203 | 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... | package tr0llhoehle.cakemix.googleCodeJam.recycledNumbers;
import java.util.ArrayList;
import tr0llhoehle.cakemix.utility.googleCodeJam.Solver;
public class RNSolver implements Solver<RNProblem> {
@Override
public String solve(RNProblem p) {
int amount = 0;
for (Integer i = p.getLowerBorder(); i < p.getUpper... |
B21049 | B20007 | 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... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
public class C {
Map<String, Set<Integer>> map = new HashMap<String, Set<Integer>>();
Set<int[]> pairs = new HashSe... |
A10793 | A11430 | 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) {
... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
public class ProblemaB {
private final static String RUTA="C:/Users/Rafael/Documents/Estudio/OtherStuff/Googl... |
B21227 | B21760 | 0 | import java.util.HashSet;
import java.util.Scanner;
public class C {
static HashSet p = new HashSet();
static int low;
static int high;
int count = 0;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int no = sc.nextInt();
for (int i = 1; i <= no; i++) {
p.clear();
lo... | import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class mainclass {
public static void main(String args[]) throws IOException {
int cases;
int a;
int b;
int flag;
int counter;
int[] data;
int temp = 0;
... |
A22360 | A20686 | 0 | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Scanner;
public class Dancing_With_the_Googlers {
/**
* The first line of the input gives the ... | import java.util.*;
import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.text.DecimalFormat;
/**
*
*
*/
public class B {
public static void main(String[] args) {
try {
Scanner scanner = (new Scanner(new File("c:/input.txt")));
int N = s... |
B10485 | B12382 | 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.util.*;
import java.io.*;
class Caso{
int a;
int b;
public void leer(Scanner s){
a=s.nextInt();
b=s.nextInt();
}
public Caso(){
}
public String obtenerRespuesta(){
long resultado=0;
for(int i=a;i<=b;i++){
int j=1;
int nd=(int)Math.log10(i)+1;
HashMap<Integer,Integer>h=new HashMap<Int... |
B21049 | B21574 | 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... | import java.util.*;
import java.io.*;
import java.lang.Integer;
public class QuestionC
{
public static void main(String[] args) throws IOException
{
Scanner inPut = new Scanner(new File("C-large.in"));
FileWriter fWriter = new FileWriter("C-large.out");
int caseTotal = inPut.nextInt(... |
A10699 | A10961 | 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) ... | package br.com;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
public class ProblemaB {
static String caminho = "/home/mateus/";
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(new File(caminho + "entrada.txt"));
FileWrit... |
A11502 | A12789 | 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.*;
import java.util.*;
public class tr
{
public static void main(String args[])throws FileNotFoundException,IOException
{
RandomAccessFile in=new RandomAccessFile("B-small-attempt3.in","r");
FileOutputStream out= new FileOutputStream("out.txt");
int o=Integer.parseInt(in.readLine());... |
A20119 | A21450 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | package Qualification;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
import java.util.StringTokenizer;
public class ProblemB {
int good;
int needsSuprise;
int bad;
int p;
public ProblemB() throws IOException {
BufferedWriter... |
B10155 | B12840 | 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.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.*;
import javax.sql.rowset.Joinable;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.lang.Integer.*;
import static java.lang.Character.*;
public class C {
stati... |
B11318 | B11595 | 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.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.Character.Subset;
import java.util.ArrayList;
import java.util.HashMap;
public class ... |
A10793 | A10288 | 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 gcj;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
/**
* @param args
*/
private static int[] values = null;
private static int[] g... |
B11327 | B11933 | 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.util.HashSet;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
public class RN
{
public static Set<Pair<Integer, Integer>> RNPair = new HashSet<Pair<Integer, Integer>>();
public static class Pair<L,R> {
private final L left;
private final R right;
public Pair(L lef... |
A12273 | A11287 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Dancing
* Jason Bradley Nel
* 16287398
*/
import java.io.*;
public class Dancing {
public static void main(String[] args) {
In input = new In("input.txt");
int T = Integer.parseInt(input.... | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class QualB
{
public void run()throws IOException
{
Scanner in = new Scanner(new File("b.in"));
PrintWriter out = new PrintWriter("b.out");
int nt = in.nextInt();
in.nextLine();
for(int it = 1;... |
A10793 | A10940 | 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) {
... | 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 codejamp2 {
public static char[] map;
public static void main(String[] args) throws IOException{
readFile();
}
publi... |
B12570 | B11463 | 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... |
public class RecycleNumber {
int count=0;
public RecycleNumber(int A,int B){
for(int n=A;n<B-1;n++){
for(int m=n+1;m<=B;m++){
if(isRecycledPair(n,m)){
count++;
}
}
}
}
public int getCount() {
return count;
}
boolean isRecycledPair(int a,int b){
String sA=a+"";
String sB=b+"";
... |
A21557 | A22583 | 0 | import java.io.*;
import java.util.*;
public class DancingWithGooglers {
public static class Googlers {
public int T;
public int surp;
public boolean surprising;
public boolean pSurprising;
public boolean antiSurprising;
public boolean pAntiSurprising;
public Googlers(int T, int surp) ... | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class B {
public static void main(String[]args)throws Exception {
File f = new File(args[0]);
File out = new File(f.getParentFile(), f.getName()+".out");
Buff... |
B20023 | B20191 | 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... | package core;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
import java.util.ArrayList;
import java.util.List;
public class ExtendedBufferedReader extends BufferedReader {
public ExtendedBufferedReader(Reader iReader) {
super(iReader);
}
public String getLine(){
try {
... |
A22771 | A22727 | 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.File;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.FileWriter;
import java.io.FileReader;
public class ProblemB {
static String inputfile = "B-large.in";
static String outputfile = "B-large.out";
public static void main(String args[]) throws Exception {
Buffered... |
B11318 | B10883 | 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... | package de.at.codejam.util;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
public class AbstractOutputFileWriter<CASE> {
private File outputFile;
public AbstractOutputFileWriter(File outputFile) {
this.outputFile = outputFile;
}
public void setOutpu... |
B10155 | B12045 | 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;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.u... |
A22992 | A21146 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author dannocz
*/
public class InputReader {
public static Input r... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package competition;
/**
*
* @author Sriram
*/
import java.util.Scanner;
import java.io.FileInputStream;
import java.io.PrintStream;
public class DancingWithGooglers_GCJ_2012 {
public static void main(Stri... |
A20119 | A23002 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | import java.io.*;
import java.util.*;
public class CodeJamProblem implements Runnable {
public int getRisultato(int n, int s, int p, int[] points) {
// n=6 s=2 p=8 29 20 8 18 18 21
int vincitori = 0;
int suprise = s;
//Arrays.sort(points);
System.out.println("CASE:"+Arrays.toString(points));
for(in... |
B10231 | B10987 | 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.*;
import java.util.*;
public class trie
{
public static void main(String[] args)throws IOException
{
int i,j,a,b,n,ans;
String s1="",p1="";
solver h1=new solver();
Scanner fin=new Scanner(new File("A.txt"));
s1=fin.nextLine();
n=Integer.parseInt(s1);... |
A20382 | A20261 | 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... | 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... |
B22190 | B20585 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
public class Recycled {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.par... | package com.forthgo.google.g2012r0;
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;
/**
* Created by Xan Gregg.
* Date: 4/14/12
*/
public class ProblemC {
public static void main(St... |
B12570 | B11519 | 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... | import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;
public class RecycledNumbers {
static int t, a, b;
public static void main(String[] args) throws FileNotFoundException {
Scanner reader = new Scanner(new File("numbers.in"));
t = reader.nextInt();... |
B12941 | B11634 | 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.util.*;
import java.io.*;
public class qualC
{
public static void main(String[] args) throws IOException
{
Scanner sin = new Scanner(new File("/Users/G/Documents/Programming/Java/CodeJam2012/C-small-attempt0.in"));
int t = sin.nextInt(), a, b;
for(int i = 1; i <= t; ++i)
{
a = sin.nextInt()... |
A22191 | A22594 | 0 | package com.example;
import java.io.IOException;
import java.util.List;
public class ProblemB {
enum Result {
INSUFFICIENT,
SUFFICIENT,
SUFFICIENT_WHEN_SURPRISING
}
public static void main(String[] a) throws IOException {
List<String> lines = FileUtil.getLines("/B-large.in");
int cases = Int... | package com.google.dancing;
import java.util.Scanner;
import com.google.util.FileUtil;
/*
*
*
*/
public class Dancing {
public static void main(String[] args) {
String orgFilePath = "E:\\Google_Jam\\Dancing\\B-large.in";
Scanner scanner = FileUtil.openFile(orgFilePath);
StringBuilder sb = new StringBuilde... |
A12460 | A11646 | 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 qualify;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.Scanner;
public class B {
public static void main(String[] args) throws Exception {
Scanner input = new Scanner(new FileInputStream("B-small-attempt0.in"));
PrintWriter output = new Pr... |
A12544 | A12178 | 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... | package hk.polyu.cslhu.codejam.thread;
import hk.polyu.cslhu.codejam.lib.ResultCollector;
import hk.polyu.cslhu.codejam.solution.Solution;
import java.util.List;
import org.apache.log4j.Logger;
public abstract class JamThread implements Runnable {
public static Logger logger = Logger.getLogger(JamThread.class);
... |
B11421 | B11903 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Recycled {
public static void main(String[] args) throws Exception{
String inputFile = "C-small-attempt0.in... | import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
public class Run3
{
private static class Pair
{
private String n;
private String m;
public Pair(String n, String m)
{
this.n = n;
this.m = m;
}
public String getStringN()
{
return n;
}
public Str... |
B21790 | B22015 | 0 | import java.io.*;
import java.util.*;
public class C {
void solve() throws IOException {
in("C-large.in"); out("C-large.out");
long tm = System.currentTimeMillis();
boolean[] mask = new boolean[2000000];
int[] r = new int[10];
int t = readInt();
for (int cs = 1; cs... | package er.dream.codejam.qual;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import er.dream.codejam.helpers.ProblemSolver;
public class RecycledNumbers extends ProblemSolver{
public static void main(String[] args) {
new RecycledNumbers().execute();
}
@Ove... |
A10793 | A10238 | 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) {
... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class dancing {
public static void main(String[] args)
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int T;
String input;
try... |
A12544 | A11349 | 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.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class DancingWithGooglers {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
Scanner in;
in = ... |
A11502 | A10076 | 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 qualification;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.Comparator;
public class B {
private static final char[] CASE = "Case #".toCharArray();
public static void main(String[] args) t... |
A12544 | A10682 | 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... | /**
*
*/
package google.exercise.b;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
/**
* @author tomtom
*
*/
public class B {
... |
A12570 | A11940 | 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 dancingWithGooglers;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;
public class InputFile
{
public ArrayList<String> readFile() throws Exception
{
File file = new File("C:\\Users\\Nikhil\\Desktop\\googleCodeJam\\B-small-attempt1.in");
Buff... |
A22191 | A22489 | 0 | package com.example;
import java.io.IOException;
import java.util.List;
public class ProblemB {
enum Result {
INSUFFICIENT,
SUFFICIENT,
SUFFICIENT_WHEN_SURPRISING
}
public static void main(String[] a) throws IOException {
List<String> lines = FileUtil.getLines("/B-large.in");
int cases = Int... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.... |
B12669 | B12188 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package year_2012.qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.... | 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.HashSet;
public class RecycledNumbers {
ArrayList<String> result = new ArrayList<>();
public void solve(int A, int B){
HashSet<Str... |
B11327 | B11049 | 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 com.clausewitz.codejam.qr2012;
import java.io.IOException;
import java.util.StringTokenizer;
import com.clausewitz.codejam.Solver;
public class Recycled extends Solver {
private int A = 0;
private int B = 0;
@Override
public void readProblem() throws IOException {
String line = fileIn.readLine();
Str... |
B20424 | B21090 | 0 | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
// static int MAX = 10000;
static int MAX = 2000000;
static Object[] All = new Object[MAX+1];
static int size( int x ) {
if(x>999999) return 7;
if(x>99999) return 6;
if(x>9999) return 5;
if(x>999) retu... | package codejam.recycled;
import codejam.is.TestAbstract;
import java.util.*;
/**
* Created with IntelliJ IDEA.
* User: ofer
* Date: 4/14/12
* Time: 2:41 AM
* To change this template use File | Settings | File Templates.
*/
public class RecycledTest extends TestAbstract {
@Override
public void run(Stri... |
B22190 | B21046 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
public class Recycled {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.par... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
public class problem {
public static void main(String[] args) throws IOException{
final String filein = "C:\\Users\\BYTE\\Downloads\\C-small-attempt0.in";
//final String filein = "C:\\Users\\byte\\Downloads\\NewFolder\\C-smal... |
A22378 | A20297 | 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... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Arrays;
import java.util.StringTokenizer;
/**
*
*/
/**
* @author Bageshwar
*
*/
public class Dance {
/**
* @param args
* @throws IOException
*/
public ... |
A10699 | A12032 | 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) ... | 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 >... |
A11917 | A12829 | 0 | package com.silverduner.codejam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
public class Dancing {
public static void main(String[] args) throws Exception {
File input = new File("B-small-attempt... | package google.codejam;
public class DanceGoogler implements GoogleSolver {
@Override
public String solve(String str) {
String[] input = str.split(" ");
int dancerNumber = Integer.parseInt(input[0]);
int surprisingCount = Integer.parseInt(input[1]);
int bestResult = Integer.parseInt(input[2]);
... |
A12273 | A10482 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Dancing
* Jason Bradley Nel
* 16287398
*/
import java.io.*;
public class Dancing {
public static void main(String[] args) {
In input = new In("input.txt");
int T = Integer.parseInt(input.... |
public class Pair {
public int max;
public boolean surprise;
public Pair(int max, boolean surprise) {
this.max = max;
this.surprise = surprise;
}
@Override
public boolean equals(Object other) {
if (!(other instanceof Pair)) {
return false;
}... |
A22992 | A21848 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author dannocz
*/
public class InputReader {
public static Input r... | package dancingWithGooglers;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
public class OutputFile
{
public void writeFile(ArrayList<String> data) throws Exception
{
File file = new File("C:\\Users\\Nikhil\\Desktop\\googleCodeJam\\output.txt");
Bu... |
B12570 | B12478 | 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... | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class C {
static final int MAX_N = 2000000;
static int[][] precalc;
static {
precalc = new int[MAX_N + 1][];
List<Intege... |
B20566 | B20389 | 0 | import java.util.Scanner;
import java.io.*;
import java.lang.Math;
public class C{
public static int recycle(String str){
String[] numbers = str.split(" ");
int min = Integer.parseInt(numbers[0]);
int max = Integer.parseInt(numbers[1]);
int ret = 0;
for(int i = min; i < max; i++){
String num = i + "";
... | import java.io.*;
import java.util.HashMap;
class probC{
public static void main(String[] args){
Code b=new Code();
}
}
class Code{
public Code(){
try {
FileWriter fstream = new FileWriter("output.txt");
BufferedWriter out = new BufferedWriter(fstream);
File fin = new File("C-large.in");
FileReader ... |
A10568 | A12257 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader (new... | import java.io.BufferedWriter;
import java.util.ArrayList;
public class Helper {
public Helper() {
super();
}
public String operate(String op) {
System.out.println(op);
String result ="";
int total = 0;
String[] split = op.split(" ");
int inter = Integer.valueOf(split[1]);
int goal = Integer.valueO... |
B10155 | B12223 | 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.*;
public class QC {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int[][] ROT = new int[2000001][7];
for(int i=1; i<=2000000; i++) {
int A = i;
int pow10 = 1;
while(A > 0) { pow10*=10; A/=10; }
pow10 /= 10;
A = i;
int ix = 0;
do {
if(A <... |
A12570 | A12560 | 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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author UDDAMA
*/
public class Dance {
private int danceManager(String inputLine) {
int count = 0;
... |
A20119 | A20722 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.HashMap;
public class ... |
B10245 | B12153 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.Writer;
import java.util.ArrayList;
import java.util.HashSet;
public class q3 {
public static void main(String args[]) throws Exception {
String path = "./src/";
String ifile =... |
A12460 | A12104 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class DancingWithTheGooglers {
public static void main(String[] args) {
try {
... |
A20490 | A22919 | 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.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class DancingWithTheGooglers {
/**
* @param args
*/
public static void main(String[] args) {
int T = -1;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)... |
A12544 | A11667 | 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... |
public class kickClass {
public static void main(String[] args){
//testGraph.run();
//testCollection.run();
solutionRunner t1 = new solutionRunner();
}
}
|
A22191 | A20666 | 0 | package com.example;
import java.io.IOException;
import java.util.List;
public class ProblemB {
enum Result {
INSUFFICIENT,
SUFFICIENT,
SUFFICIENT_WHEN_SURPRISING
}
public static void main(String[] a) throws IOException {
List<String> lines = FileUtil.getLines("/B-large.in");
int cases = Int... | 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.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
public class googler
{
int c... |
A12273 | A10870 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Dancing
* Jason Bradley Nel
* 16287398
*/
import java.io.*;
public class Dancing {
public static void main(String[] args) {
In input = new In("input.txt");
int T = Integer.parseInt(input.... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
public class SurprisingTripletScorer {
private int numGooglers;
private int numSurprisingScores;
private final ... |
B21049 | B20233 | 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... | import java.io.*;
import java.util.*;
import java.math.*;
public class Main implements Runnable
{
static Scanner scanner;
static BufferedReader input;
static PrintWriter pw;
public static void main(String[] args) throws Exception
{
new Thread(new Main()).start();
}
public void run()
{
try
{
input = ... |
A12544 | A12095 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package cjam;
import java.io.*;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Administrator
*/
public class Cjam {
/**
* @param args the command l... |
B21049 | B20451 | 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.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class Problem3 {
private static final int POWERS_OF_TEN[] = new int[] {
1,
10,
100,
1000,
10000,
100000,
1000000
};
p... |
A12544 | A13180 | 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.util.*;
public class reverse {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
int m=sc.nextInt();
int i;
int j;
for(i=1;i<=m;i++) {
int n=sc.nextInt();
int s=sc.nextInt();
int p=sc.nextInt();
... |
A10568 | A10181 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader (new... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.*;
/**
*
* @author GERALD
* JDK 7.0
*/
public class GoogleDancing {... |
B10858 | B13255 | 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.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class NumberRecycling {
/**
* @... |
B10155 | B11873 | 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.io.*;
import java.util.*;
public class RecycledNumbers
{
public static void main(String[] args) throws Exception
{
BufferedReader in = new BufferedReader(new FileReader("RecycledNumbers-small-attempt0.in"));
BufferedWriter out = new BufferedWriter(new FileWriter("RecycledNumbers-small-attempt0.out",... |
A21010 | A22606 | 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... | public class ProblemB extends FileWrapper {
private int N[] = null;
private int S[] = null;
private int P[] = null;
private int t[][] = null;
public ProblemB(String fileName) {
this.processInput(fileName);
this.calculate();
this.processOutput(OUTPUT);
}
private int getResult(int caseNum) {
int total ... |
A20261 | A20435 | 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... |
public class DancingGooglers {
private static int sc;
private static int result = 0;
private static int p;
private static void check(int val) {
int x = val % 3;
int n = val / 3;
if (x == 0) {
if (n >= p) {
result++;
} else if (n > 0 && sc > 0 && n + 1 >= p) {
result++;
sc--;
}
} ... |
B10149 | B12636 | 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 com.google.codejam.C;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
public class Recycled {
public stati... |
A11135 | A12413 | 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.File;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Scanner;
//Using the Google Collections library.
public class B {
public static void main(String [] args) throws IOException {
String inputFile = "src/B-small-attempt0.in";
Scanner in = new Scanner(new File(inputFile)... |
B20424 | B21990 | 0 | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
// static int MAX = 10000;
static int MAX = 2000000;
static Object[] All = new Object[MAX+1];
static int size( int x ) {
if(x>999999) return 7;
if(x>99999) return 6;
if(x>9999) return 5;
if(x>999) retu... | import java.io.*;
import java.util.*;
public class C {
public static void main(String[] args) {
new C().run();
}
BufferedReader br;
StringTokenizer st;
PrintWriter out;
boolean eof;
public void run() {
try {
// br = new BufferedReader(new InputStreamReader(System.in));
// out = new PrintWriter(System.... |
A22378 | A22331 | 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... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Dancing_With_the_Googlers {
public static void main(String[] args) {
try {
BufferedReader in = new BufferedReader(new FileReader("B-large.in"));
Buffered... |
B12082 | B11365 | 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.text.*;
public class ProblemC {
public static void main(String[] args) {
try {
new ProblemC().solve();
} catch (Exception e) {
e.printStackTrace();
}
}
public void solve() throws Exception {
System.setIn(new FileInputStream("D:\\input.in"));
S... |
B12570 | B11593 | 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... | 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.StringTokenizer;
public class Main {
public static void main(String[] args){
StringBuffer fileData = new StringBuffe... |
B12115 | B10264 | 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.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.Reader;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.nio.CharBuffer;
import java.util.ArrayList;
import java.u... |
B11696 | B10416 | 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... | package com.google.codjam.problems;
public class sample {
public static void main(String[] args) {
int n = 20;
String nS=n+"";
int currentM=1;
int maxMov=nS.length();
String tempS = nS.substring(0,currentM);
String finalS= nS.substring(currentM,maxMo... |
B10231 | B10938 | 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... | package GoogleCodeJam2012;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;... |
B10231 | B12151 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejamqualfication;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.H... |
B11318 | B11387 | 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.*;
import java.util.*;
public class RecycledNumbers
{
static int start, end;
public static void main(String[] args) throws IOException
{
Scanner scan = new Scanner(new File("c_small.in"));
int numCases = scan.nextInt();
for (int z = 1; z <= numCases; z++)
{
... |
B21790 | B20316 | 0 | import java.io.*;
import java.util.*;
public class C {
void solve() throws IOException {
in("C-large.in"); out("C-large.out");
long tm = System.currentTimeMillis();
boolean[] mask = new boolean[2000000];
int[] r = new int[10];
int t = readInt();
for (int cs = 1; cs... | package codejam;
import java.util.*;
public class RecycledNumbers {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for (int k = 1; k <= T; k++) {
int c = 0;
int A = in.nextInt();
int B = in.nextInt();
for (int cand = A; cand <... |
A11277 | A10664 | 0 | package googlers;
import java.util.Scanner;
import java.util.PriorityQueue;
import java.util.Comparator;
public class Googlers {
public static void main(String[] args) {
int n,s,p,count=0,t;
Scanner sin=new Scanner(System.in);
t=Integer.parseInt(sin.nextLine());
int result[]=new int[t];
int ... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class B {
public static void main(String[] args) {
String line;
String filename1 = "B-small-attempt0.in";
String filename2 = "outB.out";
BufferedReader input;... |
A21396 | A22039 | 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++){
... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam2012pa;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
/**
*
* @author Fred
*/
public class CodeJam2012PA
{
/**
* type entrada.txt | j... |
B13196 | B12943 | 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 ... | package com.menzus.gcj._2012.qualification.c;
import com.menzus.gcj.common.OutputEntry;
public class COutputEntry implements OutputEntry {
private long recycledPairNumber;
public void setRecycledPairNumber(long recycledPairNumber) {
this.recycledPairNumber = recycledPairNumber;
}
@Override
publ... |
B21227 | B20446 | 0 | import java.util.HashSet;
import java.util.Scanner;
public class C {
static HashSet p = new HashSet();
static int low;
static int high;
int count = 0;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int no = sc.nextInt();
for (int i = 1; i <= no; i++) {
p.clear();
lo... | import java.util.*;
import java.io.*;
class C1Large
{
public static void main(String[] args) throws Exception
{
FileInputStream fis = new FileInputStream("C-large.in");
Scanner scan = new Scanner(fis);
FileWriter fw = new FileWriter("output.txt");
int T = scan.nextInt();
for(int c = 1; c<=T;c++)
{
lo... |
A12846 | A11022 | 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 fixjava;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
import java.util.Map.Entry;
public class CountedSet<T> implements Set<T> {
HashMap<T, Integer> map = new HashMap<T, Integer>();
private static final Integer ONE = new... |
B12085 | B10540 | 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... | package _2012_qual;
import static java.lang.Math.*;
import java.util.*;
import java.io.*;
public class C {
boolean showDebug = true;
static boolean fromFile = false;
static String filePath = "E:/AAA/_gcj/";
static boolean intoFile = !false;
public void solve() throws Exception {
int testCasesCnt = nextInt(... |
A20261 | A22625 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package googlecodejam;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
/**
*
*... |
B12570 | B11723 | 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... | import java.lang.*;
import java.io.*;
import java.util.*;
public class Solution {
public static BufferedReader br;
public static PrintWriter out;
public static StringTokenizer stk;
// ///////////////// TO CHANGE ///////////////////////////
public static boolean isServer = false;
// ///////////////// TO CHANGE ... |
B10245 | B12729 | 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.util.HashSet;
import java.util.Scanner;
public class C_Recycled {
static boolean recycled (String n, String B, String i) {
return (n.compareTo(i) < 0) && (i.compareTo(B) <= 0);
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for (int cas ... |
A12460 | A10887 | 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 codejam.qualification;
import java.io.File;
import java.io.IOException;
import java.util.Scanner;
public class Dancing {
/**
* @param args
*/
public static void main(String[] args) throws IOException {
String file = "input2small";
Scanner in = new Scanner(new File(file));
int tot = Integer.parseI... |
A20382 | A22039 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam2012pa;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
/**
*
* @author Fred
*/
public class CodeJam2012PA
{
/**
* type entrada.txt | j... |
B20566 | B22084 | 0 | import java.util.Scanner;
import java.io.*;
import java.lang.Math;
public class C{
public static int recycle(String str){
String[] numbers = str.split(" ");
int min = Integer.parseInt(numbers[0]);
int max = Integer.parseInt(numbers[1]);
int ret = 0;
for(int i = min; i < max; i++){
String num = i + "";
... | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) throws IOException{
Scanner scanner = new Scanner(new File("input.txt"));
int numCases = scanner.nextInt();
P... |
A12460 | A12709 | 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 codejam02;
import java.io.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.StringTokenizer;
public class CodeJam02
{
public static void main(String[] args)
{
try
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
... |
A21010 | A21430 | 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.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Scanner;
// Qualification Round 2012
// Problem A
public class DancingWithTheGooglers {
public static void main(String[] args) {
Scanner sc = null;
try {
sc = new Scanner(new Fi... |
B12669 | B13013 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package year_2012.qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.... | package gcj.gcj2012.qualif;
import gcj.SolverBase;
import java.io.BufferedReader;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Set;
public class ProblemC extends SolverBase {
public ProblemC() {
super("Recycled Numbers");
}
public static void main(String[] args) throws... |
B12082 | B11467 | 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... | package qualification;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import common.FileTranslatorBasis;
public class C {
final static int[] digitNum = { 9, 99, 999, 9999, 99999, 999999, 9999999 };
int low;
int high;
int pow = 1;
public C(String low, String high) {
... |
A11917 | A13082 | 0 | package com.silverduner.codejam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
public class Dancing {
public static void main(String[] args) throws Exception {
File input = new File("B-small-attempt... | import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Dance {
public static void main(String[] args) throws FileNotFoundException{
Scanner scan = new Scanner (new File("C:\\Users\\kffong\\Desktop\\JAVA_workspace\\DanceGoogler\\input.txt"));
// Scanner scan = new Scan... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.