F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
A11502 | A11538 | 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.*;
import java.io.*;
public class DanceGooglers{
public static void main(String[] args){
try{
FileReader fin = new FileReader(args[0]);
BufferedReader txtFile = new BufferedReader(fin);
//FileWriter fout = new FileWriter(args[1]);
//BufferedWriter out = new BufferedW... |
A22360 | A20424 | 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.FileNotFoundException;
import java.io.PrintWriter;
import java.util.*;
public class Dance {
private static int raw_num;
private static int pot_num;
public static void main(String[] args) throws FileNotFoundException{
Scanner in = new Scanner(System.in);
PrintWriter out = new PrintWriter("dance_ou... |
A20119 | A22238 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | import java.util.*;
import java.io.*;
public class GoogleB {
public static int doit(int s, int p, ArrayList<Integer> arr){
int count =0 ;
for (int i = 0; i < arr.size(); i++){
if ((p-1>=0 && arr.get(i) >= 2*(p-1) + p) || (arr.get(i) >= 3*p)){
count++;
arr.remove(i);
i--;
}
else if ((p-2 >= 0... |
A22078 | A21269 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
public class GooglersDancer {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated metho... | import java.io.*;
import java.util.*;
public class Main implements Runnable {
BufferedReader br;
StringTokenizer st;
int n, s, p, ans;
int[] t;
public class Googler implements Comparable<Googler> {
int total, a, b, c;
public Googler(int total) {
this.total = total;
a = total / 3;
... |
B12074 | B13133 | 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.util.Scanner;
public class Rec {
static Scanner sc =new Scanner(System.in);
public static void main (String [] args ) {
int n =sc.nextInt();
for (int m =1; m <= n; m++) handleCase(m);
}
public static int a,b;
static void handleCase(int num) {
int sum=0;
a =sc.nextInt();
b =sc.nextInt();
for (int i =a; i... |
B20566 | B21896 | 0 | import java.util.Scanner;
import java.io.*;
import java.lang.Math;
public class C{
public static int recycle(String str){
String[] numbers = str.split(" ");
int min = Integer.parseInt(numbers[0]);
int max = Integer.parseInt(numbers[1]);
int ret = 0;
for(int i = min; i < max; i++){
String num = i + "";
... | import java.io.*;
import java.util.Set;
import java.util.HashSet;
public class Recycler {
public static void main(String[] args)
throws IOException, FileNotFoundException {
StreamTokenizer st = new StreamTokenizer(
new FileReader(args[0]));
FileWriter out = new FileWriter(args[1]);
st.parseNumbers();
... |
A22078 | A22071 | 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 hk.polyu.cslhu.codejam.lib;
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.List;
import org.apache.log4j.Logger;
public class Fil... |
A11277 | A11154 | 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.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.PrintWriter;
public class DancingWiththeGooglers {
private static tripletOfScore[] triples;
private static void iniciarEscenario() {
triples=new tripletOfScore[31];
triples[0]=new t... |
A21010 | A21056 | 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.*;
public class ProblemB {
/*
* Takes an input file and output file as inputs.
*/
public static void main(String file[]) throws IOException{
BufferedReader in;
BufferedWriter out;
int numCases, numGooglers, numSurp, p, score;
Integer result;
... |
B12115 | B10722 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... | import java.util.Scanner;
import java.io.*;
public class Pair {
public static int a, b, l;
public static boolean inr(String x) {
int t = Integer.parseInt(x);
if ((t + "").length() != l) return false;
if (t <= b && t >= a) {
return true;
}
else return false;
}
public static String t... |
A20119 | A21058 | 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 org.nos.gcj;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.Calendar;
import java.util.StringTokenizer;
public class GCJ_Q_02 {
// static final String path = "F:/GCJ/GCJ_Qalification_02/Small_1";
static final String path ... |
B12762 | B11751 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.File;
import java.io.FileInputStream;
import java.util.Scanner;
/**
*
* @author imgps
*/
public class C {
public static void main(String args[]) throws Exception{
int A,B;
int ctr ... | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
public class CodeJamTextOutputWriter {
private final BufferedWriter writer;
CodeJamTextOutputWriter(File outputFile) throws IOException {
writer = new BufferedWriter(new FileWriter(outputFile));
}
publ... |
A20261 | A20171 | 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.*;
import java.util.StringTokenizer;
import java.lang.Math;
public class qualifycodejamB{
public static int surprisePVal(int score){
if(score < 4){
if(score == 0){
return 0;
}else if(score == 1){
return 1;
}else{
return 2;
}
}
double dscore = (double) score;
if((dscor... |
B21227 | B22142 | 0 | import java.util.HashSet;
import java.util.Scanner;
public class C {
static HashSet p = new HashSet();
static int low;
static int high;
int count = 0;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int no = sc.nextInt();
for (int i = 1; i <= no; i++) {
p.clear();
lo... |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author viswas
*/
public class Recycled {
pub... |
B20291 | B21629 | 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[]... | /*
* 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... |
B11327 | B11673 | 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.google.codejam;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class ApplicationRecycledNumbers {
public static final String fileName = "E:/Projects/RnD/GoogleCodeJam/s... |
A11135 | A10044 | 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.util.Scanner;
import java.util.ArrayList;
public class dancing {
public static void main(String [] args){
Scanner Keyboard = new Scanner(System.in);
int testCases;
ArrayList<String> input = new ArrayList<String>();
ArrayList<Integer> totalPoints = new ArrayList<Integer>();
int whitespaceNumber =... |
A12570 | A11275 | 0 | package util.graph;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
public class DynDjikstra {
public static State FindShortest(Node start, Node target) {
PriorityQueue<Node> openSet = new PriorityQueue<>();
Set<Node> closedSet = new HashSet<>();
openSet.add... | package GooglerDancing;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
public class GooglerDancing {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) ... |
B10155 | B10911 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
/**
*
* @author eblanco
*/
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
impo... | import java.io.*;
import java.util.*;
public class ProbC
{
public static void main(String[] args) throws FileNotFoundException, IOException
{
BufferedReader br = new BufferedReader(new FileReader("C-small-attempt0.in"));
int times = Integer.parseInt(br.readLine());
BufferedWriter wr = new BufferedWriter(new Fi... |
A10568 | A12452 | 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.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Arrays;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.TreeMap;
public class Gcj2 {
private static Map<Integer, ... |
A12460 | A10268 | 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.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class B {
static ArrayList<Triplet> surprising = new ArrayList<Triplet>();
static ArrayList<Triplet> nonSurprising = new ArrayList<Triplet>();
pub... |
B12082 | B12874 | 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 C {
public static void main(String[] args) {
new C().run();
}
BufferedReader br;
StringTokenizer st;
PrintWriter out;
boolean eof;
public void run() {
try {
// br = new BufferedReader(new InputStreamReader(System.in));
// out = new PrintWriter(System.... |
A22642 | A21882 | 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 static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.reverse;
import static java.lang.Integer.*;
import static java.lang.Long.parseLong;
import java.util.*;
import java.awt.geom.*;
import java.io.*;
//// Apache Jakarta Common Lang : http://commons.apache.org/lang/
//imp... |
B21790 | B21252 | 0 | import java.io.*;
import java.util.*;
public class C {
void solve() throws IOException {
in("C-large.in"); out("C-large.out");
long tm = System.currentTimeMillis();
boolean[] mask = new boolean[2000000];
int[] r = new int[10];
int t = readInt();
for (int cs = 1; cs... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Shell {
private static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
private static final String ERROR = "Error!";
private static final ... |
A12846 | A13018 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam.common;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Lance Chen
*/
public class CodeHelper {
private static String FILE_ROOT = "D:/workspace/googlecodejam/meta";
publi... | package com.google.codejam.googlers;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
/**
*
* Class to generate Test Report.
* @author Sushant Deshpande
*/
public class OutputRecorder {
/**
* Method for generating Test Report.
* @param te... |
B20856 | B21905 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Happy;
import java.io.*;
import java.math.*;
import java.lang.*;
import java.util.*;
import java.util.Arrays.*;
import java.io.BufferedReader;
//import java.io.IOException;
//import java.io.InputStreamReader;
//... | package com.dagova.recycledNumbers;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class RecycledNumbers
{
/**
* @param args
*/
public static void main(String[] args)
{
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));... |
B21207 | B22194 | 0 | /*
* Problem C. Recycled Numbers
*
* Do you ever become frustrated with television because you keep seeing the
* same things, recycled over and over again? Well I personally don't care about
* television, but I do sometimes feel that way about numbers.
*
* Let's say a pair of distinct positive integers (n, m) ... | package org.weiwei.recyclenumber;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
/**
* Created with IntelliJ IDEA.
* User: ding
* Date: 12-4-14
* Time: ä¸å1:57
* To change this template use File | Settings | File Templates.
*/
public class Fi... |
A11502 | A10045 | 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.*;
class B
{
public static void main(String args[]) throws FileNotFoundException
{
Scanner in = new Scanner(new File(args[0]));
int t;
t = Integer.parseInt(in.nextLine());
for (int i=0; i<t; i++)
{
int n = in.nextInt();
int s = in.nextInt();
int p = in.nextInt... |
B10702 | B11914 | 0 | import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Recycle {
private static HashMap<Integer, HashSet<Integer>> map = new HashMap<Integer, HashSet<Integer>>();
private static HashSet<Integer> toSkip = new HashSet<Integer>();
/**
* @param args
*/
public static void main(S... | package qualificationround;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class ProblemCRecycledNumbers {
@Sup... |
B21968 | B22070 | 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.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class ProblemC {
public static void main(String[] args) throws IOException {
new ProblemC();
}
private int numOfTest;
private static... |
B11421 | B12655 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Recycled {
public static void main(String[] args) throws Exception{
String inputFile = "C-small-attempt0.in... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.... |
B10149 | B12280 | 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.util.*;
import java.io.*;
import java.lang.Integer;
public class QuestionC
{
public static void main(String[] args) throws IOException
{
Scanner inPut = new Scanner(new File("C-small-attempt0.in"));
FileWriter fWriter = new FileWriter("C-small-attempt0.out");
int caseTota... |
B10858 | B13166 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| //input file must be in.txt in this directory
//output file will be out.txt
import java.io.*;
import java.util.*;
public class C
{
public static Scanner in;
public static PrintStream out;
public static void main(String [] args) throws Throwable
{
in = new Scanner(new File("in.txt"));
int cases = in.nextInt();
... |
B12941 | B10002 | 0 | package com.menzus.gcj._2012.qualification.c;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class CProcessorFactory extends AbstractProcessorFactory<CInput, COutputEntry> {
public CProcessorFactory(Str... | import java.io.*;
import java.util.*;
public class Qual3 {
private static Set<String> set = new HashSet<String>();
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(new File("C-small-attempt0.in"));
FileWriter fw = new FileWriter("C-output.txt");
int total = sc.nextInt();
f... |
A20934 | A21693 | 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.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class DancingWiththeGooglers
{
private static final String INPUT_FILE = "input.txt";
private static final String OUTPUT_FILE = "output.txt";
//but not surpisin... |
A11277 | A10588 | 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.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;
public class Main
{
public static void main(String[] args) throws Exception
{
Scanner sc=new Scanner(new FileInputStream(args[0]));
BufferedWr... |
A11135 | A11064 | 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.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Dancer {
public static void main (String [] args) throws Exception {
FileInputSt... |
B12570 | B12962 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | import java.util.*;
import java.io.*;
public class Solution {
public void doMain() throws Exception {
BufferedReader in = new BufferedReader(new FileReader("input.txt"));
PrintWriter pw = new PrintWriter(new FileWriter("output.txt"));
int CaseNumber = Integer.parseInt(in.readLine());
for (int cas=1; cas <... |
A11917 | A11614 | 0 | package com.silverduner.codejam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
public class Dancing {
public static void main(String[] args) throws Exception {
File input = new File("B-small-attempt... | import java.io.*;
public class ProbB
{
public static void main (String[] args) throws Exception
{
MyInputReader in = new MyInputReader(new FileInputStream("B-small-attempt2.in"));
PrintWriter pw = new PrintWriter("output.txt");
int T = in.nextInt();
for(int q=0; q<T; q++)
{
int n = in.nextInt();
int... |
A11502 | A10833 | 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 be.mokarea.gcj.common;
import java.io.PrintWriter;
public abstract class Transformation<T extends TestCase> {
private TestCaseReader<T> caseReader;
private final PrintWriter outputWriter;
public Transformation(TestCaseReader<T> caseReader, PrintWriter outputWriter) {
this.caseReader = caseReader;
this... |
B21049 | B21904 | 0 | package it.simone.google.code.jam2012;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumber implements GoogleCodeExercise {
int a = 0;
int b = 0;
Set<Couple> distinctCouple = null;
long maxTime = 0;
private class Couple {
int x = 0;
int y = 0;
public Couple(int x, int y) {
this... | package com.dagova.recycledNumbers;
import java.util.TreeSet;
public class RecycledNumbersSolver
{
private static int solution;
private static int aNumber;
private static int bNumber;
public static int solve(String line)
{
solution = 0;
String[] splittedLine = line.split(" ");
aNumber = Integer.parse... |
B10361 | B10751 | 0 | package codejam;
import java.util.*;
import java.io.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("in.txt"));
PrintWriter out = new PrintWriter(new File("out.txt"));
int T = Integer.parseInt(in.readLine());... | import java.util.HashSet;
import java.util.Scanner;
public class recycled {
public static void main(String[] args){
int t;
Scanner s = new Scanner(System.in);
t=s.nextInt();
for(int k=1;k<=t;k++){
int a,b;
a=s.nextInt();
b=s.nextInt();
int al=a/10,d=1;
while(al>0){
d++;
al/=10;
}
... |
B20566 | B20515 | 0 | import java.util.Scanner;
import java.io.*;
import java.lang.Math;
public class C{
public static int recycle(String str){
String[] numbers = str.split(" ");
int min = Integer.parseInt(numbers[0]);
int max = Integer.parseInt(numbers[1]);
int ret = 0;
for(int i = min; i < max; i++){
String num = i + "";
... | package recycledNumbers;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class RecycledNumbers {
public static String processaCaso(String linha, int i) {
String[] nums = linha.split... |
A13029 | A10152 | 0 | import java.util.List;
public class Case implements Runnable {
private int id;
private String output;
private int n;
private int s;
private int p;
private List<Integer> g;
public Case(int id) {
this.id = id;
}
public Case(int id, int n, int s, int p, List<Integer> g) {
super();
this.id = id;
this... | /**
*
*/
package kr.javanese.gcj2012.qr.b;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
/**
* @author javanese
*
*/
public class DancingWithTheGooglers {
private int findMax(int s, int p, int[] t) {
int n = t.length;
int[] tremaining = new int[t.length];
in... |
A22191 | A22418 | 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 googlecodejam;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Scanner;
public class GoogleCodeJam {
public static int calcGooglers(int p, int s, int[] g) {
int avg = p*3;
int n = g.length;
int cont = 0;
for (int i = 0... |
B12669 | B12498 | 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.*;import java.util.*;
public class Solution3
{
public static void main(String args[]) throws IOException
{
BufferedReader br=new BufferedReader(new FileReader("input.txt"));
PrintWriter pw=new PrintWriter(new BufferedWriter(new FileWriter("output.txt")));
int lines=Integer.parseInt(br.readL... |
A12570 | A10059 | 0 | package util.graph;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
public class DynDjikstra {
public static State FindShortest(Node start, Node target) {
PriorityQueue<Node> openSet = new PriorityQueue<>();
Set<Node> closedSet = new HashSet<>();
openSet.add... | package com.google.codejam;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class GoogleDance2 {
public static void main(String[] args) throws Exception {
Scanner in... |
B11327 | B11802 | 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 util;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author bohmd
*/
public class Util {
public static List<Integer> getIntList(String listString) {
String[] listArray = listString.... |
B10485 | B11661 | 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 qualification;
import java.io.*;
public class Csmall {
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new FileReader("./src/qualification/C-small-attempt0.in"));
BufferedWriter bw = new BufferedWriter(new FileWriter("./src/qualifi... |
A21396 | A22909 | 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 _2012.qualification;
import java.util.Scanner;
public class DancingWithTheGooglers {
public static void main(String[] args) {
Scanner consola = new Scanner(System.in);
int nGooglers, nSurprise, top, total, cont, times = consola.nextInt();
for(int t = 1; t <= times; t++){
nGooglers = consola.nextIn... |
B12074 | B11955 | 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 qual;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
public class Recycled {
public static void main(String[] args) throws IOException {
new Recycled().run();
}
class Pair {
int a, b;
Pair(int a, int b) {
this.a ... |
A10568 | A11540 | 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.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class ProblemB {
public static void main(String[] args) {
String output = "";
try {
// Open the file that is the firs... |
B12082 | B11247 | 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.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;
public class RecycledNums {
public static String rootDir = System.getProperty("user.dir") + File.separator;
public static ... |
A22191 | A21197 | 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 dancingWithTheGooglers;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class DancingWithTheGooglers {
public static void main(String[] args) {
F... |
A12544 | A13087 | 0 | package problem1;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Arrays;
public class Problem1 {
public static void main(String[] args) throws FileNotFoundException, IOException{
try {
TextIO... | import java.io.*;
import java.util.*;
class Triplet
{
public static void main (String [] args) throws IOException
{
BufferedReader in = new BufferedReader(new FileReader("B-small-attempt0.in"));
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("B-small-attempt0.out")));
StringTokenizer s... |
B20023 | B20530 | 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 gcj2012qual;
import java.io.*;
import java.util.*;
public class RecycleNum {
/**
* @param args
*/
HashMap<String, String> map = new HashMap<String, String>();
int totalpair(int start, int end){
int num = 0;
for(int i = start; i <= end; i++){
String s = String.valueOf(i);
//System.out.... |
B12941 | B11812 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Competitiopn;
import java.util.Scanner;
/**
*
* @author vidz
*/
public class RecycledNumbers {
public void solve() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
i... |
A10793 | A11212 | 0 | import java.io.*;
import java.math.*;
import java.util.*;
import java.text.*;
public class b {
public static void main(String[] args) {
Scanner sc = new Scanner(new BufferedInputStream(System.in));
int T = sc.nextInt();
for (int casenumber = 1; casenumber <= T; ++casenumber) {
... | import java.util.ArrayList;
public class DancingWG{
public static void main(String[] args){
ArrayList<String> inputs = IOGoogleCodeJam.fileInput(args[0]);
ArrayList<String> outputs= new ArrayList<String>();
int lines=Integer.parseInt(inputs.get(0));
for(int i=1;i<=lines;i++){
outputs.add(processData(inputs... |
B12074 | B13244 | 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.*;
import java.math.*;
//4/14/12 11:29 PM
//by Abrackadabra
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
if (args.length > 0 && args[0].equals("Abra")) debugMode = true;
new RecycledNumbers().run();
/*new Thre... |
B10858 | B12177 | 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.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.Scanner;
public class RecycledNumbers {
static Scanner sc;
public static void main(String a[]) throws FileNotFoundException
{
int n,i;
int res;
sc= new Scanner(n... |
B20734 | B21871 | 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.FileNotFoundException;
import java.io.FileReader;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Scanner;
public class RecycledNumbers {
public static int recycle(int source, int digits) {
int pow = (int) Math.pow(10, digits - 1);
int mod = source % 10;
... |
B12074 | B12616 | 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 util;
import java.math.BigInteger;
public class CombinationGenerator {
private int[] a;
private int n;
private int r;
private BigInteger numLeft;
private BigInteger total;
//------------
// Constructor
//------------
public CombinationGenerator (int n, int r) {
if (r > n) {
thro... |
A20382 | A22519 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... | import java.io.File;
import java.util.Scanner;
public class Dance {
public static void main(String[] args) throws Throwable {
Scanner scan = new Scanner(new File("dance.in"));
int t = Integer.parseInt(scan.nextLine());
for (int i = 1; i <= t; i++) {
String line = scan.nextLine();
Scanner token = new Sca... |
B12082 | B12968 | 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 codejam2012;
/**
*
* @author ESIEN
*/
public class C {
static int numOfDigits;
final static int max = 1001;
static int div;
static boolean[] found = new boolean[max];
... |
B11696 | B12661 | 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.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Hashtable;
public class MainJam2 {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOExc... |
B10702 | B12459 | 0 | import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Recycle {
private static HashMap<Integer, HashSet<Integer>> map = new HashMap<Integer, HashSet<Integer>>();
private static HashSet<Integer> toSkip = new HashSet<Integer>();
/**
* @param args
*/
public static void main(S... | package cg.y2012.Q3;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
public class Q3 {
/**
* @param args
*/
public static void main(String[] args) {
BufferedWrit... |
B12085 | B10498 | 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.*;
import java.io.*;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
scan.nextLine();
int c = 1;
while(scan.hasNextLine()) {
Scanner ls = new Scanner(scan.nextLine());
System.out.println("Case #" + c++ + ": " + process(ls.nextInt(), ls... |
B12115 | B12454 | 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.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader bfr = new BufferedReader(
new InputStreamReader(System.in));
PrintWriter pr = new PrintWriter(System.out);
int n = Integer.parseInt(bfr.readLine());
for (int i = 1; i <= n; i++) {
... |
B12570 | B12549 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | import java.io.*;
import java.util.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine());
for(int z=0; z<t; z++) {
StringToken... |
B10231 | B10451 | 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 MyAllgoritmicLib;
public class BinnomNeutona {
public static int C(int k, int n){
return factorial(n)/(factorial(k)*factorial(n-k));
}
public static int factorial(int n){
int result = 1;
for(int i = n; i > 1; i--){
result *= i;
}
return result;
}
}
|
A21557 | A22783 | 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) ... | package google.contest.C;
import google.loader.Challenge;
import google.problems.AbstractReader;
public class CReader extends AbstractReader {
@Override
protected Challenge createChallenge(int number) {
int theLine = getActualLine();
String[] lines = getLines();
CChallenge chal = new CChallenge(number, lines... |
A22078 | A22694 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
public class GooglersDancer {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated metho... | package google.codejam;
public interface GoogleSolver {
String solve(String str);
}
|
A10996 | A11675 | 0 | import java.util.Scanner;
import java.io.*;
class dance
{
public static void main (String[] args) throws IOException
{
File inputData = new File("B-small-attempt0.in");
File outputData= new File("Boutput.txt");
Scanner scan = new Scanner( inputData );
PrintStream print= new PrintStream(outputData);
... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package jam_b;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection... |
B13196 | B13088 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Q3M {
public static void main(String[] args) throws Exception {
compute();
}
private ... | import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Scanner;
import javax.management.RuntimeErrorException;
public class C {
public static void main(String[] args) throws FileNotFoundException {... |
A10793 | A11819 | 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) {
... |
class Triplets
{
int oldscore[] = new int[3];
int score[] = new int[3];
int totalScore;
int first, second;
public Triplets(int a, int b, int c)
{
oldscore[0] = score[0] = a;
oldscore[1] = score[1] = b;
oldscore[2] = score[2] = c;
totalScore = a + b + c;
}
public void display()
{
System.ou... |
A12846 | A11335 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam.common;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Lance Chen
*/
public class CodeHelper {
private static String FILE_ROOT = "D:/workspace/googlecodejam/meta";
publi... | import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Dancing_with_the_googlers {
public static int s;
public static int max(int x, int s, final int sMax, int p) {
int tmp, i = 0, mm = 0, maxx = 0... |
A22378 | A21981 | 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.File;
import java.util.Scanner;
public class DancingGooglers {
public static void calculate(File file){
String output="";
int cases = 0;
String singleLine = "";
try{
Scanner scanner = new Scanner(file);
cases = Integer.parseInt(scanner.nextLine());
int []result = new int[cases];
... |
B11318 | B10394 | 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.IOException;
import java.io.InputStreamReader;
public class SmallMain
{
public static void main( String arg[] )
throws IOException
{
BufferedReader reader = new BufferedReader( new InputStreamReader( System.in ) );
String line = null;
int test = 0;
int testC... |
B12115 | B12011 | 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.*;
public class C
{
public static void main(String[] args)
{
new C(new Scanner(System.in));
}
ArrayList<Integer> makeNice(int v)
{
ArrayList<Integer> vs = new ArrayList<Integer>();
while (v > 0)
{
vs.add(v%10);
v = v/10;
}
return ... |
A22078 | A20265 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
public class GooglersDancer {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated metho... | import java.io.File;
import java.io.PrintWriter;
import java.util.Scanner;
public class B {
int ref;
int[] scores = new int[3];
int max1=0;
int max2=0;
public B(int ref, int suma) {
super();
this.ref = ref;
scores[0] = suma/3;
suma-=scores[0];
scores[1] = suma/2;
scores[2] = suma-scores[1... |
A11135 | A11799 | 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 codejam;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
public class Googler
{
public static void main(String[] args) throws Exception
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int i =1;
int n = I... |
B12082 | B12778 | 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.StringReader;
public class Puzzle3 {
public static String parseString(int q, String A) {
String tmp = A.substring(q+1, A.length()) + A.substring(0,q+1);
return tmp;
}
public static boolean isReclycled(String A, ... |
A12113 | A10290 | 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 common;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.net.MalformedURLException;
import java.net.URL;
import protocols.ConfigurableStreamHandlerF... |
A12211 | A12955 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class Dancing_improved {
static int f_Superan_limites(String params){
int superan_limite=0;
String[] para... | import java.io.BufferedReader;
import java.io.IOException;
import java.util.ArrayList;
public class TestCaseReader {
public ArrayList<String> read(BufferedReader r) throws NumberFormatException, IOException
{
ArrayList<String> s = new ArrayList<String>();
int n = Integer.parseInt(r.readLine());
for (int i =... |
B10485 | B12901 | 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 qualr2012.problemC;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.logging.Logger;
import org.apache.commons.io.FileUtils;
import org.springframework.util.Assert;
public class RecycledNumbers {
static L... |
B12085 | B11714 | 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.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
public class Counter {
private int T;
private Lock lock;
private ICounterZeroEvent e;
public Counter(int T, ICounterZeroEvent e)
{
this.T = T;
this.e = e;
lock = new ReentrantLock();
}
public void increase() ... |
A12273 | A11319 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Dancing
* Jason Bradley Nel
* 16287398
*/
import java.io.*;
public class Dancing {
public static void main(String[] args) {
In input = new In("input.txt");
int T = Integer.parseInt(input.... |
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
/*
* To change this template, choose Tools | Templates and open the template in
* the editor.
*/
/**
*
* @author Anuj
*/
public class DanceWithGoogle {
int cases;
... |
B10858 | B12267 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| package cats;
import java.io.*;
import java.util.ArrayList;
public class Main {
public Main() throws Exception{
FileReader fr = new FileReader(new File("input.txt"));
BufferedReader in = new BufferedReader(fr);
File outFile = new File("output.txt");
outFile.createNewFile();
FileWriter fw = new FileWrite... |
B13196 | B10286 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Q3M {
public static void main(String[] args) throws Exception {
compute();
}
private ... | package Qualification;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.LinkedList;
import java.util.Scanner;
public class ProblemC {
// brute force approach
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(System.in);
St... |
A21396 | A21778 | 0 | import java.util.*;
public class Test {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int i = 1; i<=T; i++) {
int n = in.nextInt();
int s = in.nextInt();
int p = in.nextInt();
int result = 0;
for(int j = 0; j<n; j++){
... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication6;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
/**
*
* @author ucho
*... |
B10361 | B10159 | 0 | package codejam;
import java.util.*;
import java.io.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("in.txt"));
PrintWriter out = new PrintWriter(new File("out.txt"));
int T = Integer.parseInt(in.readLine());... |
import java.util.*;
import java.io.*;
public class CodeJam {
public static void main (String[] args){
try{
//recycleLarge(1000000, 2000000);
// read
FileInputStream instream = new FileInputStream("A-small.in");
DataInputStream in = new DataInputStream(instream);
Buffer... |
A22378 | A22541 | 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.FileNotFoundException;
import java.io.FileReader;
import java.util.Iterator;
import java.util.Scanner;
public class DancingWithGooglers {
public static class Scores {
public final int S;
public final int p;
public final int[] t;
public Scores(int S, int p, int[] t) ... |
A22771 | A21819 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package dancinggooglers;
import java.io.*;
/**
*
* @author Ruben
*/
public class DancingGooglers {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
... |
B20734 | B22158 | 0 | package fixjava;
public class StringUtils {
/** Repeat the given string the requested number of times. */
public static String repeat(String str, int numTimes) {
StringBuilder buf = new StringBuilder(Math.max(0, str.length() * numTimes));
for (int i = 0; i < numTimes; i++)
buf.append(str);
return buf.toStr... | package com.vp.impl;
import java.util.HashSet;
import java.util.Set;
import com.vp.iface.Problem;
public class RecycledNumbers implements Problem {
private static int iUpperLimit;
private static int iLowerLimit;
private static int[] iVisited;
private static Set <String> removeDuplicates;
@Override
public St... |
A10699 | A12679 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Dancing {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) ... | import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
public class CodeJamQ2 {
public static String[] read(final String name) throws IOException {
final InputStreamReader reader = new FileReader(new File(name));
final char[]... |
B11421 | B11487 | 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.File;
import java.util.HashSet;
import java.util.Scanner;
public class recyle {
public static int solve(String s) {
String[] input = s.split(" ");
String a = input[0];
String b = input[1];
if (a.length() != b.length()) return 0;
if (Integer.parseInt(b) <= 10) return 0;
int r... |
A22360 | A20187 | 0 | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Scanner;
public class Dancing_With_the_Googlers {
/**
* The first line of the input gives the ... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
public class Main {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new FileReader(args[0]));
br.readLine();
int c = 1;
... |
A11201 | A10868 | 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.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Collections;
import java.util.HashMap;
public class tongue {
static HashMap<Str... |
A11201 | A11486 | 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.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class Dancing {
public static void main(String[] args) throws IOException {
int count = 0;
int special = 0;
int googler = 0;
int best = 0;
int sp_co = 0;
int sat = 0;
... |
A22771 | A20041 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.*;
import java.util.*;
/**
*
* @author Maleen
*/
public class B {
public static void main(String[] args) throws FileNotFoundException, IOException {
Scanner sc = new Scanner(new File("in/B.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.