F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
B12085 | B11237 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.Console;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Main {
/**
* @param args
*/
pub... |
B21207 | B20492 | 0 | /*
* Problem C. Recycled Numbers
*
* Do you ever become frustrated with television because you keep seeing the
* same things, recycled over and over again? Well I personally don't care about
* television, but I do sometimes feel that way about numbers.
*
* Let's say a pair of distinct positive integers (n, m) ... | import java.util.Scanner;
import java.io.*;
public class Pair {
public static int a, b, l;
public static boolean inr(String x) {
int t = Integer.parseInt(x);
if ((t + "").length() != l) return false;
if (t <= b && t >= a) {
return true;
}
else return false;
}
public static String t... |
B13196 | B12422 | 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 blacky.codejam.qualifications;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumbers {
private static class Pair {
final public int m;
final public int n;
public Pair... |
B10245 | B11744 | 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.*;
import java.util.Scanner;
/**
* Created by IntelliJ IDEA.
* User: tanin
* Date: 4/14/12
* Time: 9:54 AM
* To change this template use File | Settings | File Templates.
*/
public class Recycled {
public static void main(String[] args) throws Exception {
String filename = "Recycled... |
B10485 | B10672 | 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 net.anzix.learn.codejam.qr12;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
public class RecycledNumbers {
private Input... |
B20006 | B20708 | 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.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
Scanner a = new Scanner(new File("/Users/anurag/Dev/Java/workspace/CodeJam/src/input"));
FileWriter w = new FileWriter(new File("/Users/a... |
B11361 | B10738 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package googlecodejamproblemc;
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.i... |
A12846 | A11032 | 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;
/**
* Convenience class for declaring a method inside a method, so as to avoid code duplication without having to declare a new method
* in the class. This also keeps functions closer to where they are applied. It's butt-ugly but it's about the best you can do in
* Java.
*/
public interface Lambd... |
A20934 | A22932 | 0 | import java.util.*;
public class B {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
B th = new B();
for (int i = 0; i < T; i++) {
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt()... |
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class Dance {
Scanner in;
BufferedWriter out;
Dance(String input, String output) throws Exception {
in = new Scanner(new File(input));
FileWriter fs... |
B11361 | B11137 | 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 recyclednumbers.util;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
public class IOUtil {
public static List<String> readLines(String filename) {
List<String> lines = new ArrayList<String>();
try {
InputStream is = IOUtil.class.getResourceAsStream("/M... |
A10996 | A12746 | 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);
... | import java.io.FileNotFoundException;
public class main {
/**
* @param args
* @throws FileNotFoundException
*/
public static void main(String[] args) throws FileNotFoundException {
// TODO Auto-generated method stub
Parser parser = new Parser(args[0]);
Dwtg dwtg = new Dwtg(parser.parse(1));
dwtg.sol... |
A11917 | A12601 | 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.util.*;
import java.io.*;
import javax.xml.ws.handler.MessageContext.Scope;
public class Googlers{
public static List<Integer> processed=new ArrayList<Integer>();
public static List<Integer> scores;
public static void main(String[] args){
String fn = "C:\\Users\\Ashu\\Desktop\\B-small-attempt... |
B10245 | B10595 | 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.Scanner;
public class Recycled {
private static Scanner stdIn = new Scanner(System.in);
public static String removeLeadingZeroes(String number)
{
// index of first non-zero digit
int index = 0;
// locate first non-zero digit
while (number.charAt(index) == 0)
{
index++;
}
// retur... |
B21790 | B22045 | 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 google.problems;
import google.loader.Challenge;
import google.loader.ChallengeReader;
import java.util.ArrayList;
import java.util.List;
public abstract class AbstractReader implements ChallengeReader {
private String[] lines;
private List<Challenge> challenges;
private int actualLine;
public Abstrac... |
A20119 | A22475 | 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.util.Scanner;
/**
*
* @author Yasura
*/
public class B {
public static void main(String[] args) {
Scanner scanInt= new Scanner(System.in);
int noOfCases = scanInt.nextInt();
int N,S,p,t,max;
for(int i=0;i<noOfCases;i++){
N=scanInt.nextInt();
S... |
B12115 | B12016 | 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.Scanner;
public class Recycle {
/**
* @param args
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int numLines = sc.nextInt();
int lineCounts = 1;
while (numLines > 0) {
String A = sc.next();
String B = sc.next();
// System.out.println(A + " ... |
B21049 | B21093 | 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.is;
/**
* Created with IntelliJ IDEA.
* User: ofer
* Date: 4/13/12
* Time: 8:49 PM
* To change this template use File | Settings | File Templates.
*/
public abstract class TestAbstract implements Test {
private final static String newline = System.getProperty("line.separator");
@Overrid... |
B13196 | B10160 | 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 ... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package cj2012;
/**
*
* @author aaron
*/
public class ACj2012 {
public static void main(String[] args) {
//System.out.println(recyclePairs("1111 2222"));
dataOut(processData(getData("C-small-attempt0.in... |
A22642 | A20579 | 0 | import java.util.*;
import java.io.*;
public class DancingWithTheGooglers
{
public DancingWithTheGooglers()
{
Scanner inFile = null;
try
{
inFile = new Scanner(new File("inputB.txt"));
}
catch(Exception e)
{
System.out.println("Problem ope... | import java.io.*;
import java.util.StringTokenizer;
public class Dancing
{
public static void main(String[] args)
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int tc,data[],result[],nog,sc,exno;
int av,rem,count;
String s,s1;
StringTokenizer st;
try
{
tc=Intege... |
A12544 | A11064 | 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.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Dancer {
public static void main (String [] args) throws Exception {
FileInputSt... |
A12846 | A12184 | 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.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... |
B10231 | B10136 | 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.awt.Point;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
public class Prob2 {
private static String doAlgorithm(String[] lines) {
StringBui... |
B21270 | B22131 | 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... | package c;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class C {
Set<Integer>[] c = new HashSet[2000001];
public C()
{
Scanner s = new Scanner(System.in);
int t = s.nextInt();
for(int i =0; i < t;i ++)
{
int a = s.nextInt();
int b = s.nextInt();
for(int j ... |
B11318 | B12278 | 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.util.*;
public class C {
public static void main (String [] arg) {
int [][] store = new int [2000010][7];
for (int i = 1; i<store.length; ++i) {
int ptr = 0;
int j = rotate(i);
while (j != i) {
if (j > i) store[i][ptr++] = j;
j = rotate(j);
}
}
Scanner sc = new Scanner(System... |
A11917 | A12677 | 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 com.theblind.problem;
import java.util.ArrayList;
import java.util.Scanner;
import com.theblind.utility.FileUtility;
public class DancingWiththeGooglers {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
String ... |
B11696 | B11892 | 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.util.*;
public class RecycledNumbers{
static HashSet<String> hs;
public static int single(int n, int[] digits){
int i = 0;
while(n>0){
digits[i] = n%10;
n = n/10;
i++;
}
return i;
}
public static int toNumber(int[] d){
int n = 0;
for(int i = d.length-1; i>=0; i--){
n = (n*... |
B22190 | B21364 | 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.sam.googlecodejam.dance;
import com.sam.googlecodejam.helper.InputReader;
public class DanceScore {
int iBestScore;
int iSuprize;
int iMean;
int iSetCount = 0;
class TripletScore {
public int judge1;
public int judge2;
public int judge3;
public void setValue(int j1, int j2, int j3) {
... |
A11917 | A11266 | 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.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
public class Scores {
private String fileName;
private FileReader file;
private FileWriter fileOutput;
private PrintWriter pw;
private BufferedReader br;
private int NbGog... |
B10361 | B11119 | 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());... | package gcj2012;
import java.io.FileInputStream;
import java.io.PrintStream;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
public class C {
public static void main(String[] args) throws Exception {
new C().run();
}
void run() throws Exception {
Scanner in = new Scanner(System.in);... |
A22360 | A21946 | 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 ... | /*
* 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;
import java.util.Set;
/**
*
* @author daniele
*/
public class GCJ_B {
public static vo... |
B21227 | B21352 | 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.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.InputMismatchException;
import java.math.BigInteger;
public class Recycled {
static... |
A20934 | A21969 | 0 | import java.util.*;
public class B {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
B th = new B();
for (int i = 0; i < T; i++) {
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt()... | package com.renoux.gael.codejam.utils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.net.URISyntaxException;
import java.net.URL;
/**
* Pour tests unitaires
*
* @author renouxg
*/
public fin... |
A21396 | A20472 | 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.File;
import java.io.IOException;
import java.util.Scanner;
public class QuestionB {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
File fileread = new File("B-large.in.txt");
File filewrite = new File(QuestionB.class.getName() + "ou... |
B12941 | B11196 | 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.*;
import java.util.*;
public class C implements Runnable
{
//private String IFILE = "input.txt";
private String IFILE = "C-small-attempt0.in";
private Scanner in;
private PrintWriter out;
public void Run() throws IOException
{
in = new Scanner(new File(IFILE));
out = new PrintWriter("ou... |
A22360 | A21664 | 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.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Arrays;
/**
* Input
* @author jiptan
*
*/
public class SolveB {
public static void main(String[] args) throws IOException {
BufferedReader br = new Buffered... |
A10568 | A12829 | 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... | 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]);
... |
B10858 | B12826 | 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.*;
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())... |
B12085 | B12502 | 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.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
public class C {
public void solve() throws FileNotFoundException {
Scanner in = new Scanner(new File("C-small-attempt0.in"));
PrintWriter out = new PrintWriter("C-small-attempt0.out");
int testN =... |
A10699 | A10479 | 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.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
try {
Scanner in = new Scanner(new FileReader("in.txt"));
PrintWriter out = new PrintWriter(new FileWriter("out.tx... |
B22190 | B20468 | 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.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Arrays;
/**
* Created by IntelliJ IDEA.
* User: Abhishek
* Date: 4/14/12
* Time: 1:09 PM
* To change this template use File | Settings | File Templates.
... |
A21557 | A21836 | 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.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... |
B11421 | B10353 | 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.*;
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... |
B10702 | B10633 | 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.*;
import java.util.*;
public class GoogleQual2012C
{ public static void main(String[] args) throws Throwable
{ new GoogleQual2012C();
}
public GoogleQual2012C() throws Throwable
{ Scanner in = new Scanner(new File("C-small-attempt0.in"));
PrintWriter out = new PrintWr... |
B11421 | B12492 | 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... | 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 ... |
A20382 | A20472 | 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.File;
import java.io.IOException;
import java.util.Scanner;
public class QuestionB {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
File fileread = new File("B-large.in.txt");
File filewrite = new File(QuestionB.class.getName() + "ou... |
A12460 | A10805 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package qualification.Dancing;
import java.util.*;
/**
*
* @author farshid
*/
public class Dancing {
public Dancing() {
}
public int solve(String problem) {
String[] arr = problem.split(" ");
... |
B20566 | B20245 | 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.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Scanner;
import java.util.Set;
... |
B20424 | B22058 | 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 qualification.recycled.numbers;
public class RecycledPair {
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + m;
result = prime * result + n;
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (o... |
B12074 | B11990 | 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 codejam2012qual;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.PrintStream;
import java.io.PrintWriter;
import util.InputReader;
public class RecycledNumbers implements Runnable {
private InputReader in;
priv... |
B12074 | B11839 | 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 info.m3o.gcj2012.recyclednumber;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class InputFileLoader {
protected File infile;
protected List<String>... |
B20856 | B21311 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Happy;
import java.io.*;
import java.math.*;
import java.lang.*;
import java.util.*;
import java.util.Arrays.*;
import java.io.BufferedReader;
//import java.io.IOException;
//import java.io.InputStreamReader;
//... | package ch7.rec;
import java.util.HashSet;
import java.util.Scanner;
public class Recycled {
static HashSet p = new HashSet();
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();
... |
A11135 | A12317 | 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... | package br.com.atama.google.jam;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import br.com.atama.google.jam.dancing.ScoreCalculator;
public class Solver {
public static void main(String[] args) throws IOException {
FileReader reader = new FileReader("src/input-small.txt"... |
A20934 | A20702 | 0 | import java.util.*;
public class B {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
B th = new B();
for (int i = 0; i < T; i++) {
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt()... | import java.io.*;
import java.util.StringTokenizer;
/**
* @author Ivan Romanov
*/
public class B {
private String solve(int n) throws IOException {
int s = nextInt();
int p = nextInt();
int[] t = new int[n];
for (int i = 0; i < n; i++) {
t[i] = nextInt();
}
... |
A12211 | A11687 | 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 abstract class Question extends Thread{
protected Result result;
protected Counter counter;
public Question(Result result, Counter counter)
{
super();
this.result = result;
this.counter = counter;
}
public abstract void readInput(Scanner scanner);
public void solve... |
A12846 | A10587 | 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 b;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.... |
B12082 | B11088 | 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 fixjava;
import java.util.ArrayList;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import fixjava.ParallelWorkQueue.CallableFactory;
public class ParallelWorkQueueTest {
/**
* @param args
*/
public static void main(String[] ... |
B21790 | B21856 | 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... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
public class RecycledNumbers {
public static void main(String[] args) throws IOException
{
//BufferedR... |
A22992 | A22132 | 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... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Scanner;
public class DancingWithGooglers {
public static void main(String[] args) throws Exception{
char problem = 'B';
boolean smallCase = false;
boolean practice = false;
Buffe... |
B12941 | B11807 | 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.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class RecycledNumbers
{
private static final String INPUT_FILE = "input.txt";
private static final String OUTPUT_FILE = "output.txt";
public int countSiblings(Str... |
A10793 | A12758 | 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.*;
import java.util.*;
public class B {
final static boolean DEBUG = true;
public Object solve () throws IOException {
int N = sc.nextInt();
int S = sc.nextInt();
int P = sc.nextInt();
int [] T = new int [N];
for (int i = 0; i < N; ++i)
T[i] = sc.nextInt();
if (P == 0)
retur... |
A12846 | A10818 | 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 quals;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Dancing {
public static void main(String args[]) {
try {
System.setIn(new FileInputStream("B-small-attempt0.in"));
Scanner scanner = new Scanner(System.in);
int testCases = scanner... |
A22642 | A20766 | 0 | import java.util.*;
import java.io.*;
public class DancingWithTheGooglers
{
public DancingWithTheGooglers()
{
Scanner inFile = null;
try
{
inFile = new Scanner(new File("inputB.txt"));
}
catch(Exception e)
{
System.out.println("Problem ope... | package dancing_with_googlers;
import java.io.*;
import java.util.*;
public class Start {
/** Requires two arguments - the file name, and the encoding to use. */
public static void main(String [] args) throws IOException {
ArrayList<String> input = ReadWriteTextFile.doReadTextFile("B-large.in");
... |
B10858 | B13074 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| import sun.rmi.runtime.NewThreadAction;
import java.io.*;
import java.util.*;
/**
* Created by IntelliJ IDEA.
* User: Veniversum
* Date: 4/15/12
* Time: 2:26 AM
*/
public class Q3 {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader... |
A12544 | A11799 | 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 codejam;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
public class Googler
{
public static void main(String[] args) throws Exception
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int i =1;
int n = I... |
B11696 | B10867 | 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.util.*;
import static java.lang.System.*;
class C{
static public void main(String[] args){
Scanner sc = new Scanner(System.in);
int cases = Integer.parseInt(sc.nextLine());
for(int c = 1; c<=cases; c++){
String[] s = sc.nextLine().split(" ");
int a = Integer.parseInt(s[0]);
int b = I... |
B10361 | B11039 | 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());... | package qual2012;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class C {
public static void main(String[] args) throws Exception {
Scanner in = new Scanner(System.in);
//PrintWriter out = new PrintWriter(System.out);
Pr... |
A11201 | A11835 | 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.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... |
B12669 | B12050 | 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.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(... |
B12762 | B13255 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.File;
import java.io.FileInputStream;
import java.util.Scanner;
/**
*
* @author imgps
*/
public class C {
public static void main(String args[]) throws Exception{
int A,B;
int ctr ... | 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 {
/**
* @... |
B11361 | B11122 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;
public class Recycled {
private String strLine;
pri... |
B21207 | B21599 | 0 | /*
* Problem C. Recycled Numbers
*
* Do you ever become frustrated with television because you keep seeing the
* same things, recycled over and over again? Well I personally don't care about
* television, but I do sometimes feel that way about numbers.
*
* Let's say a pair of distinct positive integers (n, m) ... | package google.gcj.recyclednumbers;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;
public class RecycledNumbers4 {
public static void main(String[]... |
A12273 | A11408 | 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.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;
public class Solver {
Scanner inFile=null;
PrintWriter outFile=null;
int N=0;//number of googlers
int S=0;//surprising triplet
int p=0;
int t[];
int caseNo;
int candidatecount=0;
public Solver(int caseNo){
this.ca... |
A22078 | A21563 | 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 com.qual2;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;
public class qual2 {
public static void main(String[] args) {
cNums h = new ... |
B10245 | B12748 | 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.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.io.PrintWriter;
public class C {
Inpu... |
B12115 | B13225 | 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.*;
import java.text.*;
import java.math.*;
import java.util.*;
public class J12QC implements Runnable {
Scanner in;
PrintWriter out;
static String taskname = ".\\src\\C-small-attempt0";
int test, testn, i, j, k;
public static void main(String[] args) {
new Thread(new J12QC()).start();
}
publ... |
A22642 | A22995 | 0 | import java.util.*;
import java.io.*;
public class DancingWithTheGooglers
{
public DancingWithTheGooglers()
{
Scanner inFile = null;
try
{
inFile = new Scanner(new File("inputB.txt"));
}
catch(Exception e)
{
System.out.println("Problem ope... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.util.ArrayList;
/**
*
* @author dannocz
*/
public class Input {
private int noTestCases;
private ArrayList<TestCase> testCases;
//private ArrayList<String> resultCases;
p... |
B10485 | B13103 | 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 QR2012;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Set;
public class C
{
private static class Pair
{
final int n;
final int m;
public Pair(int n, int m)
{
this.n = n;
this.m = m;
}
@Override
public in... |
B21049 | B20487 | 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.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;
public class Main {
public static void main(String[] args) {
File inputFile = new File("... |
B10858 | B10152 | 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.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Scanner;
public class RecycledNumbers {
/**
* @param args
* @throws FileNotFoundException
*/
... |
A12211 | A10047 | 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... | package b;
import java.util.Scanner;
public class B {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
sc.nextLine();
int nbr = 1;
while (t-- > 0) {
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt();
int[] total = new int[n];... |
B12669 | B10567 | 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 qualification;
import java.util.ArrayList;
import utils.IOHelper;
import utils.Pair;
public class RecycledNumbers
{
public static void main(String[] args)
{
try
{
String[] input = IOHelper.readFile(args[0]);
int[] results = new int[input.length];
for (int line = 0; line < input.length; line++... |
A22078 | A22787 | 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 google.contest.B;
import google.loader.Challenge;
import google.problems.AbstractReader;
public class BReader extends AbstractReader {
@Override
protected Challenge createChallenge(int number) {
int theLine = getActualLine();
String[] lines = getLines();
BChallenge chal = new BChallenge(number, lines... |
A10996 | A11613 | 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);
... | package com.jp.common;
public interface Puzzle {
public String[] solve(String[] dataSet );
}
|
A21396 | A20327 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class dancing {
public static void main(String args[]) throws Exception{
FileInputStream fs = new FileInputStream("in2.tx... |
B20856 | B22159 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Happy;
import java.io.*;
import java.math.*;
import java.lang.*;
import java.util.*;
import java.util.Arrays.*;
import java.io.BufferedReader;
//import java.io.IOException;
//import java.io.InputStreamReader;
//... | 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... |
B12669 | B11135 | 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 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... |
B21207 | B20904 | 0 | /*
* Problem C. Recycled Numbers
*
* Do you ever become frustrated with television because you keep seeing the
* same things, recycled over and over again? Well I personally don't care about
* television, but I do sometimes feel that way about numbers.
*
* Let's say a pair of distinct positive integers (n, m) ... | /**
* Copyright 2012 Christopher Schmitz. All Rights Reserved.
*/
package com.isotopeent.codejam.lib.converters;
import com.isotopeent.codejam.lib.InputConverter;
public class IntLine implements InputConverter<Integer> {
private int input;
@Override
public boolean readLine(String data) {
input = Integer.pa... |
A11201 | A11865 | 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.util.ArrayList;
import java.util.Arrays;
public class ProbB {
/**
* @param args
*/
public static void main(String[] args) {
ArrayList<String> in=Utils.readFile("B-small-attempt0.in.in");
ArrayList<String> out =new ArrayList<String>();
for (int i = 1; i < in.size(); i++) {
String[] str=in.g... |
B10155 | B12696 | 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.awt.print.Printable;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class C {
public static void main(String[] args) throws IOException {
Scanner scanner = null;
scanner = new Scanner(ne... |
A22771 | A22402 | 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.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Scanner;
public class DancingWiththeGooglers {
public static void main(String[] args) throws Exception {
... |
B12115 | B11603 | 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();
... | package recyclednumbers;
import java.util.Queue;
import java.util.concurrent.ArrayBlockingQueue;
public class Helper {
public static void main(String[] str) {
System.out.println(rotateDigits(345, 2, true));
}
public static int rotateDigits(int number, int noOfDigitesToBeMoved, boolean toLeft){
String str = I... |
A22771 | A20892 | 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... | package com.google.codejam.Qualification2012;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.Scanner;
public class B {
public static void main(String[] args) throws IOException {
... |
B11327 | B10901 | 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.*;
import java.util.*;
public class Main
{
public static void main(String[] args)throws IOException
{
new Main().start();
}
public void start()throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st;
int test=Integer.parseInt(br.readLin... |
B10361 | B11956 | 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.text.NumberFormat;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Scanner;
import java.util.Set;
public class Problem3 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int lineNo = scan.nextInt();
for(int i = 0 ... |
A12113 | A11912 | 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.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.StringTokenizer;
public class Dancing {
public static String dancing(int N, int S, int p, int n... |
B10149 | B10726 | 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 =... | //saurabh
import java.io.*;
import java.util.*;
public class Recycle
{
public static void main(String args[]) throws IOException
{
Recycle ob=new Recycle();
int T,A,B;
Scanner c= new Scanner(new File("Recycle.txt"));
T=c.nextInt();
int ans[]=new int[T];
for(int i=0;i<T;i++)
{
A=c.nextInt();
B=c... |
A10568 | A13082 | 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.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... |
A20382 | A20327 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class dancing {
public static void main(String args[]) throws Exception{
FileInputStream fs = new FileInputStream("in2.tx... |
A22642 | A21529 | 0 | import java.util.*;
import java.io.*;
public class DancingWithTheGooglers
{
public DancingWithTheGooglers()
{
Scanner inFile = null;
try
{
inFile = new Scanner(new File("inputB.txt"));
}
catch(Exception e)
{
System.out.println("Problem ope... | package quals;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
BufferedReader reader =... |
A20490 | A21547 | 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... | package com.jp.common;
public interface Puzzle {
public String[] solve(String[] dataSet );
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.