F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
A13029 | A11190 | 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.*;
import java.util.*;
public class B {
public static int a [];
public static void main(String[] args) throws Exception{
int N = 100;
a = new int[N];
File f = new File("B-small-attempt0.in");
Scanner sc = new Scanner(f);
int t = sc.nextInt();
BufferedWriter bw = new BufferedWriter(new FileW... |
A20934 | A20180 | 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.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class B {
public void solve( Scanner sc, PrintWriter pw ) {
int tests = sc.nextInt( ); sc.nextLine( );
for ( int i = 0 ; i < tests; i++ ) {
in... |
B12115 | B10109 | 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.*;
class pqr
{
public static void main(String arf[])
{
int a;
Scanner sc=new Scanner(System.in);
a=sc.nextInt();
int m=1;
while(a!=0)
{
int p=sc.nextInt();
int q=sc.nextInt();
int max=0;//the answer
for(int i=p;i<=q;i++)
{
int count=0;
int z=i;
... |
A22992 | A22345 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author dannocz
*/
public class InputReader {
public static Input r... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.Arrays;
public class Dancing {
/**
*... |
A13029 | A10667 | 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.*;
import java.io.*;
import java.lang.*;
class DancingGooglers {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = Integer.parseInt(sc.nextLine());
for (int i=0; i<T; i++) {
String[] dat = sc.nextLine().split(" ");
int N = Integer.parse... |
A11201 | A12874 | 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 er.dream.codejam.helpers;
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.List;
public class FileHandler {
BufferedReader read;
BufferedWriter write;
public File[] listFi... |
A10699 | A12473 | 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.util.Scanner;
import java.util.Arrays;
import java.io.File;
public class Dancing {
public static void main (String[] args) {
Scanner sc = null;
try {
sc = new Scanner(new File("input.txt"));
} catch (Exception e) {}
int N, S, p, result;
int[] t;
String out;
int T = sc.nextInt();
sc.next... |
B12669 | B12817 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package year_2012.qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.... | import java.util.HashSet;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner r = new Scanner(System.in);
int T = r.nextInt();
int caseNumber = 1;
while(T-- > 0){
int A = r.nextInt();
int B = r.nextInt();
int ret = 0;
for(int x = A; x <= B; x++){
... |
B21207 | B21328 | 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 net.jbirch.gcj12qual;
import java.io.FileNotFoundException;
import java.util.Scanner;
import net.jbirch.gcj12qual.util.FileLoader;
/**
*
* @author Birch
*/
public class C implements Runnable {
protected FileLoader inFile;
protected Scanner in;
/**
* @param args the command line arguments... |
A12570 | A11673 | 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 problem2;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class Bsmall implements Runnable {
private fin... |
A22191 | A20069 | 0 | package com.example;
import java.io.IOException;
import java.util.List;
public class ProblemB {
enum Result {
INSUFFICIENT,
SUFFICIENT,
SUFFICIENT_WHEN_SURPRISING
}
public static void main(String[] a) throws IOException {
List<String> lines = FileUtil.getLines("/B-large.in");
int cases = Int... | import java.io.*;
import java.util.*;
public class Dancing {
static void solve() throws IOException {
int T = nextInt();
for(int c = 1; c <= T; c++) {
int N = nextInt();
int S = nextInt();
int P = nextInt();
int[] sc = new int[N];
for(int i = 0; i < sc.length; i++)
sc[i] = nextInt();
Arrays.... |
B12762 | B12059 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.File;
import java.io.FileInputStream;
import java.util.Scanner;
/**
*
* @author imgps
*/
public class C {
public static void main(String args[]) throws Exception{
int A,B;
int ctr ... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
/**
*
* @author... |
A12273 | A10661 | 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.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Scanner;
public class B {
static String CASE = "Case #";
static String N_L = System.getProperty("line.separator");
static int T, N, S, p;
publ... |
A12273 | A10333 | 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.io.IOException;
public class DancingGooglers {
public static String readFile(String nombreArchivo) throws Exception {
String aux = "";
String contenido = "";
BufferedReader bf = new... |
A22992 | A20530 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author dannocz
*/
public class InputReader {
public static Input r... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
static int N,S,p;
static int t[];
static int solve() {
int i,j,k;
int a,b,c;
int opt[][] = new int[N+1][S+1];
boolean canMakeOne, goodScoreCase... |
A21557 | A21920 | 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 googler;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Main {
public static void main(String[] args) throws I... |
A11135 | A10746 | 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;
public class Googlers {
static int T = 0;
public static void main(String[] args) {
Googlers c = new Googlers();
c.parseInp... |
B12074 | B12992 | 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 mgg.utils;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
/**
* @author manolo
* @date 13/04/12
*/
public class FileUtil {
FileReader reader;
FileWriter writer;
public FileUtil(String input, String output) {
try {
reader = ... |
B13196 | B12856 | 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.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashSet;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) throws Numbe... |
A12570 | A11507 | 0 | package util.graph;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
public class DynDjikstra {
public static State FindShortest(Node start, Node target) {
PriorityQueue<Node> openSet = new PriorityQueue<>();
Set<Node> closedSet = new HashSet<>();
openSet.add... | package DancingWithGooglers;
public class Googler implements Comparable {
/**
* @param args
*/
private int base;
private int remainder;
private int max;
private int total;
private boolean mayBeSurprising;
public Googler(int score){
total = score;
remainder = score %3 ;
base = (score - remainder) /3... |
B12941 | B10111 | 0 | package com.menzus.gcj._2012.qualification.c;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class CProcessorFactory extends AbstractProcessorFactory<CInput, COutputEntry> {
public CProcessorFactory(Str... | import java.util.Scanner;
public class Problem3 {
public Problem3(){
Scanner in = new Scanner(System.in);
int inputs = in.nextInt();
for(int i=0; i<inputs; i++){
int A = in.nextInt();
int B = in.nextInt();
int pairs = calc(A,B);
System.out.println("Case #"+(i+1)+": "+pairs);
}
}
public int ca... |
B10702 | B10635 | 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... |
///REMOVE ALL OUTPUT AND USE STRINGTOKENIZER!
/*
ID: mfranzs1
LANG: JAVA
TASK: RecycledNumbers
*/
import java.io.*;
import java.util.*;
public class RecycledNumbers {
static BufferedReader f;
public static void main (String [] args) throws IOException {
long unixTime = System.currentTimeMillis();
// Use Buff... |
A11502 | A12800 | 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... | /**
* B.java
* @author Joel C. Soares
*/
import java.util.Scanner;
import java.util.LinkedList;
import java.util.Collections;
class Googlers implements Comparable<Googlers>
{
int n1, n2, n3;
int restando;
Googlers( int a, int b, int c, int r)
{
n1 = a; n2 = b; n3 = c; restando = r;
}
public int compar... |
B21227 | B20718 | 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 midnighter.googlejam.y2012;
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 QualificationC
{
static final String inFileName = "inputs/C-large.in";
static final String outFileName = "ou... |
B12115 | B11733 | 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 Main {
public static void main(String args[]) {
(new Main()).solve();
}
void solve() {
Scanner cin = new Scanner(System.in);
int T = cin.nextInt();
for(int C=1; C<=T; ++C) {
int A = cin.nextInt();
int B = cin.nextInt();
int n = ("" + A).len... |
B10231 | B11918 | 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.IOException;
import java.util.InputMismatchException;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.FileInputStream;
import java.io.Writer;
import java.math.BigInteger;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual sol... |
B10155 | B11273 | 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 google.jam.code;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* @author walir
*
*/
public class RecycledNumbers {
private BufferedReader bufferedReade... |
A11502 | A12073 | 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 com.renoux.gael.codejam.utils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.net.URISyntaxException;
import java.net.URL;
/**
* Pour tests unitaires
*
* @author renouxg
*/
public fin... |
B20424 | B21314 | 0 | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
// static int MAX = 10000;
static int MAX = 2000000;
static Object[] All = new Object[MAX+1];
static int size( int x ) {
if(x>999999) return 7;
if(x>99999) return 6;
if(x>9999) return 5;
if(x>999) retu... | package 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... |
A12211 | A12006 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class Dancing_improved {
static int f_Superan_limites(String params){
int superan_limite=0;
String[] para... | package com.utility;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
public class FileWriterUtility {
public static File getFile(String outputFileLoc) {
File outputFile = null;
if (outputFileLoc != null) {
outputFile = new File(outputFileLoc);
if... |
B21049 | B22023 | 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 c;
import java.io.*;
import java.util.*;
public class Main {
public static void main(String args[]) throws IOException{
BufferedReader in = new BufferedReader(new FileReader("C.in"));
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("C.out")));
int T = Int... |
A12273 | A12936 | 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 codejam2012;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.Scanner;
public class QualB {
public static void main(String[] args) throws FileNotFoundException {
Scanner in = new Scanner(... |
B12074 | B12355 | 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 com.wonyoung.codejam.qualificationround;
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 RecycledNumbers {
private Integer testCasesT;
private Recy... |
B12669 | B11153 | 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 QualificationRound;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
public class RecycledNumbers {
public static void main(String[] args) throws Exception {
System.setIn(new FileInputStream("recyclednumbers.in"));
System.setOu... |
A13029 | A12503 | 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.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class DancingWithTheGooglers {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws... |
A22992 | A21958 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author dannocz
*/
public class InputReader {
public static Input r... | import java.io.*;
import java.util.InputMismatchException;
public class qualifierQ2 {
public static void main(String[] args) throws FileNotFoundException {
PrintStream printStream = null;
File file = null;
try {
if (Boolean.getBoolean("toFile")) {
file = new Fil... |
B10485 | B12289 | 0 |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class Recycle
{
public static void main(String[] args)
{
/* Set<Integer> perms = getPermutations(123456);
for(Integer i: p... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumbers {
int noOfTestCases = 0;
int[][] testData;
public static void main ( String[] args ) {
String fileName = "problemc.sample.in";
if ( args.l... |
A12846 | A11257 | 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 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... |
B22190 | B20612 | 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.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
class Main
{
static int p[] =
{
1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000... |
B12941 | B11263 | 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 codejam;
import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.PrintStream;
import java.util.HashSet;
public class _Q_C {
public static void main(String[] args) throws Exception {
String input_file = "C-small-attempt0.in";
String output_file = "_Q_C_sma... |
A12273 | A11886 | 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.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class ProblemB {
public static void main(String [] args){
doIt();
}
public static void doIt(){
... |
A20119 | A22950 | 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 codejam2;
import java.io.*;
import java.util.Hashtable;
import java.util.logging.Level;
import java.util.logging.Logger;
class FileReader
{
int T;
FileInputStream fstream;
DataInputStream in;
BufferedReader br;
FileReader()
{
try
{
fstream = new FileInputSt... |
A21010 | A21249 | 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.*;
import java.io.*;
public class q2 {
/**
* @param args
*/
public static void main(String[] args) {
File file = new File("C:/Users/Raja/workspace/GCJ/src/in.txt");
int N,S,p;
int[] sums;
int norm,surp,ans;
try{
Scanner s = new Scanner(file);
int num = Integer.parseInt(... |
A22992 | A20648 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author dannocz
*/
public class InputReader {
public static Input r... | import java.io.FileReader;
import java.io.LineNumberReader;
import java.io.PrintWriter;
import java.util.Scanner;
public class go2 {
public static final String IN_FILE = "B-large.in";
public static final String OUT_FILE = "out.txt";
public static void main(String[] args) throws Throwable {
try ... |
B12082 | B12463 | 0 | package jp.funnything.competition.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.apache.commons.io.IOUtils;
public class QuestionReader {
pr... | package reusable;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
public abstract class CodeJamBase {
private final List<String> inputLines;
private final String filename;
private int testCases;
... |
A12846 | A11057 | 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.PrintStream;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
/**
* @author Mark Devine
*
*/
public class B {
static final boolean DEBUG = false;
static Scanner in;
static PrintStream out;
public static v... |
B13196 | B12057 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
public class g {
public static int go(... |
A22360 | A21442 | 0 | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Scanner;
public class Dancing_With_the_Googlers {
/**
* The first line of the input gives the ... | import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;
public class GCJ_2 {
/**
* @param args
*/
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int T = scan.nextInt();
scan.nextLine();
int nCase = 1;
while (T-- > 0) {
int N =... |
A20730 | A22799 | 0 | import java.util.Scanner;
public class B {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int zz = 1; zz <= T;zz++){
int N = in.nextInt();
int S = in.nextInt();
int p = in.nextInt();
int x = 0;
for(int i = 0; i < N;i++){
int score = in.n... | package dancing.with.the.googlers;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.URISyntaxException;
import java.util.Scanner;
public class DancingWithTheGooglers {
private static String INPUT_F... |
A10568 | A10578 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader (new... | package codejam2012.qualification.b;
public final class Triplet {
public final int a;
public final int b;
public final int c;
public final int total;
public final boolean surprising;
private Triplet(int a, int b, int c, int total) {
this.a = a;
this.b = b;
this.c = c;
... |
B12570 | B11781 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Arrays;
import java.util.Hashtable;
/**
* Input
* @author jiptan
*
*/
public class SolveC {
static int isRecycledNum(char[] val, int n, int a, int b) {
int ... |
A12113 | A10893 | 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 utils;
/**
*
* @author Fabien Renaud
*/
public abstract class JamCase implements Runnable, JamCaseSolver {
protected final int number;
protected String result;
private final StopWatch timer;
private final Jam parent;
protected JamCase(Jam parent, int number) {
this.parent = parent;
this.... |
B10702 | B11645 | 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 com.jp.common;
import java.util.HashMap;
import com.codejam.two12.GooglerDance.GooglerDance;
import com.codejam.two12.RecyledNumbers.RecycledNumbers;
import com.codejam.two12.tongue.SpeakingTongues;
import com.jp.storeCredit.StoreCredit;
public class PuzzleFactory {
public static Puzzle getPuzzleSolutio... |
B10231 | B10109 | 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.*;
class pqr
{
public static void main(String arf[])
{
int a;
Scanner sc=new Scanner(System.in);
a=sc.nextInt();
int m=1;
while(a!=0)
{
int p=sc.nextInt();
int q=sc.nextInt();
int max=0;//the answer
for(int i=p;i<=q;i++)
{
int count=0;
int z=i;
... |
A22771 | A21745 | 0 | package com.menzus.gcj._2012.qualification.b;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class BProcessorFactory extends AbstractProcessorFactory<BInput, BOutputEntry> {
public BProcessorFactory(Str... | package googlers;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Main {
public static int calcWIS(int n){
if(n - 2 < 0)
return 0;
return ((n - 2) / 3) + 2;
}
public static int calcWOS(int n){
if(n - 1 < 0)
return 0;
return ((n - 1) / 3) + 1;
}
... |
A12273 | A12691 | 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.File;
import java.io.FileReader;
import java.io.PrintStream;
public class Solver {
protected final static String IN_FILE = "in";
protected final static String OUT_FILE = "out";
protected final static String OUT_PREFIX = "Case #$: ";
protected BufferedReader in;
pro... |
A21396 | A22637 | 0 | import java.util.*;
public class Test {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int i = 1; i<=T; i++) {
int n = in.nextInt();
int s = in.nextInt();
int p = in.nextInt();
int result = 0;
for(int j = 0; j<n; j++){
... | import java.io.File;
import java.io.PrintWriter;
import java.util.Scanner;
public class QualB {
/**
* @param args
*/
public static void main(String[] args)throws Exception {
Scanner sc = new Scanner(new File("E:/inp.txt"));
PrintWriter pr = new PrintWriter(new File("E:/out.txt"));
int tc=sc.nextInt();
... |
B10858 | B13144 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
public class Principal {
public static void main(String[] args) {
Reader reader = new Reader();
Case[] cases = reader.read();
try {
File file = new File("out.txt");
file.delete();
Buffered... |
B10231 | B11684 | 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 uk.co.epii.codejam.recyclednumbers;
/**
*
* @author jim
*/
public class DataRow {
public final int A;
public final int B;
public DataRow(String in) {
String[] parts = in.split(" ");
... |
B21270 | B20614 | 0 | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
public class CopyOfCopyOfMain {
static int ndigits(int n) {
return (int) (Math.log10(n) + 1);
}
static i... | package Test1;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Test1 {
public static void main(String[] args) {
String temp1 = null;
String temp2 = null;
int n,a,b;
BufferedReader in = new BufferedReader(new InputStreamReader(System.in)) ;
try {
String str... |
B12762 | B12183 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.File;
import java.io.FileInputStream;
import java.util.Scanner;
/**
*
* @author imgps
*/
public class C {
public static void main(String args[]) throws Exception{
int A,B;
int ctr ... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
public class Run3 {
public ArrayList<String> read(String name){
ArrayList<String> data=new ArrayList<String>();
try{
BufferedReader br = new BufferedRe... |
B11361 | B10556 | 0 | import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
public class C{
Scanner sc=new Scanner(System.in);
int INF=1<<28;
double EPS=1e-9;
int caze, T;
int A, B;
void run(){
T=sc.n... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package googl2;
/**
*
* @author Mimo
*/
import java.io.*;
import java.util.Scanner;
public class Googl2 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) thro... |
A10793 | A13003 | 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 codejam;
public class Dancer extends CodeJam{
public Dancer() {
super("B-small-attempt0");
}
public static void main(String[] args) {
new Dancer().run();
}
@Override
protected String solve() {
int n = scanner.nextInt();
int s = scanner.nextInt();
... |
B21227 | B20050 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package googlejam;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
/**
*
* @author AEK
*/
public class Problem_C_small {
... |
B11421 | B13090 | 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.ArrayList;
import java.util.Formatter;
import java.util.List;
import java.util.Scanner;
public class recycled {
static int A;
static int B;
static int count=0;
static int n;
private static Scanner x;
private static Formatter y;
static String newline = System.getProperty... |
A21557 | A21528 | 0 | import java.io.*;
import java.util.*;
public class DancingWithGooglers {
public static class Googlers {
public int T;
public int surp;
public boolean surprising;
public boolean pSurprising;
public boolean antiSurprising;
public boolean pAntiSurprising;
public Googlers(int T, int surp) ... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.StringTokenizer;
public class Cj2012_qr_b_java... |
B10485 | B10678 | 0 |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class Recycle
{
public static void main(String[] args)
{
/* Set<Integer> perms = getPermutations(123456);
for(Integer i: p... | import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;
public class recycled_numbers
{
public static class Test
{
int a;
int b;
String a_str;
String b_str;
}
public static boolean contains(ArrayList<Tuple> a,Tuple tuple)
{
boolean contain=fal... |
A20934 | A22866 | 0 | import java.util.*;
public class B {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
B th = new B();
for (int i = 0; i < T; i++) {
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt()... | import java.io.*;
import java.util.ArrayList;
import java.util.Scanner;
public class QualificationRoundB {
public static void main(String[] args) throws IOException {
String inFile = args[0];
String outFile = inFile.replaceAll("\\.in$", ".out");
Scanner scanner = new Scanner(new FileInputS... |
A20382 | A22637 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... | import java.io.File;
import java.io.PrintWriter;
import java.util.Scanner;
public class QualB {
/**
* @param args
*/
public static void main(String[] args)throws Exception {
Scanner sc = new Scanner(new File("E:/inp.txt"));
PrintWriter pr = new PrintWriter(new File("E:/out.txt"));
int tc=sc.nextInt();
... |
B11421 | B10316 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Recycled {
public static void main(String[] args) throws Exception{
String inputFile = "C-small-attempt0.in... | package ProblemC;
import java.io.*;
import java.util.StringTokenizer;
public class RecycledNums {
/**
* @param args
*/
public RecycledNums(){
}
public static void recycledNums() throws IOException{
BufferedReader rdr = new BufferedReader(new FileReader("C-small-attempt0.in"));
PrintWriter ... |
B12085 | B10879 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | package de.at.codejam.util;
public class TaskStatus implements CodeJamConstants {
public static final int STATUS_WAITING = 0;
public static final int STATUS_RUNNING = 1;
public static final int STATUS_DONE = 2;
public static final int STATUS_ERROR = 3;
private int currentTaskStatus = STATUS_WAITING;
private i... |
A22360 | A20288 | 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 ... | package com.palantir;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Googlers {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int numTests = s.nextInt();
for (int i = 1; i <= numTests; ++i) {
System.out.p... |
A12273 | A12203 | 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.*;
class Programa
{
static boolean alcanza2(int a,int b)
{
int j1=0,j2=0,j3=0;
for (int i=0;i<=30;i++)
{
if (i+(i+2)+(i+2)==a)
{
j1=i;
j2=i+2;
j3=i+2;
}
if (i+i+(i+2)==a)
{
j1=i;
j2=i+2;
j3=i;
}
if (i+(i+1)+(i+2)==a)
... |
B20424 | B20216 | 0 | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
// static int MAX = 10000;
static int MAX = 2000000;
static Object[] All = new Object[MAX+1];
static int size( int x ) {
if(x>999999) return 7;
if(x>99999) return 6;
if(x>9999) return 5;
if(x>999) retu... | package qualifs;
import gcj.Gcj;
import java.util.HashSet;
import java.util.Set;
public class C {
final private String file;
C (String f) {
file = f;
}
public void run() {
Gcj gcj = new Gcj(file);
gcj.readLine();
int ncase = gcj.iToken();
for (int cas=1 ; cas <= ncase ; cas++) {
gcj... |
B11318 | B10468 | 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 CodeJam2012;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.StringTokenizer;
public class RecycledNumbers {
public static void main(String[] ... |
B10361 | B10133 | 0 | package codejam;
import java.util.*;
import java.io.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("in.txt"));
PrintWriter out = new PrintWriter(new File("out.txt"));
int T = Integer.parseInt(in.readLine());... | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
public class Main {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// T... |
A12846 | A10343 | 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.dten.cj.qual;
import static java.lang.Integer.parseInt;
import static java.lang.Math.max;
import static java.lang.Math.min;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.commo... |
B12570 | B11117 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class RecycleSolution {
/**
* @param args
*/
public static void main(String[] args) {
String inFilename = "C-small-attempt0.in";
String outFil... |
A21557 | A20551 | 0 | import java.io.*;
import java.util.*;
public class DancingWithGooglers {
public static class Googlers {
public int T;
public int surp;
public boolean surprising;
public boolean pSurprising;
public boolean antiSurprising;
public boolean pAntiSurprising;
public Googlers(int T, int surp) ... | import java.io.*;
import java.util.*;
class dancing
{
public static void main(String[] args) throws Exception
{
BufferedReader r=new BufferedReader(new InputStreamReader(System.in));
String inp;
int i,j;
int T=Integer.valueOf(r.readLine());
for(int a=0;a<T;a++)
{
/*The first integer will be N, the nu... |
A21010 | A21843 | 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... | /**
* @author Saifuddin Merchant
*
*/
package com.sam.googlecodejam.helper;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class InputReader {
BufferedReader iFileBuffer;
long iCurrentLineNumber;
public InputReader(String pF... |
B11327 | B11376 | 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 recyclednumbers;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.uti... |
B22190 | B20953 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package qualc;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
/**
*
* @author marcin
*/
public class QualC {
/**
* @param args the command line arguments
*/
public stati... |
A20934 | A21912 | 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.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class Main {
/**
* @param args
*/
public static void main(String[]... |
B12115 | B10067 | 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();
... | /**
* @(#)RecycledNumbers.java
*
*
* @author CristianDumitruPopov
* @version 1.00 2012/4/14
*/
import java.io.*;
import java.util.*;
public class RecycledNumbers {
public static int lengthOf(int x) {
int c = 0;
while(x!=0) {
x = x/10;
c++;
}
return c;
}
public static int recycle(int z,int y) {... |
B11696 | B11023 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recycled;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util... | package org.moriraaca.codejam;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface TestConfiguration {
Class<? extends AbstractSolver<? extends TestCase>> solverClass();
}
|
A20490 | A21626 | 0 | /**
*
*/
package hu.herba.codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Hashtable;
public class test1 {
ArrayList<String > result=new ArrayList<String>();
Hashtable<Character, Character> h=new Has... |
B10245 | B12424 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.*;
public class Recycle {
public int count(int start, int end) {
int count = 0;
HashSet<Integer> numbers = new HashSet<Integer>();
int numDigits = (int)Math.log10(start) + 1;
... |
B12115 | B10445 | 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 qualification.taskC;
public class Task {
private int a;
private int b;
private boolean[][] table;
public Task(int a, int b, boolean[][] table) {
this.a = a;
this.b = b;
this.table = table;
}
public String execute() {
int result = 0;
for (int i = a; i <= b; i++){
for(int p = a; p <= b; p+... |
B12941 | B11821 | 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... | /**
* Google CodeJam 2012
* General framework that takes care of the similar and repetitive tasks for all the problems.
* E.g. managing case input and output.
*
* By Üllar Soon <positivew@gmail.com>
*/
package eu.positivew.codejam.framework;
/**
* CodeJam IO input case interface.
*
* @author Üllar Soon <po... |
A10996 | A10304 | 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 qualification;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Dancing {
public static void main(String[] s){
doIt();
}
... |
B10858 | B11024 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| package org.moriraaca.codejam;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.fail;
import java.io.BufferedReader;
import java.io.File;
import java.io.FilenameFilter;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.Collection;
import java.util.LinkedL... |
B11318 | B11517 | 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... | /**
* Recycled Numbers
*/
package com.google.jam.qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import j... |
B21968 | B22185 | 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.util.Scanner;
import java.io.IOException;
import java.util.Arrays;
import java.util.ArrayList;
import java.io.PrintStream;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.FileInputStream;
import java.io.InputStream;
/**
* Built using CHelper plug-in... |
B21270 | B21023 | 0 | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
public class CopyOfCopyOfMain {
static int ndigits(int n) {
return (int) (Math.log10(n) + 1);
}
static i... | import java.util.HashMap;
import java.util.Scanner;
public class C1 {
public static void main(String arg[]){
Scanner in=new Scanner(System.in);
int T= in.nextInt();
for(int i=1;i<=T;i++){
int A = in.nextInt();
int B = in.nextInt();
int count =0;
//System.out.println(A);
//System.ou... |
A11277 | A11895 | 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 ... | package com.google.codejam;
import com.google.codejam.util.CodeJamInputFile;
import com.google.codejam.util.CodeJamOutputFile;
public class Dancer {
/**
* @param args
*/
public static void main(String[] args) {
CodeJamInputFile f = new CodeJamInputFile("in/B-small-attempt0.in");
CodeJamOutputFile fo = n... |
B12762 | B10623 | 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 ... | package CaseSolvers;
import Controller.IO;
public class RecycledNumbersCase extends CaseSolver {
public RecycledNumbersCase(int order, int numberOfLines, IO io) {
super(order, numberOfLines, io);
}
int a, b;
@Override
public void addLine(String line) {
String[] str = line.split(" ");
a = Integer.parseIn... |
B10245 | B11414 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | import java.io.*;
import java.util.*;
public class Recycled {
class Case{
int[] limits = null;
HashSet<String> counted = new HashSet<String>();
public Case(int[] limits){
this.limits = limits;
}
public int getResult(){
int k = 0;
for(int i = limits[0]; i<=limits[1]; i++){
for(int j=1; j<(""+... |
A10793 | A10750 | 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.Scanner;
/*
* Google Code Jam 2012
* Program by Tommy Ludwig
* Problem: Dancing With the Googlers
* Date: 2012-04-13
*/
public class dancing {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T, N, S, p;
T = in.nextInt();
for (int i = 1; i <= T; i++)... |
A10996 | A11558 | 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.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
public class B {
public static int b(String str){
int retVal = 0;
String arr[] = str.split(" ");
int N = Integer.parseInt(arr[0]);
... |
B10149 | B11229 | 0 | import java.io.FileInputStream;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeSet;
// Recycled Numbers
// https://code.google.com/codejam/contest/1460488/dashboard#s=p2
public class C {
private static String process(Scanner in) {
int A = in.nextInt();
int B = in.nextInt();
int res =... | package codezam.exercise.WR1C2012;
public class PairNumber {
long numberA;
long numberB;
public PairNumber(long numberA, long numberB) {
super();
this.numberA = numberA;
this.numberB = numberB;
}
public long getNumberA() {
return numberA;
}
public void setNumberA(long numberA) {
this.numberA = num... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.