F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
B12669 | B11920 | 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.ArrayList;
import java.util.Scanner;
public class recycled
{
public static void main(String[] args)
{
Scanner in = new Scanner (System.in);
String scases = in.nextLine();
int T = Integer.parseInt(scases);
for(int i = 1; i<(T+1); i++)
{
String temp1 = in.nextLine();
... |
B12074 | B10433 | 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 codejam2012;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.u... |
B20424 | B20805 | 0 | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
// static int MAX = 10000;
static int MAX = 2000000;
static Object[] All = new Object[MAX+1];
static int size( int x ) {
if(x>999999) return 7;
if(x>99999) return 6;
if(x>9999) return 5;
if(x>999) retu... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Joel
*/
import java.io.*;
public class RecycledNumbers
{
public static void main(String[] args)
{
try
{
FileWriter output = new FileWriter("C:\\Users\\Joel\\Documen... |
A10568 | A11339 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Problem2;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.St... |
A11201 | A10728 | 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.FileNotFoundException;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.Scanner;
public class googler {
public static void main(String args[]) throws FileNotFoundException
{
Scanner in=new Scanner(new FileReader("input.in"));
PrintWriter pw=new PrintWriter("ans.txt");... |
A20261 | A21280 | 0 | package com.gcj.parser;
public class MaxPoints {
public static int normal(int value){
int toReturn = 0;
switch (value) {
case 0 : toReturn = 0 ; break;
case 1 : toReturn = 1 ; break;
case 2 : toReturn = 1 ; break;
case 3 : toReturn = 1 ; break;
case 4 : toReturn = 2 ; break;
case 5 : toReturn = 2 ; b... | /**
* KSpokas: GCJ 2012 Qualification Round Problem B
*/
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.Collections;
import java.util.HashMap;
import java.util.... |
B11696 | B11136 | 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 recyclednumbers.recycler;
public class Recycler {
public int countPairs(int startValue, int endValue) {
int count = 0;
for (int i = startValue; i < endValue; i++) {
for (int j = i + 1; j <= endValue; j++) {
if (isRecycledPair(i, j)) {
count... |
A22360 | A20548 | 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.*;
import java.util.*;
/**
*
* @author posv
*/
public class GoogleDance{
public static void main(String[] args){
int cs = 0;
int n,s,p,ln,count,counts,total,temp;
count = 0; counts = 0; total = 0;
//List<Integer> scores = new ArrayList<Integer>();
try{
File file = new File("lines1.txt"... |
A12544 | A11097 | 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 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 B
{
public B()
{
}
public ... |
A12211 | A11063 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class Dancing_improved {
static int f_Superan_limites(String params){
int superan_limite=0;
String[] para... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class triplets {
public static void main(String[] args) throws IOException {
BufferedReader reader=new BufferedReader(new InputStreamReader(System.in)); //copy test data into... |
A22378 | A22127 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class CodeJam {
// public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt";
public static final String INP... | import java.io.BufferedReader;
import java.io.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... |
B10155 | B11941 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
public class MainB {... |
A10699 | A11440 | 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.security.AlgorithmConstraints;
import java.util.Scanner;
import java.util.StringTokenizer;
public class Numbers {
static int count =0;
static int max;
static int surprise;
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int testCa... |
B12074 | B11264 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package competition;
/**
*
* @author Sriram
*/
//import static java.lang.System.*;
import java.util.*;
import java.io.*;
public class RecycledNumbers_GCJ_2012{
public static void main(String args[]) throws Exce... |
B10231 | B11054 | 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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class CodeJam {
public static void main(String [] args) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int num = Integer.parseInt(b... |
B20734 | B20153 | 0 | package fixjava;
public class StringUtils {
/** Repeat the given string the requested number of times. */
public static String repeat(String str, int numTimes) {
StringBuilder buf = new StringBuilder(Math.max(0, str.length() * numTimes));
for (int i = 0; i < numTimes; i++)
buf.append(str);
return buf.toStr... | package com.bakes;
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 B {
public static void main(String[] args) {
B park = new B();
park.calculate();
}
private void c... |
A11502 | A10369 | 0 | package template;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
public class TestCase {
private boolean isSolved;
private Object solution;
private Map<String, Integer> intProperties;
private Map<String, ArrayList<Integer>> intArrayProperties;
private Map<String, Arra... | import java.util.Scanner;
public class Utils {
public static int readIntegerLine(Scanner sc) {
String s = readStringLine(sc);
return Integer.parseInt(s);
}
public static String readStringLine(Scanner sc) {
return sc.nextLine();
}
public static int readInteger(Scanner sc)... |
B20424 | B21690 | 0 | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
// static int MAX = 10000;
static int MAX = 2000000;
static Object[] All = new Object[MAX+1];
static int size( int x ) {
if(x>999999) return 7;
if(x>99999) return 6;
if(x>9999) return 5;
if(x>999) retu... |
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Scanner;
import java.util.Set;
import com.google.common.collect.Sets;
public class C {
public static void main(String [] args) throws IOException {
String inputFile = "src/C-large.in";
Scanner in = new Scanner(new Fi... |
A13029 | A13124 | 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... | //input file must be in.txt in this directory
//output file will be out.txt
import java.io.*;
import java.util.*;
public class B
{
public static Scanner in;
public static PrintStream out;
public static void main(String [] args) throws Throwable
{
in = new Scanner(new File("in.txt"));
int cases = in.nextInt();
... |
A22771 | A20578 | 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 Controller;
import ProblemSolvers.DancingGooglers;
import ProblemSolvers.ProblemSolver;
public class Main {
public static void main(String[] args) {
ProblemSolver problem = new DancingGooglers("dancingGooglers");
problem.process();
}
}
|
B11696 | B10397 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package rotatematrix;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
/**
*
* @author FARHAN
*/
public class Combination {
int count =0;
int num =10;
int size=0;
int Tranverse(... |
B10702 | B11304 | 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... | /**
* Copyright 2012 Christopher Schmitz. All Rights Reserved.
*/
package com.isotopeent.codejam;
import com.isotopeent.codejam.lib.SolverBase;
import com.isotopeent.codejam.lib.Utils;
import com.isotopeent.codejam.lib.converters.IntArrayLine;
public class Solver extends SolverBase<int[]> {
private static final ... |
B10702 | B12195 | 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 C
{
BufferedReader read;
BufferedWriter write;
public static void main(String args[])
{
try {
new C().init("C-small-attempt2");
} catch (Exception ex) {
System.out.println("error occured "+ex);
//... |
A10996 | A13138 | 0 | import java.util.Scanner;
import java.io.*;
class dance
{
public static void main (String[] args) throws IOException
{
File inputData = new File("B-small-attempt0.in");
File outputData= new File("Boutput.txt");
Scanner scan = new Scanner( inputData );
PrintStream print= new PrintStream(outputData);
... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package exercises;
import IO.Input;
/**
*
* @author dannocz
*/
public class Exercise2 {
public static void run(Input input){
// for (String st : input.getTestCases()) {
// input.addRes... |
B11696 | B11735 | 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 y2012.Qualification;
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.HashSet;
import java.util.Set;
public class RecycledNumbers extends IOStream {
public RecycledNumbers(Str... |
B12669 | B10019 | 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.ArrayList;
public class GCJUtils {
public static Long[] getLongArray(ArrayList<String> lines){
Long[] arrL = new Long[lines.size()];
for(int i=0;i<lines.size();i++){
arrL[i] = Long.parseLong(lines.get(i));
}
return arrL;
}
public static Long[] getLongArray(String[] lines){
Long[] arrL = new Lo... |
A11277 | A11643 | 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 me.mevrad.codejam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
public class SolutionB {
/**
* @param args
*/
public static void main(Stri... |
A10996 | A10629 | 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 br.com.app;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.util.Scanner;
public class DancingWithTheGooglers {
private static Scanner scan = new Scanner(System.in);
private static String[] entrada;
private static int[] p... |
B12085 | B11335 | 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... | public interface Problem {
void solve();
Object getSolution();
}
|
A22771 | A20173 | 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.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 ... |
B11696 | B11703 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recycled;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util... | import java.io.*;
import java.util.*;
import java.awt.*;
import static java.lang.System.*;
public class C {
public static void main (String [] args) throws IOException {new C().run();}
public void run() throws IOException{
Scanner file = new Scanner(new File("C-small-attempt0.in"));
PrintWriter out = new PrintWr... |
A10568 | A11358 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader (new... |
import java.io.File;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
/**
*
* @author Igor
*/
public class Dancing {
public static void main(String[] args) throws Exception {
Scanner in = new Scanner(new File("input.txt"));
PrintWriter out = new PrintWriter("outpu... |
A20490 | A22456 | 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.IOException;
import java.util.List;
public class ReverseWords extends JamProblem {
public static void main(String[] args) throws IOException {
ReverseWords p = new ReverseWords();
p.go();
}
@Override
String solveCase(JamCase jamCase) {
StringBuilder builder = new ... |
A20490 | A20111 | 0 | /**
*
*/
package hu.herba.codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io... | import java.util.*;
class Main
{
public static void main(String[] arg)
{
Scanner in = new Scanner(System.in);
int trials = in.nextInt();
int tt = 0;
while(tt < trials)
{
int N = in.nextInt();
int S = in.nextInt();
int P = in.nextInt();
int ret = 0;
for(int i=0; i<N; ++i)
{
i... |
B11696 | B10939 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recycled;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
public class RecycledNumbers {
public static int rotate(int x) {
if (x < 10)
return x;
String s = String.valueOf(x);
s = s.substring(1... |
B12570 | B11510 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
import java.util.Scanner;
/**
*
* @author Abdo
*/
public class problemb {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
... |
A12570 | A10872 | 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 tochi.gcj2012;
import java.io.File;
import java.io.PrintStream;
import java.util.Scanner;
import javax.swing.text.html.MinimalHTMLWriter;
public class B {
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
System.setOut(new PrintStream(new File("outpu... |
B10899 | B10343 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
public class ReadFile {
public static void main(... | import java.io.*;
import java.util.*;
import java.math.*;
public class Main {
public void solve() throws IOException {
int tests = nextInt();
HashSet<Long> hs = new HashSet<Long>();
for (int test=1; test<=tests; test++) {
out.print("Case #"+test+": ");
int a = nextI... |
B12762 | B10037 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.File;
import java.io.FileInputStream;
import java.util.Scanner;
/**
*
* @author imgps
*/
public class C {
public static void main(String args[]) throws Exception{
int A,B;
int ctr ... | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class GoogleReplaced {
static BufferedWriter bw = null;
public static void main(String[] args) throws Exception {
try {
Scanner... |
A22378 | A20068 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class CodeJam {
// public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt";
public static final String INP... |
package codejam;
import java.io.*;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
public class B {
static String str = "C:\\carl\\fbl.txt";
static String text = "";
static int N, S, P,T;
static int[][] list;
public static void main... |
B10485 | B10656 | 0 |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class Recycle
{
public static void main(String[] args)
{
/* Set<Integer> perms = getPermutations(123456);
for(Integer i: p... | package br.com.app;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.util.Scanner;
public class RecycledNumbers {
private static int totCasos, contCasos, contador, totNumerosMovidos, indice;
private static long a, b, n, m;
private... |
B22190 | B21629 | 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.
*/
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Scanner;
/**
*
* @author linlin
*/
public class Main {
/**
* @param... |
B12115 | B10367 | 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();
... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recycle;
import java.util.*;
import java.io.*;
import java.util.logging.Level;
import java.util.logging.Logger;
public class Recycle {
public static void main(String[] args) throws Exception {
// ... |
B21270 | B21972 | 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.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.io.Reader;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
public class Main
{
public static HashMap<Character,Character> mapp = new... |
A12846 | A10314 | 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.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class G_2 {
static int n, s, p;
static int[] tt;
public static void main(String[] args) throws IOException {
PrintWriter bw = new PrintWriter(new File... |
B11318 | B11045 | 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... |
public class Code3DataStructure {
private int a;
private int b;
private int result;
public int getA() {
return a;
}
public void setA(int a) {
this.a = a;
}
public int getB() {
return b;
}
public void setB(int b) {
this.b = b;
}
public int getResult() {
return result;
}
public void setResult(int... |
B10858 | B13113 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| package com.vp.common;
import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.PrintStream;
import java.util.Scanner;
public class InputOutputProcessor {
private int numberOfCases;
private boolean doesInputHaveDataSetLines;
private int indexOfDataSetLine;
p... |
B10485 | B11674 | 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.util.*;
import java.io.*;
public class C {
private static boolean isRecycledPair(int n, int m) {
String sn = Integer.toString(n);
String sm = Integer.toString(m);
if(sn.length() != sm.length())
return false;
int l = sn.length();
for(int i = l; --i >= 0; ) {
if(sm.equals(sn.substring(i, l... |
B12082 | B11209 | 0 | package jp.funnything.competition.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.apache.commons.io.IOUtils;
public class QuestionReader {
pr... | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Scanner;
public class C {
public static void main(String[] args) {
try {
Scanner in = new Scanner(new File("C.in"));
BufferedWriter writer = new BufferedW... |
B12669 | B13200 | 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 tr0llhoehle.cakemix.googleCodeJam.recycledNumbers;
import java.text.ParseException;
import java.util.ArrayList;
import tr0llhoehle.cakemix.utility.googleCodeJam.Problem;
import tr0llhoehle.cakemix.utility.googleCodeJam.SupportedTypes;
public class RNProblem extends Problem {
private int lowerBorder;
priva... |
A22992 | A22608 | 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.util.Arrays;
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 i = 0; i < t; i++) {
int n = in.nextInt();
int s = in.nextInt();
int p = in.... |
B10361 | B11769 | 0 | package codejam;
import java.util.*;
import java.io.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("in.txt"));
PrintWriter out = new PrintWriter(new File("out.txt"));
int T = Integer.parseInt(in.readLine());... | package de.johanneslauber.codejam.model;
/**
*
* @author Johannes Lauber - joh.lauber@googlemail.com
*
*/
public interface ICase {
public void setLine(int lineNumber, String lineValue);
public int getNumberOfAttributes();
}
|
B20566 | B22242 | 0 | import java.util.Scanner;
import java.io.*;
import java.lang.Math;
public class C{
public static int recycle(String str){
String[] numbers = str.split(" ");
int min = Integer.parseInt(numbers[0]);
int max = Integer.parseInt(numbers[1]);
int ret = 0;
for(int i = min; i < max; i++){
String num = i + "";
... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
public class ProblemC {
public static void main(String[] args) throws NumberFormatException, IOException{
BufferedReader reader=new BufferedReader(new FileReade... |
B12085 | B10438 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... |
import java.io.*;
import java.lang.*;
import java.math.*;
public class problem {
public BufferedWriter outf;
public BufferedWriter outft;
DataInputStream bs;
public problem(){
try{
File in = new File("in.txt");
outf = new BufferedWriter(new FileWriter("out.txt", true));
... |
B10702 | B10651 | 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 tp;
import java.io.*;
public class Numbers
{
String input[];
int n,m,g;
int no;
int ans[];
int count=0;
int j,t_c;
int a,b;
DataInputStream dis=new DataInputStream(System.in);
FileReader fr;
BufferedReader br;
Numbers() throws IOException
{
fr= new Fil... |
A11201 | A11019 | 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 fixjava;
import java.util.ArrayList;
import java.util.List;
public class Take<T> {
/** Return at most n items from the beginning of the Iterable. */
public static <T> ArrayList<T> head(Iterable<T> collection, int n) {
ArrayList<T> head = new ArrayList<T>();
int count = n;
if (n > 0)
for (T item : ... |
B20424 | B20690 | 0 | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
// static int MAX = 10000;
static int MAX = 2000000;
static Object[] All = new Object[MAX+1];
static int size( int x ) {
if(x>999999) return 7;
if(x>99999) return 6;
if(x>9999) return 5;
if(x>999) retu... | import java.io.*;
import java.util.LinkedList;
import java.util.StringTokenizer;
public class RecycledNumbers
{
public static void main(String[] args)
{
StringTokenizer st;
BufferedReader br = null;
try {
FileWriter fstream = new FileWriter("output.out");
... |
A12211 | A12767 | 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 tw.csc.gcj;
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.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
public c... |
B20734 | B20291 | 0 | package fixjava;
public class StringUtils {
/** Repeat the given string the requested number of times. */
public static String repeat(String str, int numTimes) {
StringBuilder buf = new StringBuilder(Math.max(0, str.length() * numTimes));
for (int i = 0; i < numTimes; i++)
buf.append(str);
return buf.toStr... | import java.io.*;
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[]... |
A20119 | A22973 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | import java.util.Scanner;
public class b {
/**
* @param args
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();//n cases
for (int i = 1; i <= n+1; i++) {
//for each case
int dancers = sc.nextInt();
int surprising = sc.nextInt();
int minscore... |
A10996 | A11088 | 0 | import java.util.Scanner;
import java.io.*;
class dance
{
public static void main (String[] args) throws IOException
{
File inputData = new File("B-small-attempt0.in");
File outputData= new File("Boutput.txt");
Scanner scan = new Scanner( inputData );
PrintStream print= new PrintStream(outputData);
... | import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Scanner;
public class B {
public static void main(String[] args) throws Exception {
Scanner in = new Scanner(new FileReader(new File("B.in")));
PrintWriter out = new PrintWriter(new FileWriter(... |
A10568 | A13093 | 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 com.ozan.jam;
import com.google.common.base.Preconditions;
import org.springframework.core.io.ClassPathResource;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public abstract class JamBase {
private final File inputFile;
private final File outpu... |
B21049 | B20820 | 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... | /**
* 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... |
B11327 | B13005 | 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]);
}
}
}
| /*
* recycle nums
*/
package google.code.jam;
import java.io.File;
import java.io.PrintWriter;
import java.util.Scanner;
/**
*
* @author Jake
*/
public class GoogleCodeJam {
private static int Min;
private static int Max;
private static PrintWriter out= null;
private static File input;
pri... |
B12669 | B10062 | 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.Scanner;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int cases = scan.nextInt();
scan.nextLine();
String phrase;
int i = 1;
while (scan.hasNextLine()) {
int n1 = scan.nextInt();
int n2 = scan.nextIn... |
A20934 | A21019 | 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.Scanner;
public class GoogleDancers {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
for (int i = 1; i <= n; i++) {
int N = scan.nextInt();
int S = scan.nextInt();
int p = scan.nextInt();
int count = 0;
int p2 = (p - 1) + ... |
B12085 | B12396 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Recycled {
private static String fileNameSmall = "/Users/ogokal/Downloads/C-small-attempt0.in";
private static String out... |
B10361 | B12356 | 0 | package codejam;
import java.util.*;
import java.io.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("in.txt"));
PrintWriter out = new PrintWriter(new File("out.txt"));
int T = Integer.parseInt(in.readLine());... |
import java.util.HashSet;
import java.util.Scanner;
/**
* @author Anil Kishore, India
*/
public class Qual_C
{
static int get(int x, int A, int B)
{
int r = 0;
String s =""+x;
HashSet<Integer> set = new HashSet<Integer>();
for(int i=1;i<s.length();i++)
if(s.charA... |
B12669 | B11745 | 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.HashSet;
import java.util.Set;
/**
* @author Dmitry Korolev
*/
public class Task3 {
public static void main(String[] args) throws IOException {
Reader inputReader = new FileReader("C-small-attempt0.in");
Writer outputWriter = new FileWriter("C... |
A22378 | A21851 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class CodeJam {
// public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt";
public static final String INP... | import java.util.ArrayList;
import java.util.List;
import Utils.FileHelper;
public class Gcj2012b {
private void solve(String inputPath, String filepath) {
FileHelper fHelper = new FileHelper(inputPath);
String[] inputStr= new String[fHelper.getTotalSize()];
List<String> rstList = new ArrayList<... |
A10996 | A10851 | 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 GoogleCodeJam.ed2012;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
public class QualificationB2012 {
private String inputFile;
private String outputFile;
private BufferedReader reader = null;
private BufferedWriter writer = null;
... |
B12570 | B10715 | 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.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;
public class Main {
public static void main(String[] args) {
File inputFile = new File("... |
B21968 | B20504 | 0 | import java.util.*;
import java.io.*;
public class recycled_numbers {
public static void main(String[]a) throws Exception{
Scanner f = new Scanner(new File(a[0]));
int result=0;
int A,B;
String n,m;
HashSet<String> s=new HashSet<String>();
int T=f.nextInt(); //T total case count
for (int t=1; t<=T... | import java.io.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 problem3
{
void main()
{
solve();
}
public void solve()
{
... |
B20291 | B21918 | 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[]... |
public class UniqueList {
private int[] number;
private int totalSize, size;
public UniqueList(int allocatedSize)
{
totalSize = allocatedSize;
number = new int[totalSize];
size = 0;
}
public void add(int n)
{
for (int i = 0; i < size; i++)
{
if (number[i] == n) return;
}
number[size ++] = n;... |
B10245 | B11149 | 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.*;
import java.io.*;
import java.lang.Integer;
public class C {
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(new File("C-small-attempt0.in"));
Scanner in1 = new Scanner(new File("C-small-attempt0.in"));
FileWriter fw = new FileWriter("C-smal... |
A13029 | A12678 | 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.Scanner;
public class B {
static int[][] dp; // dp[i][j]: i人ç®ã¾ã§çµãã£ãã»ãã¨jåsurprize
static void solve(int casee, Scanner sc) {
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt();
int[] t = new int[n];
for (int i = 0; ... |
A11502 | A10363 | 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.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class DancingWithTheGooglers {
/**
* @param a... |
A22360 | A20046 | 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 code.jam.quali;
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.Iterator;
class Line {
int n;
int s;
int p;
ArrayList<Integer> res;
public Line(int n, int s, int ... |
B21049 | B22088 | 0 | package it.simone.google.code.jam2012;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumber implements GoogleCodeExercise {
int a = 0;
int b = 0;
Set<Couple> distinctCouple = null;
long maxTime = 0;
private class Couple {
int x = 0;
int y = 0;
public Couple(int x, int y) {
this... | import java.io.*;
import java.util.*;
public class RecycledNumbers {
String shift(String a) {
return a.substring(1) + a.charAt(0);
}
void solve() throws Exception {
int a = nextInt();
int b = nextInt();
int length = (b + "").length();
Set<Integer> set = new HashSet<Integer>();
int ans = 0, eq = 0;
... |
B11318 | B11143 | 0 | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
int casos=1, a, b, n, m, cont;
while(t!=0){
a=sc.nextInt();
b=sc.nextInt();
if(a>b){
int aux=a;
a=b;
b=aux;
}
System.out.printf("Case #%d: ",casos... | import java.io.*;
import java.util.*;
public class RecycledNumbers {
private ArrayList<Integer> input = new ArrayList<Integer>();
public static void main(String argz[]) throws IOException{
RecycledNumbers r = new RecycledNumbers();
r.readInput();
r.generateAndCheck();
}
... |
A22191 | A21945 | 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 B
{
public static void main(String[] args) throws Exception
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int numCases = Integer.parseInt(br.readLine());
for(int i = 0; i < numCases; i++) {
solveCase(i+1, br.readLine());
... |
A12460 | A12168 | 0 | /**
*
*/
package pandit.codejam;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Scanner;
/**
* @author Manu Ram Pandit
*
*/
public class DancingWithGoogle... | import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class DancingWithTheGooglers {
/**
* @param args
*/
public static void main(String[] args) {
File file = new File("data/B-small-attempt0.in");
try {
Scanner ... |
A12113 | A10559 | 0 | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class B {
static int[][] memo;
static int[] nums;
static int p;
public static void main(String[] args)throws IOException
{
Scanner br=new Scanner(new File("B-small-attempt0.in"... | import java.util.Scanner;
public class DancingWiththeGooglers {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for (int index = 1; index <= T; index++) {
int N = in.nextInt();
int S = in.nextInt();
int p = in.nextInt();
int count = 0;
int mat... |
A20261 | A21225 | 0 | package com.gcj.parser;
public class MaxPoints {
public static int normal(int value){
int toReturn = 0;
switch (value) {
case 0 : toReturn = 0 ; break;
case 1 : toReturn = 1 ; break;
case 2 : toReturn = 1 ; break;
case 3 : toReturn = 1 ; break;
case 4 : toReturn = 2 ; break;
case 5 : toReturn = 2 ; b... | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class QualB
{
public void run()throws IOException
{
Scanner in = new Scanner(new File("b.in"));
PrintWriter out = new PrintWriter("b.out");
int nt = in.nextInt();
in.nextLine();
for(int it = 1;... |
A12544 | A10331 | 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 sample;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class SampleMain {
public static void main(String[] args) throws Exception {
String linesFile = //args[0];
"lines.txt";... |
B21049 | B20431 | 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 base;
public interface Assignment {
String solve();
}
|
A12544 | A11295 | 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 codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.PrintWriter;
public class CodeJamRunner {
private PrintWriter pw = null;
/**
* Override this to do the real stuff.
* @param inputLine
*/
protected void process( int lineNr, String inputLine )
{
... |
A22992 | A22043 | 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.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.Scanner;
public class DancingWithTheGooglers {
static Scanner sc;
public static void main(String a[]) throws FileNotFoundException
{
int n,i,res;
sc= new Scanner(n... |
B12085 | B12415 | 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.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Set;
public class Recycle {
public static void main(String[] args) ... |
B12669 | B12951 | 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 google.problems;
import google.loader.Challenge;
import google.loader.ChallengeReader;
import java.util.ArrayList;
import java.util.List;
public abstract class AbstractReader implements ChallengeReader {
private String[] lines;
private List<Challenge> challenges;
private int actualLine;
public Abstrac... |
B20291 | B21136 | 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.util.*;
import static java.lang.Math.*;
public class C {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int zz = 1; zz <= T; zz++) {
System.err.println(zz);
int A = in.nextInt();
int B = in.nextInt();
long ans = 0;
for (int n = ... |
A11135 | A10365 | 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.PrintWriter;
import java.util.Scanner;
/**
*
* @author pulasthi
*/
public class QB12 {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
PrintWriter out = new PrintWriter("b.txt");
int T = sc.nextInt();
for (int i = 0;... |
B10361 | B11281 | 0 | package codejam;
import java.util.*;
import java.io.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("in.txt"));
PrintWriter out = new PrintWriter(new File("out.txt"));
int T = Integer.parseInt(in.readLine());... | package com.google.codejam;
public class RecycledNumbers {
public int solve(int[] n){
int res = 0;
int len = getLen(n[0]);
int[] sh = new int[len-1];
for (int i = n[0]; i <= n[1]; i++) {
for (int j = 1; j < len; j++) {
int ni = shift(i, j, len);
sh[j-1] = ni;
if(ni > i && ni <= n[1]) {
bo... |
B12669 | B11971 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
public class Small_C {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
File inf;
File outf;
try{
inf= new Fi... |
B10149 | B12779 | 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.*;
import java.util.*;
import java.math.*;
/** @author Samuel Ahn */
public class C {
public static void main(String args[]) throws Exception {
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 sum... |
A11135 | A12377 | 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.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
public class Main {
private static String fileDirectory = "files/";
/**
* @param args
*/
public static void main(String[] args) {
... |
B12570 | B11327 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | package 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]);
}
}
}
|
B21207 | B20134 | 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.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.*;
/**
* @author rohitkg
*/
public class Task implements Runnable {
private static final String TASK_ID = "C-large";
private static final String IN_FILE = TASK_ID + ".in";
private static final String O... |
A21010 | A20521 | 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 DancingGooglers {
private static int numTest;
private static Scanner input;
private static PrintWriter output;
public static void main(String[] args) throws FileNotFoundException, IOException {
// Initialization of Input/Output streams
input = new Scanner... |
A10699 | A10057 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Dancing {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) ... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package google.code.jam.dancing.with.the.googlers;
/**
*
* @author Lucas
*/
public class GoogleCodeJamDancingWithTheGooglers {
/**
* @param args the command line arguments
*/
public static void mai... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.