F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
B20856 | B20623 | 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 utils;
/**
*
* @author Fabien Renaud
*/
public abstract class JamCase implements Runnable, JamCaseSolver {
protected final int number;
protected String result;
private final StopWatch timer;
private final Jam parent;
protected JamCase(Jam parent, int number) {
this.parent = parent;
this.... |
B12082 | B12848 | 0 | package jp.funnything.competition.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.apache.commons.io.IOUtils;
public class QuestionReader {
pr... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Google code jam.
* Qualification Round 2012.
* Problem C. Recycled Numbers
*
* Usage: <app> <input >output
*
... |
B10149 | B11777 | 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 qual;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
class RecycledPair
{
int a;
int b;
public RecycledPair(int a, int b) {
super();
this.a = a;
this.b = b;
}
@Override
public int hashCode() {
final int PRIME = 31;
int result = 1;
result = PRIME * result + (a +... |
B10231 | B13099 | 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.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.LinkedList;
import java.util.Scanner;
public class Recycled {
public static void main(String[] args) throws IOException {
Scanner s = new Scanner(new File("io/recycled-biga.in"));
FileWriter fw = new FileWriter(new File(... |
B12074 | B11117 | 0 | package jp.funnything.competition.util;
import java.math.BigInteger;
/**
* Utility for BigInteger
*/
public class BI {
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger add( final BigInteger x , final BigInteger y ) {
return... | import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class RecycleSolution {
/**
* @param args
*/
public static void main(String[] args) {
String inFilename = "C-small-attempt0.in";
String outFil... |
A12211 | A12414 | 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 cg.y2012.QualQ2;
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.HashMap;
import java.util.List;
import java.util.Map;
public class Q2 {
/**
* @param args
*/
publ... |
B12082 | B10863 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
/**
*
* @author PRATIK
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int test=args.length/2;
... |
B12082 | B11304 | 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... | /**
* Copyright 2012 Christopher Schmitz. All Rights Reserved.
*/
package com.isotopeent.codejam;
import com.isotopeent.codejam.lib.SolverBase;
import com.isotopeent.codejam.lib.Utils;
import com.isotopeent.codejam.lib.converters.IntArrayLine;
public class Solver extends SolverBase<int[]> {
private static final ... |
B21968 | B21689 | 0 | import java.util.*;
import java.io.*;
public class recycled_numbers {
public static void main(String[]a) throws Exception{
Scanner f = new Scanner(new File(a[0]));
int result=0;
int A,B;
String n,m;
HashSet<String> s=new HashSet<String>();
int T=f.nextInt(); //T total case count
for (int t=1; t<=T... | import java.io.*;
import java.util.StringTokenizer;
public class klick
{
public static void main(String []args)
{
try{
FileInputStream fstream = new FileInputStream("input.in");
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedRe... |
B12941 | B13035 | 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... | package qualification.q2;
import qualification.common.InputReader;
import qualification.common.OutputWriter;
import qualification.q1.Q1Solver;
/**
* Created by IntelliJ IDEA.
* User: ofer
* Date: 14/04/12
* Time: 18:55
* To change this template use File | Settings | File Templates.
*/
public class Q2Sim {
... |
B10149 | B11072 | 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 fixjava;
import java.util.Iterator;
/**
* Create an iterator that keeps track of the current index into the Iterable.
*
* Usage:
*
* <code>
public static void main(String[] args) {
// Iterate over a list:
ArrayList<String> list = new ArrayList<String>();
list.add("apple");
list.add("banana"... |
A22078 | A20252 | 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 files;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
public class Googler3 {
public static void main(String[] args) {
try
{
//BufferedReader br = new BufferedReader(new FileReader("/Users/Sush/Documents/works... |
B10899 | B10580 | 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.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
public class ReadFile {
public static void main(... | package codejam.morl99.c;
import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import jav... |
B10485 | B11675 | 0 |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class Recycle
{
public static void main(String[] args)
{
/* Set<Integer> perms = getPermutations(123456);
for(Integer i: p... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Calendar;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class C {
private static CodeJamIO io = new CodeJamIO();
/**
* @param args
*/
public... |
B20006 | B21618 | 0 | import java.io.*;
import java.math.BigInteger;
import java.util.*;
import org.jfree.data.function.PowerFunction2D;
public class r2a
{
Map numMap = new HashMap();
int output = 0;
/**
* @param args
*/
public static void main(String[] args)
{
r2a mk = new r2a();
try {
... | package qualification.round.atual;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanne... |
A22992 | A21969 | 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 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... |
A13029 | A11434 | 0 | import java.util.List;
public class Case implements Runnable {
private int id;
private String output;
private int n;
private int s;
private int p;
private List<Integer> g;
public Case(int id) {
this.id = id;
}
public Case(int id, int n, int s, int p, List<Integer> g) {
super();
this.id = id;
this... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.*;
public class B {
static class State {
boolean surprising, not;
int max;
State(boolean S, boolean n, int mx) {
... |
B10361 | B10938 | 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 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;... |
B11421 | B12804 | 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.*;
import java.util.*;
public class Recycle {
public static void main(String[] args) throws FileNotFoundException, IOException {
Scanner sc = new Scanner(new File("input.in"));
FileWriter fstream = new FileWriter("out.txt");
BufferedWriter out = new BufferedWriter(fstream);
int T = sc.nextInt... |
B12082 | B12931 | 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.*;
public class recycled {
private static int digits(int num) {
int sol = 1;
while (num / 10 != 0) {
sol *= 10;
num /= 10;
}
return sol;
}
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
Scanner ... |
A11201 | A11227 | 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.*;
import java.util.*;
public class B{
public static void main(String[] args) throws Exception{
BufferedReader fin = new BufferedReader(new FileReader("B.txt"));
PrintWriter fout = new PrintWriter(new FileWriter("Bout.txt"));
String s = fin.readLine();
int t = Integer.parseInt(s);
s = fin.re... |
A20261 | A20578 | 0 | package com.gcj.parser;
public class MaxPoints {
public static int normal(int value){
int toReturn = 0;
switch (value) {
case 0 : toReturn = 0 ; break;
case 1 : toReturn = 1 ; break;
case 2 : toReturn = 1 ; break;
case 3 : toReturn = 1 ; break;
case 4 : toReturn = 2 ; break;
case 5 : toReturn = 2 ; b... | package Controller;
import ProblemSolvers.DancingGooglers;
import ProblemSolvers.ProblemSolver;
public class Main {
public static void main(String[] args) {
ProblemSolver problem = new DancingGooglers("dancingGooglers");
problem.process();
}
}
|
B21752 | B21941 | 0 | package Main;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
/**
* Created with IntelliJ IDEA.
* User: arran
* Date: 14/04/12
* Time: 3:12 PM
* To change ... | package c;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.text.AttributedCharacterIterator;
import java.util.Ar... |
A12113 | A12245 | 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"... | /**
*
*/
package asem.google.codejam;
//import asem.google.codejam.pract.y2010.qround.ProblemC;
/**
* @author A.Alathwari
*
* MainClass
*
*/
public class MainClass {
public static String INPUT_FILE_PATH = "input.txt";
public static String OUTPUT_FILE_PATH = "output.txt";
/**
*
*/
public MainC... |
B21270 | B22028 | 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 qual2012;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.util.HashSet;
public class C {
public static void main(String[] args) throws FileNotFoundException {
Kattio io;
// io = new Kattio(System.in, System.out);
// io = new Kattio(new F... |
A22078 | A22947 | 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.ozan.jam.qr2012;
import com.ozan.jam.JamBase;
import java.io.IOException;
import java.util.Scanner;
/**
* TODO: Describe type
*/
public class B extends JamBase {
protected B() throws IOException {
super("qr2012", "B", "large");
}
public static void main(String[] args) throws IOExc... |
A21396 | A21925 | 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++){
... | package codejam;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Gedion Moyo
*/
public class dance {
/**
* @param args the command line arguments
*/
s... |
A21010 | A22338 | 0 | package codejam;
import fixjava.Pair;
public class Utils {
public static long minLong(long firstVal, long... otherVals) {
long minVal = firstVal;
for (int i = 0; i < otherVals.length; i++)
minVal = Math.min(firstVal, otherVals[i]);
return minVal;
}
public static int minInt(int firstVal, int... otherVals... | import java.io.*;
import java.util.*;
class Dancing
{
public static void main(String[] args) throws IOException
{
Scanner s = new Scanner(new File(args[0]));
int numTests = s.nextInt();
for (int i = 1; i <= numTests; i++)
{
// Get rid of prepending newline.
... |
B10858 | B13220 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| import java.util.Scanner;
public class NumberRecycling {
public static void main( String args[] ) {
new NumberRecycling();
}
public NumberRecycling() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for( int j=1; j<=T; j++ ) {
System.out.println( "Case #"+ j + ": " + doCase(sc) );
}
}... |
A10568 | A12901 | 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 main;
import java.util.Vector;
import java.io.*;
public class Googlers {
/**
* 2012 Qualif B
*/
static int numberOfElementForEachTest = 0;
static int numberOfLinesPerTest = 0;
public static void main(String[] args) {
Vector<Integer> elements = new Vector<Integer>();
numberOfElementForEachTest =... |
A22992 | A20702 | 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.*;
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();
}
... |
A20382 | A21925 | 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 codejam;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Gedion Moyo
*/
public class dance {
/**
* @param args the command line arguments
*/
s... |
B11361 | B10586 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
public class C {
public static void main(String[] args) throws Exception{
Scanner sc = new Scanner(new File("C.in"));
PrintWriter out = new PrintWriter(new ... |
A12113 | A12091 | 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"... | package dancers;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
public class Dancers {
public static int SURPRISE = 0;
public static int ATENDEE = ... |
A12113 | A12138 | 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.util.Scanner;
public class Dancing_With_the_Googlers {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int T = 0;
while (scanner.hasNextInt()) {
T = scanner.nextInt();
break;
}
for (int t = 0; t <= T; t++) {
if (scanner.hasNextLine()) {
String lin... |
B21049 | B22251 | 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;
public class Problem3
{
public void solve(){
ReadWriter rw = new ReadWriter();
ArrayList<String> input = rw.readFile("C-large.in");
ArrayList<String> ans = new ArrayList<String>();
int num;
boolean first = true;
int... |
B10155 | B11742 | 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 C {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int zz = 1; zz <= T;zz++){
int A = in.nextInt();
int B = in.nextInt();
int result = 0;
for(int i=A;i<=B;i++) {
ArrayList<Integer> pairs = new ArrayList<Inte... |
B21752 | B20479 | 0 | package Main;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
/**
* Created with IntelliJ IDEA.
* User: arran
* Date: 14/04/12
* Time: 3:12 PM
* To change ... | package codejam2012.qualifier;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumbers {
private int noOfCases;
private int currentCase;
private BufferedReader reader;
private B... |
A11917 | A10944 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package jam2;
import java.util.Scanner;
/**
*
* @author clary35
*/
public class Jam2 {
Jam2() {
int[] totals = new int[10000];
System.out.println("Input:");
Scanner scan = new Scanner(... |
B10899 | B10174 | 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.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
public class ReadFile {
public static void main(... | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Date;
import java.util.HashSet;
import java.util.StringTokenizer;
public class GCJ2012QC {
static HashSet<Integer> set = new HashSet<Integer>();
static final int ZERO = 48;
public static void main(String[]... |
A12846 | A12066 | 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.*;
import java.util.*;
public class DancingGooglers {
public static void main(String args[]) {
try {
String strFileName = args[0];
BufferedReader bfReader = new BufferedReader(new FileReader(strFileName));
long nTestCases = Integer.parseInt(bfReader.readLine());
for(int testCaseCounte... |
A11201 | A10281 | 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.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author home
*/
publi... |
B12669 | B13109 | 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 com.vp.impl;
import java.util.ResourceBundle;
import com.vp.iface.Problem;
public class SpeakGooglerese implements Problem {
@Override
public String solve(String[] dataset) {
ResourceBundle rb = ResourceBundle.getBundle("Mapping");
String strReturnValue = "";
//System.out.println("Translated Text... |
A20261 | A23000 | 0 | package com.gcj.parser;
public class MaxPoints {
public static int normal(int value){
int toReturn = 0;
switch (value) {
case 0 : toReturn = 0 ; break;
case 1 : toReturn = 1 ; break;
case 2 : toReturn = 1 ; break;
case 3 : toReturn = 1 ; break;
case 4 : toReturn = 2 ; break;
case 5 : toReturn = 2 ; b... | package codejam;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class ProblemB {
/**
* @param args
*/
public static void main(String[] args) throws Exception{
// TODO Auto-generated method stub
Scanner sc = new Scanner(new File("ProblemB.tx... |
A20119 | A21721 | 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_round;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class A_sl_Dansing {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
Scanner inp = new Scanner(new FileInputStream("A... |
A11502 | A11302 | 0 | package template;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
public class TestCase {
private boolean isSolved;
private Object solution;
private Map<String, Integer> intProperties;
private Map<String, ArrayList<Integer>> intArrayProperties;
private Map<String, Arra... | import java.util.Scanner;
public class B {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int T = scanner.nextInt();
for(int j = 1; j<T+1; j++) {
int N = scanner.nextInt();
int S = scanner.nextInt();
int p = scanner.nextInt();
int minS = p>2? (p-2)*2+p : p;
... |
B11318 | B12852 | 0 | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
int casos=1, a, b, n, m, cont;
while(t!=0){
a=sc.nextInt();
b=sc.nextInt();
if(a>b){
int aux=a;
a=b;
b=aux;
}
System.out.printf("Case #%d: ",casos... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
public class Main {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new File... |
A11277 | A12777 | 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.util.ArrayList;
public class Logic {
public static void solve() {
//First input line
//Texter.readLine();
int noOfCases = Integer.valueOf(Texter.readLine());
//Texter.writeText("Output");
for (int i = 1; i <= noOfCases; i++) {
int caseNo = i;
String nextLine = Texter.readL... |
B12074 | B10667 | 0 | package jp.funnything.competition.util;
import java.math.BigInteger;
/**
* Utility for BigInteger
*/
public class BI {
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger add( final BigInteger x , final BigInteger y ) {
return... | import java.io.*;
import java.util.*;
public class recycle {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
FileInputStream fstream = new FileInputStream("C:/input.txt");
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = ne... |
B20424 | B21519 | 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.util.Arrays;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().go();
}
private void go() {
Scanner sc = new Scanner(System.in);
int numTestCases = Integer.parseInt(sc.nextLine());
for (int c... |
B12941 | B11774 | 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... | /**
* @(#)Main.java
*
*
* @author
* @version 1.00 2012/4/14
*/
import java.io.*;
public class Main {
public static void main(String...args)throws IOException {
BufferedReader br = new BufferedReader(new FileReader("C-small-attempt0.in"));
FileWriter fstream = new FileWriter("C-small-attempt0.out");... |
B10858 | B11428 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
/**
*
* @author Suarabh Agarwal
*/
import java.io.*;
import java.util.Scanner;
public class Main3
{
public static void main(String args[])
{
try{
Scanner scan1 = new Scanner(new FileReader("... |
B21207 | B21221 | 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) ... | public class InvalidInputException extends Exception {
/**
*
*/
private static final long serialVersionUID = -3613289305328322102L;
public InvalidInputException() {
super();
// TODO Auto-generated constructor stub
}
public InvalidInputException(String arg0, Throwable arg1, boolean arg2,
boolean arg3... |
A22078 | A22008 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
public class GooglersDancer {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated metho... | import java.util.List;
public class ProblemSample implements Problem {
private Integer solution;
private List<Integer> scores;
private int S;
private int p;
@Override
public void solve() {
solution = 0;
int equit = 3 * p;
for (Integer score : scores) {
if (score >= p) {
int diff = equit - score... |
B12115 | B13061 | 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 com.google.codejam.recycle;
/**
* Class to represent each test case.
* It will hold details like test case no, input to be operated and TestResult.
* @author Sushant Deshpande
*
*/
public class TestCase {
/**
* Variable to hold value for test case number.
*/
private int caseNo;
/**... |
B21270 | B21042 | 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 de.hg.codejam.tasks.io;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
public abstract class Writer {
public static String generateOutputPath(String inputPath) {
return inputPath.substring(0, inputPath.lastIndexOf('.') + 1) + "out";
}
public static void print(Stri... |
A12544 | A13236 | 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 jam;
import java.util.Scanner;
public class Main_B {
static int[] results;
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int tests = Integer.valueOf(scan.nextLine());
results = new int[tests];
int c = 0;
while(c < tests)
{
solve(scan.nextLine(), c);
c++;
... |
B10858 | B10419 | 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.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class MainClass {
/**
* @param args
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
Scanner sc = new Scanner(new File("C-small-attempt0.in"));
Pri... |
A11277 | A11967 | 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.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
public class Dancing {
public static PrintWriter pw;
public static void main(String[] args) throws FileNotFoundException {
//Scanner in = new Scanner (System.in);
try{
File f = new File("\\\... |
A10996 | A11573 | 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.*;
import java.util.*;
public class ProbB {
public static void main(String[] args) throws FileNotFoundException, IOException {
ProbB p = new ProbB();
p.solveAll();
}
int tests = 0;
Scanner in;
BufferedWriter out;
public ProbB() throws FileNotFoundException, IOExce... |
A12211 | A12067 | 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 codejam2012.qualification;
import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class DancingWithTheGooglers {
// general part
private static final String INPUT = "src/main/resources";
private static final String OUTPUT = "target/output";
private static final String ROUND... |
A21010 | A23088 | 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... | package jam;
import java.util.Scanner;
public class Main_B {
static int[] results;
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int tests = Integer.valueOf(scan.nextLine());
results = new int[tests];
int c = 0;
while(c < tests)
{
solve(scan.nextLine(), c);
c++;
... |
B10361 | B10264 | 0 | package codejam;
import java.util.*;
import java.io.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("in.txt"));
PrintWriter out = new PrintWriter(new File("out.txt"));
int T = Integer.parseInt(in.readLine());... |
import java.io.BufferedReader;
import java.io.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... |
B11318 | B10075 | 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.*;
/**
* @author Chris Dziemborowicz <chris@dziemborowicz.com>
* @version 2012.0414
*/
public class RecycledNumbers
{
public static void main(String[] args)
throws Exception
{
// Get input files
File dir = new File("/Users/Chris/Documents/UniSVN... |
B12074 | B11581 | 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 pl.helman.codejam.recycled;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
//Brute force attempt
public class Recycled {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
FileRead... |
A10568 | A11389 | 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.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.StringTokenizer;
public class B {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new FileReader("test2.data"));
StringTokenizer tokenizer = ... |
B12115 | B13169 | 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.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
public class ProblemC {
public static void main(String argv[])
{
// IOSystem ioSystem = new IOSystem("problem/A-small-attempt2");
IOSystem ioSystem = new IOSystem("problem/C-small-attempt0");
// IOSystem ioSystem ... |
B20023 | B20560 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
public class GoogleC {
public String szamol(String input){
String result="";
String... |
import java.io.*;
import java.util.*;
class JamC
{
public static void main(String args[])throws Exception
{
FileReader fr = new FileReader("C-large.in");
BufferedReader br = new BufferedReader(fr);
FileWriter fw= new FileWriter("out.txt");
BufferedWriter bw=new BufferedWriter(fw);
PrintWriter pw= new PrintWrite... |
A12460 | A10830 | 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;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.LinkedList;
import java.util.Queue;
public class GooglersDance {
public static void main(String[] args) throws IOException {
String fileName = "B-small-attemp... |
B12115 | B12608 | 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.awt.Point;
import java.io.File;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class C {
public static Set<Point> set;
public static void main(String[] args) throws Exception {
Scanner in = new Scanner(new File("input.in"));
int n, a, b;
int ans;
n = in.nextInt(... |
B12941 | B13073 | 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... | package round1;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumbers {
public static Set<Integer>findRecycledNumber... |
A11502 | A11689 | 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 codejam.network172.com;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class CodeJam {
public static void main(String[] args) {
try {
BufferedReader in = new Buffer... |
A22078 | A21558 | 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 qualification;
import java.io.*;
public class Bsmall {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new FileReader("./src/qualification/B-large.in"));
BufferedWriter bw = new BufferedWriter(new FileWriter("./src/qualification/B-large.out"));
int[][]... |
B21790 | B21629 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Scanner;
/**
*
* @author linlin
*/
public class Main {
/**
* @param... |
A20934 | A21182 | 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()... | /**
* Copyright 2012 Christopher Schmitz. All Rights Reserved.
*/
package com.isotopeent.codejam.lib.converters;
import com.isotopeent.codejam.lib.InputConverter;
public class MultiLineConverter implements InputConverter<Object[]> {
private InputConverter<?>[] converters;
private int count;
private Object[] i... |
B11327 | B12832 | 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.googlecodejam.gcj2012.qualificationround;
import java.io.File;
import java.io.FileWriter;
import java.util.HashSet;
import java.util.Scanner;
public class C {
// public final static String INPUT_FILE_NAME = "test.in";
public final static String INPUT_FILE_NAME = "C-small-attempt0.in";
// public final st... |
A11277 | A11859 | 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;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class Dancers {
public static void main(final String[] args)... |
B20006 | B20632 | 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.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.Writer;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.StringTokenizer;
... |
B21752 | B20113 | 0 | package Main;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
/**
* Created with IntelliJ IDEA.
* User: arran
* Date: 14/04/12
* Time: 3:12 PM
* To change ... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
import java.util.TreeSet;
import static java.lang.Math.*;
public class RecycledNumbers {
String PROBLEM_ID = "RecycledNumb... |
B10149 | B12526 | 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 round0;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
public class Dance {
BufferedReader _in;
PrintWriter _out;
int _numTestCases;
Input[] _inputs;
public Dance(BufferedReader in) throws Exception {
this._... |
B21049 | B21078 | 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.HashSet;
import java.util.Set;
/**
* ***************************************************************************
* Created by IntelliJ IDEA.
* User: Narender Singh Pal
* Date: 4/14/12
* Time: 10:59 AM
* <p/>
* *******************************************************************... |
B22190 | B20595 | 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 be.mokarea.gcj.recyclednumbers;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
import be.mokarea.gcj.common.TestCaseReader;
public class RecycledNumbersTestCaseReader extends
TestCaseReader<RecycledNumbersTestCase> {
private final... |
A10699 | A11261 | 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.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
public class Dancers {
public static void main (String args[]){
if (args.length != 1){
System.out.println ("Gimme the right arguments!");
return;
... |
A12460 | A12333 | 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 qr2012;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
public static void main(String[] args) throws Exception {
St... |
A11135 | A10664 | 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.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;... |
A20934 | A21999 | 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.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 {
... |
A22360 | A22038 | 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.FileInputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.Scanner;
public class Run3 {
class ll {
public lln f;
public lln l;
}
class lln {
public Object v;
public lln n;
}
private static Scanner sc;
public static int gi() {
ret... |
B21968 | B21637 | 0 | import java.util.*;
import java.io.*;
public class recycled_numbers {
public static void main(String[]a) throws Exception{
Scanner f = new Scanner(new File(a[0]));
int result=0;
int A,B;
String n,m;
HashSet<String> s=new HashSet<String>();
int T=f.nextInt(); //T total case count
for (int t=1; t<=T... | package google.codejam2012.awanish;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.StringTokenizer;
public class RecycledNumbers {
static long total = 0;
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner inputScan = new Scanne... |
A10996 | A12395 | 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.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import java.util.StringTokenizer;
public class codeJam2 {
public static void main(String[] args) throws FileNotFoundException {
//System.out.print("input.txt");
Scanner input = new Scanner(new File("input.txt"));
String Do... |
B10245 | B10989 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | package at.jaki.codejam.qr2012.C;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
public class C {
private static final String TEMPLATE = "Case #%d: %d";
private static final String IN = "C-small-a... |
A20119 | A21584 | 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,... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package uk.co.epii.codejam.dancingwiththegooglers;
import uk.co.epii.codejam.common.AbstractMain;
/**
*
* @author jim
*/
public class Main {
/**
* @param args the command line arguments
*/
public ... |
B10245 | B11631 | 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 static java.lang.System.*;
import static java.lang.Math.*;
import static java.lang.Character.*;
import java.io.*;
import java.util.*;
public class recycled
{
public static Scanner in;
public static String nl(){return in.nextLine();}
public static int ni(){return in.nextInt();}
public static doubl... |
A11502 | A12387 | 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 CodeJamB {
public static void main (String[] args) throws IOException {
int i, j, k;
long startTime = System.currentTimeMillis();
File inFile = new File("B-small-attempt0.in"); // File to read from
File outFile = new File("B-small-practice.out");
Buffe... |
A10793 | A11115 | 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 com.googlecode.codejam.model;
import java.util.Iterator;
import java.util.concurrent.Callable;
public abstract class JamCaseResolverFactory {
public abstract Callable<String> newJamCaseResolver(int caseNumber, Iterator<String> lineIterator);
}
|
A11135 | A10910 | 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.BufferedReader;
import java.io.FileReader;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
public class Task2
{
public static void main(String[] args)
{
try
{
readSolveAndWrite("B-small-attempt4.in", "output_file.txt");
}
catch(IOException i... |
A20261 | A21579 | 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 uk.co.epii.codejam.common;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
/**
*
* @author jim
*/
public class Output {
private final S... |
B12762 | B10372 | 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 ... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package solution;
import com.sun.xml.internal.ws.server.InvokerTube;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Vector;
/**
*
* @author Aditya
*/
import j... |
A11277 | A11473 | 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.PrintWriter;
import java.util.StringTokenizer;
public class Googlers {
public static void main(String[] args) throws Exception {
BufferedReader in = new BufferedReader(new Fi... |
A12460 | A12970 | 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 mgg.utils;
public class Triplet {
public int first;
public int second;
public int third;
public Triplet(int first, int second, int third){
this.first = Math.max(Math.max(first, second), third);
if (first == this.first){
this.second = Math.max(second, third);
this.third = Math.min(second, third)... |
B10231 | B10399 | 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... | /*
Problem
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) is recycled if you can obtain m by moving... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.