F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
B12570 | B10352 | 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.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class rec1 {
public static void main(String args[]) throws Exception{
FileInputStream fs = new FileInputStream("in1.txt")... |
B10245 | B11229 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | package 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... |
A22360 | A21144 | 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 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.... |
B11421 | B13127 | 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 com.nbarraille.gcj;
import java.io.IOException;
public class GCJ extends GCJHelper {
protected static final String TEST_CASE = "C-small"; // CHANGE THIS WHEN CHANGING PROBLEM
protected static final boolean RUN_ALL_CASES = true;
protected static final boolean DEBUG = true;
// DO WHATEVER TO SOLVE THE CAS... |
A12273 | A13034 | 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 y2012;
import java.io.*;
import java.util.Arrays;
public class Glob {
/**
* Fetch the entire contents of a text file, and return it in a String.
* This style of implementation does not throw Exceptions to the caller.
*
* @param aFile is a file which already exists and can be read.
*/
static pub... |
B21207 | B21560 | 0 | /*
* Problem C. Recycled Numbers
*
* Do you ever become frustrated with television because you keep seeing the
* same things, recycled over and over again? Well I personally don't care about
* television, but I do sometimes feel that way about numbers.
*
* Let's say a pair of distinct positive integers (n, m) ... | import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.Scanner;
import java.io.BufferedWriter;
public class D {
public static void main... |
B10361 | B10183 | 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.*;
import java.util.StringTokenizer;
import java.lang.Math;
public class qualifycodejamC{
public static int checkNum(int num, int m, int n){
String snum = Integer.toString(num);
int[] array = new int[snum.length()];
int min = num;
int count = 0;
for(int i=0;i<array.length;i++){
boo... |
B12669 | B11596 | 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 codejam2 {
public static void main(String[] args) throws FileNotFoundException, IOException {
File file = new File("C-small-attempt0.in");
FileReader fr = new FileReader(file);
Scanner ob = new Scanner(fr);
File outFile = new File... |
A12846 | A12045 | 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.util.Scanner;
public class DancingWithGooglers {
final static int[] _3n_2 = new int[] { 2, 5, 8, 11, 14, 17, 20, 23, 26, 29 };
final static int[] _3n_4 = new int[] { 4, 7, 10, 13, 16, 19, 22, 25, 28 };
// return -1 if cannot be written as surpr... |
B10155 | B12254 | 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 C {
private static void solve() throws IOException {
int testCases = nextInt();
for (int test = 1; test <= testCases; test++) {
out.print("Case #" + test + ": ");
solveOneTest();
}
}
private static void solveOneTest() throws IOException {
out.printl... |
B12074 | B12875 | 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 qualification;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Recycled {
public static void main(String[] args) throws FileNotFoundException {
List<Pair> list = new ArrayList<Pair>();
Scanner s = new Sca... |
B10149 | B10263 | 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 qualification;
import java.io.*;
import java.util.*;
import java.math.*;
public class C
{
//static String PROBLEM_NAME = "c-practice";
static String PROBLEM_NAME = "c-small-0";
//static String PROBLEM_NAME = "c-small-1";
//static String PROBLEM_NAME = "c-small-2";
//static String PROBLEM_NAME = "c-small-3... |
B11696 | B11719 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recycled;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util... | import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class QuestionA extends Question{
private static Map<Character, Character> translationMap;
private static boolean isInit;
private StringBuilder sb;
public QuestionA(Result result, Counter counter)
{
super(result, counter);
if... |
B12074 | B10241 | 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 recyclednumbers;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
//package recyclednumbers;
/**
*
* @author sony
*/
public class R... |
A22191 | A22354 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
public class QR2 {
private String[][] in;
private int numCases;
private String[] out;
public QR2() {
String inFilename = "B-large.in";
readFile(inFilename);
numCa... |
B12085 | B11507 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
public class Recycled {
/**
* @param args
*/
public static void main(String[] args) {
try{
BufferedReader bf=null;
try {
int T;... |
A11201 | A12375 | 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.*;
public class DancingGooglers {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int T = 0;
int N = 0;
int S = 0;
int p = 0;
int ptr = 0;
int maxCount = 0;
int scoreSum = 0;
int score1 = 0;
int score2 = 0;
int score3 = 0;
... |
B20856 | B21904 | 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.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... |
A12273 | A11586 | 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.util.Scanner;
public class mishe {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int cnt = scan.nextInt();
for(int c=1 ; c<=cnt ; c++)
{
int[] nums = new int[scan.nextInt()];
int sup = scan.nextInt();
int max = scan.nextInt();
int MINSUP = max+2*((max... |
B11421 | B10505 | 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.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Writer;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Recyc... |
A12460 | A10343 | 0 | /**
*
*/
package pandit.codejam;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Scanner;
/**
* @author Manu Ram Pandit
*
*/
public class DancingWithGoogle... | package 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... |
B11327 | B11841 | 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 info.m3o.gcj2012.recyclednumber;
public class ResultUtil {
MyNumberStringSet testedNumberSet;
MyNumberStringPairSet recycledNumberSet;
public ResultUtil() {
testedNumberSet = new MyNumberStringSet();
recycledNumberSet = new MyNumberStringPairSet();
assert (testedNumberSet.isEmpty() == true) : "Result... |
A12273 | A11803 | 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 qualification_round;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class A_sl_Dansing {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
Scanner inp = new Scanner(new FileInputStream("A... |
B10155 | B10660 | 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 algorithm.adhoc;
import java.io.*;
import java.util.*;
import java.math.*;
/**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 4/15/12
* Time: 1:00 AM
* To change this template use File | Settings | File Templates.
*/
public class GoogleCodeJam {
public static void main(String[] arg) throw... |
B13196 | B11184 | 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 googlecodejam1;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
/**
* Google Code Jam 2012, Recycled Numbers
* @author matt1618
*/
public class GoogleCodeJam1 {
public static boolean digitMatch(int n, int m){
... |
B10485 | B11632 | 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.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
public class EagleProblemC {
public static vo... |
A11201 | A13170 | 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.DataInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.HashMap;
public class Dancing {
/**
* @param args
*/
public static void main(String[] args) {
try {
// Open the file that is the first
... |
A10793 | A12178 | 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 hk.polyu.cslhu.codejam.thread;
import hk.polyu.cslhu.codejam.lib.ResultCollector;
import hk.polyu.cslhu.codejam.solution.Solution;
import java.util.List;
import org.apache.log4j.Logger;
public abstract class JamThread implements Runnable {
public static Logger logger = Logger.getLogger(JamThread.class);
... |
B20006 | B20543 | 0 | import java.io.*;
import java.math.BigInteger;
import java.util.*;
import org.jfree.data.function.PowerFunction2D;
public class r2a
{
Map numMap = new HashMap();
int output = 0;
/**
* @param args
*/
public static void main(String[] args)
{
r2a mk = new r2a();
try {
... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
public... |
B12074 | B12038 | 0 | package jp.funnything.competition.util;
import java.math.BigInteger;
/**
* Utility for BigInteger
*/
public class BI {
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger add( final BigInteger x , final BigInteger y ) {
return... | import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import com.ibm.db2.jcc.am.s;
public class C {
private static final String INPUT_FILE = "d:/C-small-attempt0.in";
private static... |
A10793 | A11349 | 0 | import java.io.*;
import java.math.*;
import java.util.*;
import java.text.*;
public class b {
public static void main(String[] args) {
Scanner sc = new Scanner(new BufferedInputStream(System.in));
int T = sc.nextInt();
for (int casenumber = 1; casenumber <= T; ++casenumber) {
... | import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class DancingWithGooglers {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
Scanner in;
in = ... |
B21227 | B22073 | 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.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.*;
public class C {
Scanner sc;
PrintStream ps;
public void solve() {
int A = sc.nextInt();
int B = sc.nextInt();
int nr = 0;
for (int n=A; n<=B; n++) {
String s = n+""... |
A10793 | A10682 | 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 google.exercise.b;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
/**
* @author tomtom
*
*/
public class B {
... |
A10699 | A10474 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Dancing {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) ... | package google.codejam;
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.google.common.base.Charsets;
impor... |
A20119 | A21612 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.Scanner;
public class CodeJamWriter implements ICounterZeroEvent{
//public static String inputFile = "C:\\Users\\user\\Desktop\\coejam\\2012-Qualificaton\\A-test";
//public stat... |
B11421 | B12664 | 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.List;
import java.util.Scanner;
public class C {
public static void main(String[] args) throws Exception{
new C().solve(args[0]);
}
private void solve(String file) throws Exception {
Scanner s = new Scanner(new File(file));
int x=s.nextInt()... |
B11421 | B11906 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Recycled {
public static void main(String[] args) throws Exception{
String inputFile = "C-small-attempt0.in... | import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
public class Utils {
public static ArrayList<String> readFile(String filename){
//replace local file with remote file from peerInfo address
ArrayList<String> ret= new ArrayList<String... |
B11361 | B12029 | 0 | import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
public class C{
Scanner sc=new Scanner(System.in);
int INF=1<<28;
double EPS=1e-9;
int caze, T;
int A, B;
void run(){
T=sc.n... | import java.util.Scanner;
public class C {
public static class N
{
public static int[] m_num;
public static int m_first;
public static int length;
public static void set(int n)
{
String s = Integer.toString(n);
char[] c = s.toCharArray();
m_num = new int[c.length];
m_first = 0;
for(int ... |
B12570 | B11590 | 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 C {
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Scanner sc = new Scanner(br.readLine());
int T = sc.nextInt();
int caseNumber = 1;
for(int i=0; i<T; i++){
... |
A21396 | A20230 | 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.*;
import java.util.*;
import java.text.*;
public class Main implements Runnable{
/**
* @param args
*/
private StringTokenizer stReader;
private BufferedReader bufReader;
private PrintWriter out;
public static void main(String[] args) {
// TODO Auto-generated method stub
(new Main()).run()... |
A11277 | A10218 | 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 qualification;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.BufferedReader;
import java.... |
B10245 | B13140 | 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.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Q3RecycledNumbers {
public static void main(String[] args) throws FileNotFoundException, IOException {
Scanner sc... |
B12074 | B11150 | 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 QualificationRound;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Dictionary;
import java.util.regex.Pattern;
public class C
{
public C()
{
}
public ... |
A20934 | A21533 | 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.util.*;
import static java.lang.Math.*;
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++) {
System.err.println(zz);
int N = in.nextInt();
int S = in.nextInt();
int P = in.nextInt();
int n... |
A12211 | A12914 | 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.menzus.gcj._2012.qualification.b;
import com.menzus.gcj.common.OutputProducer;
public class BOutputProducer implements OutputProducer<BInput, BOutputEntry> {
@Override
public BOutputEntry produceOutput(BInput input) {
int avaragesAboveLimit = 0;
int avaragesBelowLimitIfTheyWereSuprising = 0;
f... |
A22078 | A21305 | 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 fun.codeslam.dancers;
public class Result
{
Integer maximumNumberOfGooglers = 0;
public Result(TestCase testCase)
{
Integer numberOfSurprisesLeft = testCase.getNumberOfSurprises();
Integer pointsNeeded = testCase.getPointsNeeded();
Integer enoughPoints = pointsNeeded * 3 - 2;
Integer enoughPoints... |
B10245 | B13050 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[][] s = new int[3][n];
for (int i = 0; i < n; i++) {
s[0][i] = sc.nextInt();
s[1][i] = sc.nextInt();
s[2][i] = 0;
}
for (int i = 0; i < n; i++) {
L... |
A10793 | A11667 | 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) {
... |
public class kickClass {
public static void main(String[] args){
//testGraph.run();
//testCollection.run();
solutionRunner t1 = new solutionRunner();
}
}
|
A20382 | A20230 | 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.*;
import java.util.*;
import java.text.*;
public class Main implements Runnable{
/**
* @param args
*/
private StringTokenizer stReader;
private BufferedReader bufReader;
private PrintWriter out;
public static void main(String[] args) {
// TODO Auto-generated method stub
(new Main()).run()... |
B10149 | B11986 | 0 | import java.io.FileInputStream;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeSet;
// Recycled Numbers
// https://code.google.com/codejam/contest/1460488/dashboard#s=p2
public class C {
private static String process(Scanner in) {
int A = in.nextInt();
int B = in.nextInt();
int res =... | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.Vector;
public class qual3 {
/**
* @param args
*/
public static void main(String[] args) {
try {
FileReader fr =... |
A10793 | A12095 | 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) {
... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package cjam;
import java.io.*;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Administrator
*/
public class Cjam {
/**
* @param args the command l... |
B21270 | B20427 | 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.*;
import java.io.*;
public class C2 {
public static String convert(int num) {
char[] arr = Integer.toString(num).toCharArray();
Arrays.sort(arr);
return new String(arr);
}
// count lower than A
public static long countRecycle(int A, int num) {
//long ans = 0;
StringBuffer s = new S... |
A10793 | A13180 | 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.*;
public class reverse {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
int m=sc.nextInt();
int i;
int j;
for(i=1;i<=m;i++) {
int n=sc.nextInt();
int s=sc.nextInt();
int p=sc.nextInt();
... |
B21049 | B21869 | 0 | package it.simone.google.code.jam2012;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumber implements GoogleCodeExercise {
int a = 0;
int b = 0;
Set<Couple> distinctCouple = null;
long maxTime = 0;
private class Couple {
int x = 0;
int y = 0;
public Couple(int x, int y) {
this... | import java.util.*;
import java.math.*;
import java.io.*;
public class Main
{
public static void main(String args[]) throws IOException
{
Scanner c=new Scanner(System.in);
int T=c.nextInt();
for(int i=0;i<T;i++)
{
int ans=0;
int A=c.nextInt();
int B=c.nextInt();
for(int num=A;num<=B;num++)
... |
B21968 | B21435 | 0 | import java.util.*;
import java.io.*;
public class recycled_numbers {
public static void main(String[]a) throws Exception{
Scanner f = new Scanner(new File(a[0]));
int result=0;
int A,B;
String n,m;
HashSet<String> s=new HashSet<String>();
int T=f.nextInt(); //T total case count
for (int t=1; t<=T... | package jp.funnything.competition.util;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import org.apache.commons.io.IOUtils;
public class AnswerWriter {
private static final String DEFAULT_FORMAT = "Case #%d: %s\n";
private final BufferedWriter _wr... |
B21227 | B20367 | 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.*;
import java.util.HashSet;
import java.util.Set;
/**
* Created by IntelliJ IDEA.
* User: YC14RP1
* Date: 4/14/12
* Time: 12:57 AM
* To change this template use File | Settings | File Templates.
*/
public class Test3 {
public static void main(String[] args) throws FileNotFoundException {
... |
A22642 | A21303 | 0 | import java.util.*;
import java.io.*;
public class DancingWithTheGooglers
{
public DancingWithTheGooglers()
{
Scanner inFile = null;
try
{
inFile = new Scanner(new File("inputB.txt"));
}
catch(Exception e)
{
System.out.println("Problem ope... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
public class qualB {
public static void main(String[] args) {
String prblm="B"; boolean fl=true;
String filein=prblm+"-"+((fl)?"large":"small")+".in.txt";
String fileout=prblm+"-"+((fl)?"large":"s... |
B20734 | B20365 | 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 qualification2012;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class RecycledNumbers {
static int rotationCount(int x, int lower) {
String s = String.valueOf(x);
List<Integer> rotations = new ArrayList<In... |
B10702 | B12228 | 0 | import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Recycle {
private static HashMap<Integer, HashSet<Integer>> map = new HashMap<Integer, HashSet<Integer>>();
private static HashSet<Integer> toSkip = new HashSet<Integer>();
/**
* @param args
*/
public static void main(S... | import java.io.*;
import java.util.*;
public class test {
public static void main(String[] args) throws IOException {
// Location of file to read
functions aa = new functions();
File file = new File("input.txt");
Writer output = new BufferedWriter(new FileWriter("output.txt"));
int i = 1;
... |
A13029 | A12443 | 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 static java.lang.Math.*;
public class B {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int a = 1; a <= T;a++){ //caso de prueba
in.nextLine();
int N = in.nextInt();
int S = in.nextInt();
int pInt = in.nextInt()... |
A12570 | A10443 | 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... | import java.util.Scanner;
import java.io.*;
public class Prob2 {
public static void main(String[] args) throws IOException{
Scanner in = new Scanner(new File("D:/B-small-attempt0.in"));
PrintStream out = new PrintStream(new File("D:/outputProb2.txt"));
int lineAmount = Integer.parseInt(in.nextLine()... |
A20119 | A22618 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | import java.io.FileNotFoundException;
public class main {
/**
* @param args
* @throws FileNotFoundException
*/
public static void main(String[] args) throws FileNotFoundException {
// TODO Auto-generated method stub
Parser parser = new Parser(args[0]);
Dwtg dwtg = new Dwtg(parser.parse(1));
dwtg.sol... |
B21790 | B21367 | 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... | /**
* @author Saifuddin Merchant
*
*/
package com.sam.googlecodejam.helper;
public class StringHelper {
}
|
B12762 | B10554 | 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.*;
import java.util.HashMap;
class probC{
public static void main(String[] args){
Code b=new Code();
}
}
class Code{
public Code(){
try {
FileWriter fstream = new FileWriter("output.txt");
BufferedWriter out = new BufferedWriter(fstream);
File fin = new File("C-small-attempt0.in");
Fi... |
A22360 | A20815 | 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.*;
import static java.lang.System.*;
class B{
static public void main(String[] args){
Scanner sc = new Scanner(System.in);
int cases = Integer.parseInt(sc.nextLine());
for(int c = 1; c<=cases; c++){
String[] s = sc.nextLine().split(" ");
int n = Integer.parseInt(s[0]);
int sur =... |
A10793 | A10224 | 0 | import java.io.*;
import java.math.*;
import java.util.*;
import java.text.*;
public class b {
public static void main(String[] args) {
Scanner sc = new Scanner(new BufferedInputStream(System.in));
int T = sc.nextInt();
for (int casenumber = 1; casenumber <= T; ++casenumber) {
... | import java.io.*;
import java.util.*;
public class PracticeB
{
/* ±±©çÒW */
private static final String fname = "B-small-attempt0.in"; // üÍpÌt@C¼
public static void solve()
{
int T = sc.nextInt();
for (int i = 1; i <= T; i++)
{
int N = sc.nextInt();
int S = sc.nextInt();
int p = sc.... |
B10231 | B11757 | 0 | import java.io.*;
class code1
{
public static void main(String args[]) throws Exception
{
File ii = new File ("C-small-attempt1.in");
FileInputStream fis = new FileInputStream(ii);
BufferedReader br = new BufferedReader(new InputStreamReader (fis));
int cases = Integer.parseInt(br.readLine());
FileOutput... | import java.io.File;
import java.io.FileInputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
try {
File output = new File("output.txt");
if (output.exists()) {
output.delete();
}
... |
A12273 | A12337 | 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.FileReader;
import java.util.StringTokenizer;
public class B {
void main2(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new FileReader(args[0]));
String line = br.readLine();
int count = Integer.parseInt(line);
for (int i = 0;... |
B10485 | B10982 | 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... | // Google Code Jam Qualification Round 2012
// Problem C. Recycled Numbers
import java.util.*;
import java.io.*;
public class RecycledNumbers{
static String inname = "C-small-attempt0.in"; // input file name here
static String outname = "C-small-attempt0.out"; // output file name here
public static vo... |
B10149 | B11538 | 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 template;
import java.io.*;
import java.util.ArrayList;
import java.util.Random;
public class Utils {
static String logfile = "";
public static BufferedWriter newBufferedWriter(String filename, boolean append) {
BufferedWriter bw = null;
try {
bw = new BufferedWriter(new ... |
B21790 | B21412 | 0 | import java.io.*;
import java.util.*;
public class C {
void solve() throws IOException {
in("C-large.in"); out("C-large.out");
long tm = System.currentTimeMillis();
boolean[] mask = new boolean[2000000];
int[] r = new int[10];
int t = readInt();
for (int cs = 1; cs... | package RecycledNumbers;
public class Pair {
int low;
int high;
public Pair(int low, int high) {
this.low =low;
this.high=high;
}
@Override
public boolean equals(Object o) {
if (!(o instanceof Pair))
return false;
Pair other = (Pair)o;
return ((low == other.getLow() && high == othe... |
B20291 | B21037 | 0 | import java.io.*;
import java.util.*;
class B
{
public static void main(String[] args)
{
try
{
BufferedReader br = new BufferedReader(new FileReader("B.in"));
PrintWriter pw = new PrintWriter(new FileWriter("B.out"));
int X = Integer.parseInt(br.readLine());
for(int i=0; i<X; i++)
{
String[]... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;
import java.lang.reflect.Array;
import java.util.ArrayList;
public class C {
private static ArrayList<Byte> makeCycle(ArrayList<Byte> digits) {
if (digits.size() == 1) {
return new Array... |
A11502 | A11475 | 0 | package template;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
public class TestCase {
private boolean isSolved;
private Object solution;
private Map<String, Integer> intProperties;
private Map<String, ArrayList<Integer>> intArrayProperties;
private Map<String, Arra... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
//DancingGooglers.java
//Completes the Dancing with Googlers problem for Google Code Jam 2012
//By Jack Thakar
//Coded in Java using Eclipse 3.7
pu... |
A22771 | A22921 | 0 | package com.menzus.gcj._2012.qualification.b;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class BProcessorFactory extends AbstractProcessorFactory<BInput, BOutputEntry> {
public BProcessorFactory(Str... | package com.g0414.b;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
public class Problem {
public final String FILE_PATH = "C:/data/workspace/googleCodeJam/src/" + "com/g0414/b/";
public final String F... |
A12113 | A11910 | 0 | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class B {
static int[][] memo;
static int[] nums;
static int p;
public static void main(String[] args)throws IOException
{
Scanner br=new Scanner(new File("B-small-attempt0.in"... | import java.io.*;
import java.util.Arrays;
public class GoogleCodeJam2
{
public static void main(String[] args) throws IOException
{
FileInputStream fstreami = new FileInputStream("input.txt");
DataInputStream in = new DataInputStream(fstreami);
FileWriter fstreamo = new FileWriter("ou... |
A11277 | A13177 | 0 | package googlers;
import java.util.Scanner;
import java.util.PriorityQueue;
import java.util.Comparator;
public class Googlers {
public static void main(String[] args) {
int n,s,p,count=0,t;
Scanner sin=new Scanner(System.in);
t=Integer.parseInt(sin.nextLine());
int result[]=new int[t];
int ... | import java.io.*;
import java.util.*;
public class DancingWithTheGooglers {
public static void main (String[] args) throws IOException {
Scanner in = new Scanner(new File("B-small.txt"));
int cases;
cases = in.nextInt();
int google, s, p;
int count;
int temp;
for (int n = 0; n < cases; n++... |
B20566 | B21194 | 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.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() ... |
B10149 | B10051 | 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 =... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package google.code.jam.recycled.numbers;
import java.util.ArrayList;
import java.util.HashMap;
/**
*
* @author Lucas
*/
public class RecycledNumbers {
public ArrayList<Integer> findRecycledNumbers(ArrayList<In... |
B12762 | B11947 | 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.*;
/**
* @author Seitaro Sakoda
*
*/
public class RecycledNumbers {
private static final HashMap<Long, Integer> cache = new HashMap<Long, Integer>();
private static final ArrayLis... |
B22190 | B21521 | 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.*;
import java.util.*;
public class C
{
BufferedReader read;
BufferedWriter write;
public static void main(String args[])
{
try {
new C().init("C-large");
} catch (Exception ex) {
System.out.println("error occured "+ex);
// Logger.... |
B12669 | B12302 | 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 codejam;
import java.io.*;
import java.util.*;
//out.println("Case #"+(tt++)+": "+line.trim());
public class Plantilla2 {
public static class pair implements Comparable<pair> {
int a;
int b;
pair(int a, int b) {
this.a = a;
this.b = b;... |
A12113 | A12119 | 0 | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class B {
static int[][] memo;
static int[] nums;
static int p;
public static void main(String[] args)throws IOException
{
Scanner br=new Scanner(new File("B-small-attempt0.in"... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.File;
import java.util.List;
import java.util.ArrayList;
public class GCJ_qr_b {
public static void main(String[] args) {
GCJReader in = new GCJReader(args[0]);
GCJWriter out = ne... |
A22360 | A20866 | 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.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.Vector;
public class Main {
public static int problemC(Vector<Integer> V,int N,int S,int P)
{
int Nbr=0;
for(int i=0;i<N;i++)
{
if((3*P-2)<=V.elementAt(i))
Nbr++;
else if(... |
B12669 | B12226 | 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 round1;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.HashSet;
import java.util.Scanner;
public class Recycled {
private int noCases;
private int[] minBounds;
private int[] maxBounds;
private int[] noDigits;
private void readFile(String file... |
A22771 | A20013 | 0 | package com.menzus.gcj._2012.qualification.b;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class BProcessorFactory extends AbstractProcessorFactory<BInput, BOutputEntry> {
public BProcessorFactory(Str... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Dancing {
private static final String fileInName = "file.in";
private static final String fileOutname = "file.out";
public static void main(String[] args) throws IOException{
Sy... |
A11277 | A11898 | 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.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Ari
*/
public class ProblemB... |
A11917 | A12287 | 0 | package com.silverduner.codejam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
public class Dancing {
public static void main(String[] args) throws Exception {
File input = new File("B-small-attempt... | import java.util.Scanner;
public class B {
/**
* @param args
*/
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int nbr_case = scan.nextInt();
for(int i = 0; i < nbr_case; i++)
{
int N = scan.nextInt();
int S = scan.nextInt();
int p = scan.nextInt();
int poss... |
A10996 | A10008 | 0 | import java.util.Scanner;
import java.io.*;
class dance
{
public static void main (String[] args) throws IOException
{
File inputData = new File("B-small-attempt0.in");
File outputData= new File("Boutput.txt");
Scanner scan = new Scanner( inputData );
PrintStream print= new PrintStream(outputData);
... | import java.io.*;
import java.util.*;
//import java.math.*;
public class b {
public static void main(String[] args) throws IOException
{
Scanner qwe = new Scanner(new File("b.in"));
BufferedWriter out = new BufferedWriter(new FileWriter("b.out"));
int t = qwe.nextInt();
for(int i = 1; i <= t; i++)
{
in... |
A20119 | A20184 | 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 com.webcumo.tasks.b;
/**
* @author Cumo
*/
public class Worker {
public static String translateFromGooglereseToEnglish(String googlersString) {
int count;
int surprises;
int p;
String[] items = googlersString.split(" ");
count = Integer.parseInt(items[0]);
... |
A22078 | A22313 | 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.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class DancingWithGooglers {
static String max(String line, int index){
String[] array = line.split(" ");
int ... |
B10702 | B12846 | 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 gcj2012.qr;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumbers {
public static int count(int a, int b) {
int r = 0, len, m;
String sn, sm;
Set<Integer> used = new HashSet<Integer>();
for ... |
B12115 | B12306 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... | package com.mademoisellegeek.googlecodejam.y2012.qualround;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.HashMap;
public class RecycledNumbers implements Runnable {
BufferedReader in;
BufferedW... |
B21752 | B21377 | 0 | package Main;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
/**
* Created with IntelliJ IDEA.
* User: arran
* Date: 14/04/12
* Time: 3:12 PM
* To change ... | package test.com;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Stack;
public class QualC {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
FileInputStream fos = new FileInputStream("c... |
A12544 | A10914 | 0 | package problem1;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Arrays;
public class Problem1 {
public static void main(String[] args) throws FileNotFoundException, IOException{
try {
TextIO... | package qualification;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.Scanner;
public class Dancing {
private static String fileName = "dancing-small";
private static String inputFileName = fileName + ".in";
private static String outputFileNam... |
B22190 | B21987 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
public class Recycled {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.par... |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author edemairy
*/
public class Main {
private final static Logger logger = Logger.getLogger(Main.class.getName());
pri... |
B12074 | B11746 | 0 | package jp.funnything.competition.util;
import java.math.BigInteger;
/**
* Utility for BigInteger
*/
public class BI {
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger add( final BigInteger x , final BigInteger y ) {
return... | import java.io.*;
import java.util.*;
public class Recycle
{
static int total;
static Set<Integer> set;
public static void main(String[] codejam) throws Exception
{
BufferedReader br = new BufferedReader (new FileReader ("recycle.in"));
PrintStream ps = new PrintStream... |
B11361 | B12013 | 0 | import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
public class C{
Scanner sc=new Scanner(System.in);
int INF=1<<28;
double EPS=1e-9;
int caze, T;
int A, B;
void run(){
T=sc.n... | package QualificationC;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.Arrays;
import java.util.HashSet;
public class ProblemC {
public static void main(String args[]) throws Exception{
System.out.println(args[0]);
FileReader fr = new FileReader(args[0]);
BufferedReader br = new B... |
A12273 | A12775 | 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.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... |
A11917 | A11078 | 0 | package com.silverduner.codejam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
public class Dancing {
public static void main(String[] args) throws Exception {
File input = new File("B-small-attempt... | import java.util.Scanner;
public class B {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
new B();
}
int[] notSurprising;
int[] surprising;
public B()
{
notSurprising = new int[31];
surprising = new int[31];
for(int i = 2; i <= 30; ++i)
... |
B11327 | B12316 | 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 cj.qulification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
public class P3 {
public static boolean isRecycled(int n, int m){
String first=Integer.toString(n);
for (int i=1;i<first.length();i++){
String number=first.substring(i)+first.su... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.