F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
A12113 | A12173 | 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 hk.polyu.cslhu.codejam.solution.impl.qualificationround;
import java.util.ArrayList;
import java.util.List;
import hk.polyu.cslhu.codejam.solution.Solution;
public class DancingWithTheGooglers extends Solution {
private int N, S, p;
private List<Integer> totalPointList;
@Override
public void setProblem(... |
A12460 | A10216 | 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 gcj.base;
import java.util.regex.Pattern;
/**
*
* @author jalves
*/
public class ProbB {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
n... |
A21010 | A20218 | 0 | package codejam;
import fixjava.Pair;
public class Utils {
public static long minLong(long firstVal, long... otherVals) {
long minVal = firstVal;
for (int i = 0; i < otherVals.length; i++)
minVal = Math.min(firstVal, otherVals[i]);
return minVal;
}
public static int minInt(int firstVal, int... otherVals... | import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class ProblemB {
public static void main(String[]args) throws FileNotFoundException {
File file = new File("test.txt");
Scanner scan = new Scanner(file);
int cases = Integer.parseInt(scan.nextLine());
for(int i=1... |
B21752 | B20078 | 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.FileInputStream;
import java.util.*;
public class Q_C {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(new FileInputStream("C:\\C-large.in"));
Set<String> set = new HashSet<String>();
int tests = sc.nextInt();
for (int i = 0; i <... |
A10996 | A10261 | 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.*;
public class MySolution {
public MySolution() {
}
public static void main(String[] a) throws IOException {
sumfile("B-small-attempt0.in");
}
static void sumfile(String filename) throws IOException {
int tests=0;
int N=0;
int S=0;
int p=0;
int ti=0;
int count=0;
Reader r = new ... |
B21752 | B21255 | 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 util;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author bohmd
*/
public abstract class BaseResolver {
private final Stri... |
B10858 | B11705 | 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.*;
public class C {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
int T = in.nextInt();
int i,j,len,p,temp,total;
HashSet<Integer>[] map = new HashSet[2000000];
for (i=1;i<2000000;i++) {
map[i]... |
B11318 | B10833 | 0 | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
int casos=1, a, b, n, m, cont;
while(t!=0){
a=sc.nextInt();
b=sc.nextInt();
if(a>b){
int aux=a;
a=b;
b=aux;
}
System.out.printf("Case #%d: ",casos... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.StringTokenizer;
public class ProblemC {
/**
* @param args
* @throws IOException
* @throws NumberFormatException
*/
public static void main(String[] args) throws NumberFormatEx... |
B12085 | B12811 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
public class RecycledNumbers {
static ArrayList<Integer> perm(int j){
ArrayList<Integer> ret = new ArrayList<Integer>();
String num = j+"";
int aux;
for(int i=0;... |
A20382 | A21900 | 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.FileReader;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class Program {
/**
* @param args
*/
public static void main1(String[] args) {
Speaking_in_Tongues sit=new Speaking_in_Tongues();
sit.initialize();
sit.register("our language is... |
A22191 | A21952 | 0 | package com.example;
import java.io.IOException;
import java.util.List;
public class ProblemB {
enum Result {
INSUFFICIENT,
SUFFICIENT,
SUFFICIENT_WHEN_SURPRISING
}
public static void main(String[] a) throws IOException {
List<String> lines = FileUtil.getLines("/B-large.in");
int cases = Int... | package qr1;
import org.junit.Test;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import static junit.framework.Assert.assertEquals;
/**
* Created with IntelliJ IDEA.
* User: shtratos
* Date: 14/04/12
* Time: 04:28
*/
public class DancingGooglers {
publi... |
A22378 | A21309 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class CodeJam {
// public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt";
public static final String INP... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
/* Jin Hao Chong
* Google Code Jam 2012 Qualification Round Question 2
* In this program, I used the Java standard library of java.io;
*/
public class Googlers {
public static void main(String args[]... |
A10699 | A12883 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Dancing {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) ... | package lk.iit.wall.framework.network;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Arrays;
import java.util.Scanner;
/**
* Created with IntelliJ IDEA.
* User: Amila
* Date: 4/13/12
* Time: 10:48 PM
* To change this template use File | Settings | File Templates.
*/
public class Co... |
A20119 | A22604 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | import java.io.*;
public class qua1 {
public static int[] factorize(int i) {
int[] re = new int[3];
if(i==0)
for(int ind=0; ind<3; ind++) {
re[ind] = 0;
}
else {
int temp = i / 3;
temp++;
for(int ind=0; ind<3; ind++) {
re[ind] = temp;
}
int diff = temp * 3 - i;
for(int ind=0; ind... |
A12273 | A11042 | 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.... | package fixjava;
/** Adapted from http://www.johndcook.com/standard_deviation.html */
public class RunningStats {
int n = 0;
double oldM, newM, oldS, newS, min, max;
public void clear() {
n = 0;
}
public void add(double x) {
n++;
// See Knuth TAOCP vol 2, 3rd edition, page 232
if (n == 1) {
oldM = ... |
A21010 | A21265 | 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.util.*;
public class problemB
{
public static void main(String[]args)
{
Scanner scanner = new Scanner(System.in);
int N = scanner.nextInt();
for(int num=1;num<=N;num++)
{
int cnt = scanner.nextInt();
int suprise = scanner.nextInt();
... |
B12085 | B10945 | 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.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
public class RecycledNumbers {
public long getNumbers(int a, int b) {
long ans = 0;
for(int n = a; n < b; n++) {
String nString = n + "";
ArrayList<Integer> store = new ArrayList<Integer>();
for(int i = 1; i < n... |
B11327 | B10269 | 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]);
}
}
}
| /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj2012;
/**
*
* @author allegea
*/
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintW... |
A12460 | A12137 | 0 | /**
*
*/
package pandit.codejam;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Scanner;
/**
* @author Manu Ram Pandit
*
*/
public class DancingWithGoogle... | import java.io.*;
public class Main {
static private int getNonSuprising(int sum) {
if (sum == 0) return 0;
return (int) Math.floor((double) (sum+2) /3);
}
static private int getSuprising(int sum) {
if (sum == 0) return 0;
if (sum == 1) return 1;
return (int) Math.ceil( (double) (sum-1) / 3) + 1;
}
... |
B10231 | B12710 | 0 | import java.io.*;
class code1
{
public static void main(String args[]) throws Exception
{
File ii = new File ("C-small-attempt1.in");
FileInputStream fis = new FileInputStream(ii);
BufferedReader br = new BufferedReader(new InputStreamReader (fis));
int cases = Integer.parseInt(br.readLine());
FileOutput... | import java.io.*;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;
public class RecycledNumbers {
BufferedReader br;
StringTokenizer st = new StringTokenizer("");
private void solve() throws IOException {
// final String IO_FILE = null;
final String IO_FILE = "./C/C-smal... |
A12544 | A11918 | 0 | package problem1;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Arrays;
public class Problem1 {
public static void main(String[] args) throws FileNotFoundException, IOException{
try {
TextIO... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package jam2012;
import jam.util.Utilities;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Arrays;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;
... |
B11318 | B10076 | 0 | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
int casos=1, a, b, n, m, cont;
while(t!=0){
a=sc.nextInt();
b=sc.nextInt();
if(a>b){
int aux=a;
a=b;
b=aux;
}
System.out.printf("Case #%d: ",casos... | package qualification;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.PrintStream;
public class C {
static byte[][] MAP = new byte[1000][1000];
private static final char[] CASE = "Case #".toCharArray();
public static void main(String[] args) throws ... |
A12846 | A10971 | 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 dancing {
static String next() {
if (st == null || !st.hasMoreTokens())
nextLine();
return st.nextToken();
}
static int nextInt() {
return Integer.parseInt(next());
}
static void nextLine() {
try {
st = new StringTokenizer(f.readLine());
} catch... |
A12273 | A11440 | 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.security.AlgorithmConstraints;
import java.util.Scanner;
import java.util.StringTokenizer;
public class Numbers {
static int count =0;
static int max;
static int surprise;
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int testCa... |
B10155 | B12451 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
/**
*
* @author eblanco
*/
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
impo... | package com.wordofday.service.job;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.Stack;
public class GoogleRecycle {
public GoogleRecycle() {
... |
A22642 | A20289 | 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 ProblemB;
import java.io.*;
import java.util.StringTokenizer;
public class Dancing {
public Dancing() {
// TODO Auto-generated constructor stub
}
public static void dancing()throws IOException{
BufferedReader rdr = new BufferedReader(new FileReader("B-large.in"));
PrintWriter pw = new Prin... |
B10231 | B12711 | 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.util.ArrayList;
import java.util.Scanner;
public class RecycledNumbers {
static ArrayList<pair> list=new ArrayList<pair>();
public static void main(String[] args) {
int pow[]=new int[10];
for(int i=0;i<10;i++){
pow[i]=(int)Math.pow(10, i);
}
Scanner sc=new Scanner(System.in);
int t=sc.nex... |
A21396 | A20904 | 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++){
... |
public class ProblemB {
public static int[] generateTriplet(int totalScore)
{
int third = totalScore/3;
int[] triplet = new int[3];
int total = 0;
int i = 0;
triplet[0] = third;
triplet[1] = third;
triplet[2] = third;
total = third*3;
while(total < totalScore)
{
triplet[i] += 1;
... |
B10361 | B12212 | 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 hk.polyu.cslhu.codejam.lib;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
public class ResultCollector {
public static Logger logger = Logger.getLogger(ResultCollector.class);
public static S... |
B21790 | B21615 | 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.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Scanner;
public class C {
static long[] ten;
public static void main(String[] args) throws IOException... |
B10702 | B13054 | 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.Scanner;
import java.util.ArrayList;
public class RecycledNo
{
private Scanner input = null;
private PrintWriter output = null;
private int numOfCases;
int getNextCount=0;
ArrayList<String> al = new ArrayList<String>();
public static void main(String[] args)
{
Recycl... |
B11361 | B13193 | 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.util.ArrayList;
import java.util.Scanner;
public class Prob3 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
int num = scan.nextInt();
scan.nextLine();
for(int... |
B12941 | B11413 | 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 com.GoogleCodeJam.y2012.Qualification.RecycledNumbers;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumbers {
public static void main(Stri... |
B21227 | B21967 | 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... | package gcj2012.qr;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumbers {
public static int count(int a, int b) {
int r = 0, len, m;
String sn, sm;
Set<Integer> used = new HashSet<Integer>();
for ... |
B11318 | B11569 | 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.Scanner;
import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintStream;
public class Recycled {
public static void main(String[] args) {
try {
Scanner sc = new Scanner(new File("input.in"));
FileOutputStream output = new FileOutputStream("output.txt");
PrintStream p = ne... |
A20261 | A21200 | 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... | import java.io.*;
public class Dancing{
public static void main(String args[]){
try{
FileInputStream fstream = new FileInputStream(args[0]);
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
PrintWriter out = new PrintWrite... |
A22642 | A21075 | 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.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
FileInputStream fis = new FileInputStream(new File("in.txt"));
Fi... |
A11201 | A12366 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
public class Dancing {
Map<I... |
A20382 | A20904 | 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... |
public class ProblemB {
public static int[] generateTriplet(int totalScore)
{
int third = totalScore/3;
int[] triplet = new int[3];
int total = 0;
int i = 0;
triplet[0] = third;
triplet[1] = third;
triplet[2] = third;
total = third*3;
while(total < totalScore)
{
triplet[i] += 1;
... |
B21049 | B20075 | 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.HashSet;
import java.util.Scanner;
import java.util.Set;
import java.io.File;
import java.io.PrintWriter;
public class C {
public static void main(String args[]){
try{
File ifile = new File(args[0]);
File ofile = new File(args[1]);
//Scanner in = new Scanner(System.in);
//PrintWriter... |
B20424 | B21629 | 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... | /*
* 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... |
B20734 | B22064 | 0 | package fixjava;
public class StringUtils {
/** Repeat the given string the requested number of times. */
public static String repeat(String str, int numTimes) {
StringBuilder buf = new StringBuilder(Math.max(0, str.length() * numTimes));
for (int i = 0; i < numTimes; i++)
buf.append(str);
return buf.toStr... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Madu
*/
import java.io.*;
public class Ex3 {
int m_000000(){
return 0;
}
public static void main(String[] args) {
try {
Fi... |
B10231 | B12005 | 0 | import java.io.*;
class code1
{
public static void main(String args[]) throws Exception
{
File ii = new File ("C-small-attempt1.in");
FileInputStream fis = new FileInputStream(ii);
BufferedReader br = new BufferedReader(new InputStreamReader (fis));
int cases = Integer.parseInt(br.readLine());
FileOutput... | package recycledNumbers;
public class RecycledPair {
private int n;
private int m;
public RecycledPair(int n, int m) {
this.n = n;
this.m = m;
}
/**
* @return the n
*/
public int getN() {
return n;
}
/**
* @return the m
*/
public int getM() {
return m;
}
@Override
public boolean equals... |
B21227 | B20906 | 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... | /**
* Copyright 2012 Christopher Schmitz. All Rights Reserved.
*/
package com.isotopeent.codejam.lib;
import java.io.File;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
public class Utils {
private static final String FILE_IN_EXTENSION = ".... |
B20006 | B20091 | 0 | import java.io.*;
import java.math.BigInteger;
import java.util.*;
import org.jfree.data.function.PowerFunction2D;
public class r2a
{
Map numMap = new HashMap();
int output = 0;
/**
* @param args
*/
public static void main(String[] args)
{
r2a mk = new r2a();
try {
... | import java.io.*;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Comparator;
import java.util.StringTokenizer;
public class C implements Runnable {
private static final String PROBLEM_ID = "C";
private class TestCaseRunner {
int answer(int a, int b) {
int result =... |
A12846 | A10301 | 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.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
public class B_DancingWiththeGooglers {
public static void main(String[] args) throws FileNotFoundException {
Scanner sc = new Scanner(new File("file1.in"));
PrintWriter writer = new PrintWriter(new Fi... |
B12115 | B12370 | 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 qr2012;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.StringTokenizer;
public class RecycledNumbers {
public static void main(String[] args) throws Exception {
String fileName = args[0];
RecycledNumbers obj = new Recyc... |
A21396 | A22572 | 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.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
import java.util.StringTokenizer;
import java.util.Vector;
public class Algorithm2 {
static final String input_path = "F://workspace//GoogleContest2012//... |
A11201 | A10302 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
public class DancingwithGooglers {
public static void main(String args[]) throws IOException{
String inputFile = args[0];
String outputFile = args[1];
BufferedReader input = new BufferedReader(ne... |
A20490 | A22478 | 0 | /**
*
*/
package hu.herba.codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
public class DancingGooglers {
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... |
A11277 | A10486 | 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.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class dancing {
static int surprising;
/**
* @param args
*/
public static final int regexOccur(String text, String regex) {
Matcher matcher = Pattern.compile(regex).matcher(text);
int occur = 0;
while(ma... |
A10793 | A10739 | 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 compete;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.StringTokenizer;
public class B {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("B-small-attempt1.in... |
A13029 | A12376 | 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.util.HashMap;
import java.util.Map;
import java.util.Scanner;
/**
* Created by IntelliJ IDEA.
* User: elbek
* Date: 4/13/12
* Time: 9:51 PM
* To change this template use File | Settings | File Templates.
*/
public class Task2 {
static Map<Character, Character> map = new HashMap<Character, Charac... |
A11502 | A12978 | 0 | package template;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
public class TestCase {
private boolean isSolved;
private Object solution;
private Map<String, Integer> intProperties;
private Map<String, ArrayList<Integer>> intArrayProperties;
private Map<String, Arra... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.Scanner;
public class Dancing {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-gene... |
B10899 | B11929 | 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.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Main {
/**
* @param args
*/
private static boolean [] used;
public static int cnt(int a)
{
int res = 0;
while(a != 0)
{
a/=10;
res++;
}
return res;
}
public static int tenMult(int ... |
A20934 | A21794 | 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.File;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.Scanner;
public class Dance implements Runnable {
public void run(){
try {
Scanner in = new Scanner(new File("B-large.in"));
PrintWriter out = new PrintWriter(... |
B21790 | B20009 | 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.codejam.com;
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.io.PrintWriter;
import java.util.HashSet;
import java.util.StringTokenizer;
public class Solutio... |
B12669 | B10253 | 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.codejam.practice;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;
public class Recycled {
public static void main(String[] args) {
/... |
A13029 | A11065 | 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.IOException;
import java.io.InputStreamReader;
public class b {
public static void main(String[] args) throws IOException {
BufferedReader bd= new BufferedReader(new InputStreamReader(System.in));
int li= Integer.parseInt(bd.readLine());
for (int i = 1; i <=li; ... |
A20382 | A22572 | 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.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
import java.util.StringTokenizer;
import java.util.Vector;
public class Algorithm2 {
static final String input_path = "F://workspace//GoogleContest2012//... |
A21010 | A21086 | 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 _2012.QualificationRound.B;
import java.util.ArrayList;
import Utils.InputFile;
import Utils.OutputFile;
public class B {
private static void solve(InputFile inputFile, OutputFile outputFile){
int nbCases = Integer.parseInt(inputFile.getNextLine());
for(int caseNumber = 0; caseNumber < nb... |
B20291 | B21582 | 0 | import java.io.*;
import java.util.*;
class B
{
public static void main(String[] args)
{
try
{
BufferedReader br = new BufferedReader(new FileReader("B.in"));
PrintWriter pw = new PrintWriter(new FileWriter("B.out"));
int X = Integer.parseInt(br.readLine());
for(int i=0; i<X; i++)
{
String[]... | import java.io.*;
public class Palindrome
{
public static void main(String args[]) throws IOException
{
int N;
int a,b,i;
String s[];
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
N=Integer.parseInt(br.readLine());
for(i=1;i<=N;i... |
B10858 | B12627 | 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.IOException;
import java.util.List;
public class StoreCredit extends JamProblem {
public static void main(String[] args) throws IOException {
StoreCredit problem= new StoreCredit();
problem.go();
}
@Override
String solveCase(JamCase jamCase) {
StoreCreditCase cas... |
A12570 | A11836 | 0 | package util.graph;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
public class DynDjikstra {
public static State FindShortest(Node start, Node target) {
PriorityQueue<Node> openSet = new PriorityQueue<>();
Set<Node> closedSet = new HashSet<>();
openSet.add... | public class QualBDancingWithTheGooglers
{
static boolean debug = false;
public static void main(String[] args)
{
Utils.openInFile("B-small-attempt0.in");
Utils.openOutFile("out.txt", debug);
String input = Utils.readFromFile();
int lineCount = Integer.parseInt(input);
//while (... |
B12115 | B12698 | 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.FileNotFoundException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;
public class recycle {
static Scanner kb ;
public static void main(String[] args) throws FileNotFoundException {
// TODO Auto-generated method stub
PrintWriter out = new PrintWriter("answerrecyc... |
B10231 | B10198 | 0 | import java.io.*;
class code1
{
public static void main(String args[]) throws Exception
{
File ii = new File ("C-small-attempt1.in");
FileInputStream fis = new FileInputStream(ii);
BufferedReader br = new BufferedReader(new InputStreamReader (fis));
int cases = Integer.parseInt(br.readLine());
FileOutput... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication3;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.Scanner;
/**
*
* @author yondaime
*/
public class JavaApplicat... |
A21557 | A22119 | 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) ... |
public class Problem {
public int googlers;
public int surprisingTriplets;
public int bestResult;
public int[] totals;
public Problem(int googlers, int suprisingTriplets, int bestResult, int[] totals) {
super();
this.googlers = googlers;
this.surprisingTriplets = suprisingTriplets;
this.bestResult = be... |
A10996 | A10397 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
public class ProbB {
public static void main(String[] args) throws Exception {
FileReader fr = new FileReader("B-small-attempt0.in");
BufferedReader br = new BufferedReader(fr);
... |
A11135 | A11563 | 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 qualificationRound;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.util.Scanner;
public class B {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int ncases = sc.nextInt();
StringBuilder sb = new ... |
A10699 | A10358 | 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) ... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package solution;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Vector;
/**
*
* @author Aditya
*/
//A simple observation is... |
B12115 | B11085 | 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 fixjava;
/** Adapted from http://www.johndcook.com/standard_deviation.html */
public class RunningStats {
int n = 0;
double oldM, newM, oldS, newS, min, max;
public void clear() {
n = 0;
}
public void add(double x) {
n++;
// See Knuth TAOCP vol 2, 3rd edition, page 232
if (n == 1) {
oldM = ... |
B12085 | B10932 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | import java.util.Scanner;
public class C {
public static void output(int T, int recycles) {
System.out.print(String.format("Case #%d: ", T));
System.out.print(recycles);
System.out.println();
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.next... |
A10996 | A12714 | 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 google.codejam.dancingwithgooglers;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
public class Main {
public static void main(String[] args) throws Exception {
String[] files = {
"Data/B-small-attempt1"
};
for (int f = 0; f... |
A22771 | A23072 | 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.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
public class ProblemB {
static ArrayList<int[]> triples = new ArrayList<int[... |
B20734 | B21996 | 0 | package fixjava;
public class StringUtils {
/** Repeat the given string the requested number of times. */
public static String repeat(String str, int numTimes) {
StringBuilder buf = new StringBuilder(Math.max(0, str.length() * numTimes));
for (int i = 0; i < numTimes; i++)
buf.append(str);
return buf.toStr... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class Recycled {
static int no_Test_Cases =0; //number of test cases
static String input_Array[]; //to read inpu... |
A21010 | A22650 | 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.text.Format;
import java.util.Formatter;
import java.util.List;
import java.util.Set;
import java.util.HashSet;
import java.util.ArrayList;
import java.math.*;
public class Dancing {
static public String getContents(File aFile) {
//...checks on aFile are elided
Stri... |
A12113 | A11940 | 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 dancingWithGooglers;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;
public class InputFile
{
public ArrayList<String> readFile() throws Exception
{
File file = new File("C:\\Users\\Nikhil\\Desktop\\googleCodeJam\\B-small-attempt1.in");
Buff... |
B22190 | B21057 | 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.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
public class CodeJam2012C
{
public static void main(String [] args) throws FileNotFoundException
{
new CodeJam2012C().go();
}
public void go() throws FileNotFoundException
{
PrintWriter writer =... |
A12544 | A10353 | 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.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
public class Submission
{
public static final int numJudges = 3;
public static void main(String[] args)
{
try
{
BufferedReader in = ne... |
B12082 | B10264 | 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.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... |
B21049 | B20447 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
import java.io.*;
/**
*
* @author wijebandara
*/
public class RecycledNumbers {
public static void main(String[] args) throws FileNotFoundException, IOException {
//java.io.BufferedRead... |
B10149 | B13226 | 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 =... | import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Scanner;
public class A {
public static void main(String[] args){
Scanner in;
try{
in=new Scanner(new FileReader("A.in"));
int T=in.nextInt();
for(int tt=1;tt<=T;++tt){
int A=in.nextI... |
B10858 | B12237 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class recycled {
static int f_recycled(String s_min,String s_max){
int num_recycled=0;
int min=Integer.par... |
B10702 | B11786 | 0 | import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Recycle {
private static HashMap<Integer, HashSet<Integer>> map = new HashMap<Integer, HashSet<Integer>>();
private static HashSet<Integer> toSkip = new HashSet<Integer>();
/**
* @param args
*/
public static void main(S... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.List;
import ... |
B20023 | B21247 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
public class GoogleC {
public String szamol(String input){
String result="";
String... | package cl.rodrigo;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.AbstractList;
import java.util.A... |
B20856 | B20463 | 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;
//... | /*
GCJ2012-Q
*/
import java.io.*;
import java.util.*;
import java.math.*;
public class GCJ2012QC {
static BufferedReader fin;
static PrintWriter fout;
// change numefile
static String file="qcl";
static String infile=file+".in";
static String outfile=file+".out";
//
// write result to ou... |
B12941 | B10794 | 0 | package com.menzus.gcj._2012.qualification.c;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class CProcessorFactory extends AbstractProcessorFactory<CInput, COutputEntry> {
public CProcessorFactory(Str... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
public... |
B10485 | B11904 | 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 googleJam;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.HashSet;
import java.util.Scanner;
public class RecycledNumbers
{
public static void main(String[] args)
{
Scanner scan = null;
try
{
scan = new Scanner(new File(args[0]));
}
catch (FileNotFoundException e... |
B10858 | B11981 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| package recycledNumbers;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
public class OutputFile
{
public void writeFile(ArrayList<String> data) throws Exception
{
File file = new File("C:\\Users\\Nikhil\\Desktop\\googleCodeJam\\output.txt");
Buffere... |
A12460 | A10098 | 0 | /**
*
*/
package pandit.codejam;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Scanner;
/**
* @author Manu Ram Pandit
*
*/
public class DancingWithGoogle... | import java.util.*;
import java.io.*;
public class Dancing {
/**
* @param args
*/
public static void main(String[] args) throws IOException {
new Dancing().run();
}
Integer[] best = new Integer[31];
int best(int x) {
if (best[x] != null)
return best[x];
for (int l = 0; l <= Math.min(x, 8); l++) {
... |
A11135 | A11948 | 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.*;
import java.util.*;
import java.awt.Point;
import java.lang.Math;
class Case{
int num0,num1,num2,num3;
String result="";
public Case(File aFile) {
try{
StringBuilder contents = new StringBuilder();
BufferedReader input = new BufferedReader(new FileReader(aFile));
String line = input... |
A10793 | A11659 | 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) {
... |
/**
* Write a description of class dancing here.
*
* @author (your name)
* @version (a version number or a date)
*/
import java.io.*;
public class dancing
{
public static void main(String args[]) throws IOException
{
int tcase,ng,sur,max;
int i, j, m, x, y=0,s,flag=0,sum,best,counter;
... |
B20023 | B21619 | 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.util.*;
public class b {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
String ss = sc.nextLine();
int casenum = Integer.parseInt(ss);
String answer = "";
for(int i = 1;i<=casenum;i++){
answer = a... |
B11696 | B12268 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recycled;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class RecycledNumbers {
public static void main(String[] args) throws Exception{
char problem = 'C';
boolean smallCase = true;
boolean practice = false;
Bu... |
A11201 | A11479 | 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.... | package Qualification;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class DancingWithGooglers {
public static void main(String[] args) throws NumberFormatException,
IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
int... |
B21968 | B21397 | 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.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
public class ProblemC {
public static void main(String[] args) throws FileNotFoundException {
start();
}
public static void start() throws FileNotFoundException {
File fil... |
A12273 | A10057 | 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.... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package google.code.jam.dancing.with.the.googlers;
/**
*
* @author Lucas
*/
public class GoogleCodeJamDancingWithTheGooglers {
/**
* @param args the command line arguments
*/
public static void mai... |
B12669 | B11477 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package year_2012.qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.... | import java.io.File;
import java.util.HashMap;
import java.util.Scanner;
public class ProblemC {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
Scanner leitor = new Scanner(new File("problemC.in"));
int n = leitor.nextInt(); leitor.nextLine();
for (int caso = 0 ; caso <... |
B10231 | B12698 | 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.FileNotFoundException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;
public class recycle {
static Scanner kb ;
public static void main(String[] args) throws FileNotFoundException {
// TODO Auto-generated method stub
PrintWriter out = new PrintWriter("answerrecyc... |
B12570 | B12293 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | package com.gnooo;
import java.util.HashMap;
import java.util.Scanner;
public class Solution {
static final boolean DBG = false;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
long dStart = System.currentTimeMillis();
StringBuilder sb = new StringBuild... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.