F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
A11135 | A10412 | 0 | /**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/3/12
* Time: 11:00 AM
* To change this template use File | Settings | File Templates.
*/
import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;
import java.io.*;
import java.util.*;
import java.uti... | import java.io.*;
import java.util.*;
class GoogleDance
{
public static void main(String[] args)
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
Scanner sc=new Scanner(new InputStreamReader(System.in));
int t=sc.nextInt();
String ans[]=new String[t];
for(int i=0;i<t;i++)
{
in... |
A21557 | A21408 | 0 | import java.io.*;
import java.util.*;
public class DancingWithGooglers {
public static class Googlers {
public int T;
public int surp;
public boolean surprising;
public boolean pSurprising;
public boolean antiSurprising;
public boolean pAntiSurprising;
public Googlers(int T, int surp) ... | import java.io.*;
public class Dancing {
public static void main (String[] args) throws IOException {
BufferedReader input = new BufferedReader(new FileReader (args[0]));
FileWriter output = new FileWriter("dancingOutput.txt");
int numTests = Integer.parseInt(input.readLine());
for... |
A12544 | A12397 | 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 com.jam.google;
public class DancingWithTheGooglers {
public int count(int n, int s, int p, String ts) {
int count = 0;
String[] split = ts.split(" ");
for (String st : split) {
int t = Integer.parseInt(st);
int base = t / 3;
if (base < p-2) continue;
if (base>=p ||
... |
B10858 | B12026 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
|
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class RecycledNumbers {
private Scanner in;
private PrintWriter out;
public long output;
public int A;
publ... |
A12113 | A11176 | 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"... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package leider.ken;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.Callable;
/**
*
* @author ken
*/
interface Parser {
Map<Integer, Callable<String>> parse(String fileName) throws... |
B20291 | B21690 | 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.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... |
A20119 | A22590 | 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.dagova.dancingWithTheGooglers;
public class DancingWithTheGooglersSolver
{
private int solution;
private int bestScore;
private int surprisedTriplets;
private int numberOfGooglers;
public DancingWithTheGooglersSolver()
{
solution = 0;
}
private void checkTotalPoints(int googlerTotalPoints... |
A11502 | A13110 | 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.*;
public class better {
public static void main(String[] args) throws Exception
{
int i=0;
FileReader fin=new FileReader("B-small-attempt0.in");
BufferedReader br=new BufferedReader(fin);
FileWriter fout=new FileWriter("Output12.in");
BufferedWriter bw=new BufferedWriter(fout);
int test=I... |
B10702 | B10042 | 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 c;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class C {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
sc.nextLine();
int nbr = 1;
while (t-- > 0) {
int a = sc.nextInt();
int b = sc.nextInt();
i... |
A20730 | A22059 | 0 | import java.util.Scanner;
public class B {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int zz = 1; zz <= T;zz++){
int N = in.nextInt();
int S = in.nextInt();
int p = in.nextInt();
int x = 0;
for(int i = 0; i < N;i++){
int score = in.n... | package client;
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.StringTokenizer;
import java.math.*;
public class DancingGoogler {
public DancingGoogler() {
... |
B11421 | B11886 | 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.util.Scanner;
public class CodeJam3
{
public static void main(String[] args)
{
Scanner kb=new Scanner(System.in);
int testCases=kb.nextInt();
for(int i=0;i<testCases;i++)
{
long countValue=0;
long x1=kb.nextInt();
long x2=kb.nextInt();
for(long k=x1;k<x2;k++)
{
String s1=new L... |
A12846 | A12011 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam.common;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Lance Chen
*/
public class CodeHelper {
private static String FILE_ROOT = "D:/workspace/googlecodejam/meta";
publi... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class Main {
/**
* @param args
*/
public static void main(String[]... |
A11135 | A11322 | 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.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
Scanner scann... |
A11502 | A10089 | 0 | package template;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
public class TestCase {
private boolean isSolved;
private Object solution;
private Map<String, Integer> intProperties;
private Map<String, ArrayList<Integer>> intArrayProperties;
private Map<String, Arra... | package se.round1.problem2;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import se.round1.util.JamUtil;
public class Problem2 {
Map<Character, Character> trans = n... |
A10699 | A10072 | 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) ... | /**
* @(#)Text1.java
*
*
* @author
* @version 1.00 2012/4/14
*/
import java.util.*;
import java.io.*;
public class B {
public static int diff(int a, int b, int c) {
int max = 0;
if(Math.abs(a-b) > max) max = Math.abs(a-b);
if(Math.abs(b-c) > max) max = Math.abs(b-c);
if(Math.abs(c-a) > max) max = Math... |
B10155 | B11186 | 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.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class Prob {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(new File("C-small-practice.in"));
FileWriter fw = new FileWriter("C-small-practice.out");
int t = sc.nex... |
A11135 | A12174 | 0 | /**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/3/12
* Time: 11:00 AM
* To change this template use File | Settings | File Templates.
*/
import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;
import java.io.*;
import java.util.*;
import java.uti... | package hk.polyu.cslhu.codejam.solution.impl;
import hk.polyu.cslhu.codejam.solution.Solution;
import java.util.ArrayList;
import java.util.List;
public class StoreCredit extends Solution {
private int amountOfCredits, numOfItems;
private List<Integer> priceList;
@Override
public void setProblem(List<String> t... |
A20934 | A21599 | 0 | import java.util.*;
public class B {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
B th = new B();
for (int i = 0; i < T; i++) {
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt()... | import java.io.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 SpeakingInTongues {
/**
* The first line of the input gives the number o... |
B10245 | B13071 | 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... |
public class Couple {
int a;
int b;
String s;
public Couple(int a, int b) {
super();
this.a = a;
this.b = b;
s = String.valueOf(a) + String.valueOf(b);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getC... |
A12570 | A12019 | 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.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Scanner;
import java.util.Set;
import java.util.HashSet;
public class CodeJamB {
public static int[][] matrix;
public static boolean[][] had;
... |
A22992 | A21422 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.nio.Buffer;
import java.util.Arrays;
import java.util.Scanner;
public class DancingWithGooglers {
public static void main(String[] args) throws Exception {
BufferedWriter bufferedWriter = new BufferedWriter(new File... |
A11502 | A13167 | 0 | package template;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
public class TestCase {
private boolean isSolved;
private Object solution;
private Map<String, Integer> intProperties;
private Map<String, ArrayList<Integer>> intArrayProperties;
private Map<String, Arra... | package tr0llhoehle.cakemix.googleCodejam;
import tr0llhoehle.cakemix.utility.googleCodeJam.Solver;
public class DWGSolver implements Solver<DWGProblem> {
@Override
public String solve(DWGProblem p) {
int numberOfBestResult = 0;
int surprising = 0;
/*
* for (int sum : p.getDancerSums()) { int[] triplet =... |
A20119 | A22447 | 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.IOException;
import java.text.NumberFormat;
import java.util.List;
public class Welcome extends JamProblem {
String welc = "welcome to code jam";
public static void main(String[] args) throws IOException {
Welcome p = new Welcome();
p.go();
}
@Override
String solve... |
B20006 | B20474 | 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.PrintWriter;
import java.util.Scanner;
public class ProblemC {
public static void main(String[] args) {
final Scanner in = new Scanner(System.in);
final PrintWriter out = new PrintWriter(System.out);
final int t = in.nextInt();
for (int tt = 0; tt < t; tt++) {
final int a = in.nextInt... |
B12115 | B13220 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... | import java.util.Scanner;
public class NumberRecycling {
public static void main( String args[] ) {
new NumberRecycling();
}
public NumberRecycling() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for( int j=1; j<=T; j++ ) {
System.out.println( "Case #"+ j + ": " + doCase(sc) );
}
}... |
B11421 | B10212 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Dimitris
*/
import java.io.*;
public class trito {
File ffff;
FileReader fr;
BufferedReader br;
File fout;
FileWriter fw;
BufferedWriter bw;
public static void main(... |
B10858 | B11688 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| package codejam;
import java.io.File;
import java.util.Scanner;
import java.io.FileWriter;
import java.util.Arrays;
/**
*
* @author Abiosoft
*/
public class Recycler {
public static void main(String[] a) throws Exception {
process("Recycler.in");
}
public static void process(String filename) ... |
B11318 | B10857 | 0 | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
int casos=1, a, b, n, m, cont;
while(t!=0){
a=sc.nextInt();
b=sc.nextInt();
if(a>b){
int aux=a;
a=b;
b=aux;
}
System.out.printf("Case #%d: ",casos... | package be.mokarea.gcj.common;
public abstract class TestCase {
private final int caseNumber;
protected TestCase(int caseNumber) {
this.caseNumber = caseNumber;
}
public int getCaseNumber() {
return caseNumber;
}
}
|
A22078 | A21920 | 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 googler;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Main {
public static void main(String[] args) throws I... |
B12762 | B12286 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.File;
import java.io.FileInputStream;
import java.util.Scanner;
/**
*
* @author imgps
*/
public class C {
public static void main(String args[]) throws Exception{
int A,B;
int ctr ... | package qC;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import qB.B.Pair;
//Letfs say a pair of distinct positive integers (n, m) is recycled
//if you can obtain m by moving some digits from the back of n to the
//front without changing their order. For example, (12345, 34... |
A20490 | A22662 | 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.Scanner;
public class BS {
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
int count = in.nextInt();
for (int i = 1; i <= count ; i++) {
int n = in.nextInt();
int s = in.nextInt();
int p = in.nextInt();
int p_count = 0;
int s_count = 0;
for (... |
A20490 | A21462 | 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... | package codejam.is;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
/**
* Created with IntelliJ IDEA.
* User: ofer
* Date: 4/13/12
* Time: 8:53 PM
* To change this template use File | Settings | File Templates.
*/
public class TestRunner {
... |
B21227 | B22005 | 0 | import java.util.HashSet;
import java.util.Scanner;
public class C {
static HashSet p = new HashSet();
static int low;
static int high;
int count = 0;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int no = sc.nextInt();
for (int i = 1; i <= no; i++) {
p.clear();
lo... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Hashtable;
public class Recycled_Numbers {
public static void main(String[] args) throws IOException {
BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
String x=reader.readLine();... |
B21752 | B21277 | 0 | package Main;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
/**
* Created with IntelliJ IDEA.
* User: arran
* Date: 14/04/12
* Time: 3:12 PM
* To change ... | import java.io.BufferedReader;
import java.io.IOException;
public class CaseReader {
public static String[][] getCases(String s, int linesPerCase) {
int cases = Integer.parseInt(s.split("\n")[0]);
String[][] ret = new String[cases][linesPerCase];
String[] v = s.split("\n");
for (int i = 0;i < cases;i++)
{
... |
A10699 | A12683 | 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 topcoder;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Col... |
B21227 | B21788 | 0 | import java.util.HashSet;
import java.util.Scanner;
public class C {
static HashSet p = new HashSet();
static int low;
static int high;
int count = 0;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int no = sc.nextInt();
for (int i = 1; i <= no; i++) {
p.clear();
lo... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Writer;
import java.nio.charset.Charset;
import java.util.Array... |
B12941 | B10401 | 0 | package com.menzus.gcj._2012.qualification.c;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class CProcessorFactory extends AbstractProcessorFactory<CInput, COutputEntry> {
public CProcessorFactory(Str... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
public class Test2 {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new FileReader("in.txt"));
BufferedWriter bw = n... |
B10899 | B11566 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util... |
B10361 | B13255 | 0 | package codejam;
import java.util.*;
import java.io.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("in.txt"));
PrintWriter out = new PrintWriter(new File("out.txt"));
int T = Integer.parseInt(in.readLine());... | import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class NumberRecycling {
/**
* @... |
B11318 | B10323 | 0 | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
int casos=1, a, b, n, m, cont;
while(t!=0){
a=sc.nextInt();
b=sc.nextInt();
if(a>b){
int aux=a;
a=b;
b=aux;
}
System.out.printf("Case #%d: ",casos... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.StringTokenizer;
/**
*
*/
/**
* @author Bageshwar
*
*/
public class Recycle {
/**
* @param args
* @throws IOException
*/
public static void main(Strin... |
A20934 | A20984 | 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()... | 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... |
B12115 | B11428 | 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 codejam;
/**
*
* @author Suarabh Agarwal
*/
import java.io.*;
import java.util.Scanner;
public class Main3
{
public static void main(String args[])
{
try{
Scanner scan1 = new Scanner(new FileReader("... |
A12846 | A10871 | 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... | /**
* Created by IntelliJ IDEA.
* User: Manish
* Date: 4/14/12
* Time: 9:30 PM
* To change this template use File | Settings | File Templates.
*/
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
public class CodeJamProblemB {
public static void main(String args[]) throws Exception {
... |
B21227 | B22258 | 0 | import java.util.HashSet;
import java.util.Scanner;
public class C {
static HashSet p = new HashSet();
static int low;
static int high;
int count = 0;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int no = sc.nextInt();
for (int i = 1; i <= no; i++) {
p.clear();
lo... | package ru.bobukh.problems;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Comparator;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
/**
*
* @author anton.bobukh
*/
public class ProblemC_RecycledNumbers ... |
B10149 | B11155 | 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.BufferedInputStream;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.net.URL;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
/**
* @author vaidyasm
*/
public class Problem... |
B21049 | B21229 | 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 kjetil.codejam.qualification.recycled;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumbers {
private static final String INPUT_FILENAME = "input_r... |
A10699 | A11925 | 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 Qualification;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Log... |
B12085 | B11021 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | package org.moriraaca.codejam.recyclednumbers;
import java.util.HashSet;
import org.moriraaca.codejam.AbstractSolver;
import org.moriraaca.codejam.OutputDestination;
import org.moriraaca.codejam.SolverConfiguration;
@SolverConfiguration(parser = RecycledNumberDataParser.class, inputFileName = "ultra-large.in", outpu... |
B12941 | B11891 | 0 | package com.menzus.gcj._2012.qualification.c;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class CProcessorFactory extends AbstractProcessorFactory<CInput, COutputEntry> {
public CProcessorFactory(Str... | package gcj2012.qualification;
import java.io.File;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class C_Recycled_Numbers {
private static boolean SMALL = true;
private static String PROB... |
B12570 | B11398 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | import java.util.Scanner;
public class Recycler {
private Scanner input;
private int numTests = 0;
public static void main(String[] args) {
Scanner inp = new Scanner(System.in);
int numChar = 0;
numChar = inp.nextInt();
Recycler r = new Recycler(inp, numChar);
r.recycle();
}
public Recycle... |
A11135 | A12992 | 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.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class Dancing {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(new FileReader("dancing.in"));
PrintWriter out = new PrintWriter(new ... |
B10149 | B10121 | 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.IOException;
import java.util.*;
/**
* Date: 14/4/12
* Time: 2:02 PM
*/
public class ProblemC {
public static void main(String[] args) throws IOException {
long start = System.currentTimeMillis();
ArrayList<String> al = GoogleFileStream.getInput();
ArrayList<String> ret =... |
A12211 | A11731 | 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 de.johanneslauber.codejam.model.impl;
import de.johanneslauber.codejam.model.BaseProblem;
import de.johanneslauber.codejam.model.ICase;
import de.johanneslauber.codejam.model.IProblem;
/**
*
* @author Johannes Lauber - joh.lauber@googlemail.com
*
*/
public class DancingGooglersProblem extends BaseProble... |
B21049 | B20471 | 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 codejam.world2012.qualification.c;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
public class C {
/**
* @param args
*/
public static void ma... |
B12085 | B12908 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | package google2012;
import java.io.*;
import java.util.*;
public class RecycledNumbers {
private Map<Character, Character> dic = new HashMap<>();
protected BufferedReader reader;
protected BufferedWriter writer;
protected Scanner in;
public static BufferedReader openReader(String inputFile) th... |
B10149 | B11844 | 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 info.m3o.gcj2012.recyclednumber;
public class MainRecycledNumber {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
// String infilepath = "C:\\eclipse\\workspace\\gcjRecycledNumber\\data\\inputTest.txt";
// String infilepath = "C:\\eclipse\\git_... |
A11201 | A13001 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | package qualification.q2;
/**
* Created by IntelliJ IDEA.
* User: ofer
* Date: 14/04/12
* Time: 18:47
* To change this template use File | Settings | File Templates.
*/
public class Q2Solver {
public int solve(int n,int s,int p, int[] sums){
int res = 0;
int surprisesLeft = s;
... |
A22078 | A21528 | 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.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.StringTokenizer;
public class Cj2012_qr_b_java... |
B12669 | B12244 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package year_2012.qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.... | package com.lily.acm.googleCodeJam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashSet;
public class RecycledNumbers
{
public static int getRecyleCount(int n,int ... |
A10699 | A12427 | 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 com.google.codejam;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class Dancing {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputSt... |
B10245 | B12264 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | import java.io.*;
import java.util.*;
class ProblemC
{
public static void main(String[] args)
{
try{
// Open the file that is the first
// command line parameter
FileInputStream fstream = new FileInputStream("input.txt");
BufferedWriter out = new BufferedWriter(new FileWriter("output.txt"));
// G... |
B12669 | B10379 | 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.... |
public class ValuePairs {
int value1;
int value2;
public ValuePairs(int a,int b){
value1 = a;
value2 = b;
}
@Override
public boolean equals(Object vp){
if(!(vp instanceof ValuePairs))
return false;
return value1 == ((ValuePairs)vp).value1 && value2 == ((ValuePairs)vp).value2;
}
@Override... |
B12085 | B10546 | 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.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
public class Recycled {
private static int NN = 10010;
private static BufferedReader bf;
private static File f;
publi... |
A11917 | A10998 | 0 | package com.silverduner.codejam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
public class Dancing {
public static void main(String[] args) throws Exception {
File input = new File("B-small-attempt... | import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class BSmall
{
public static boolean getNDWithThreshold(int hs , int threshold )
{
for(int i = 10 ; i >=0 ; i--)
{
int remainder = hs - i ;
if(remainder>0)
{
int second = 0 ;
int third =... |
A11135 | A10665 | 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.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.StringTokenizer;
public class DancingWithGooglers {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
// TODO Auto-generated method ... |
A22642 | A21306 | 0 | import java.util.*;
import java.io.*;
public class DancingWithTheGooglers
{
public DancingWithTheGooglers()
{
Scanner inFile = null;
try
{
inFile = new Scanner(new File("inputB.txt"));
}
catch(Exception e)
{
System.out.println("Problem ope... | package fun.codeslam.dancers;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamRe... |
A22992 | A20432 | 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... | package qr;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class B {
public static void main(String[] args) throws FileNotFoundException {
Scanner scanner = new Scanner(new File("B-large.in"));
int tcn = scanner.nextInt();
int tc = 1;
while (tc <= tcn) {
... |
B12082 | B11706 | 0 | package jp.funnything.competition.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.apache.commons.io.IOUtils;
public class QuestionReader {
pr... |
package Qualification;
import Practice.*;
import java.util.*;
import java.io.*;
public class C {
public void ejecutar() throws Exception {
Scanner sc = new Scanner(new FileReader("/home/gomezluisj/Descargas/C.in"));
PrintWriter pw = new PrintWriter(new FileWriter("/home/gomezluisj/Descargas/C.out"))... |
A11135 | A10388 | 0 | /**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/3/12
* Time: 11:00 AM
* To change this template use File | Settings | File Templates.
*/
import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;
import java.io.*;
import java.util.*;
import java.uti... | import java.util.*;
public class DancingWithTheGooglers
{
public static void main(String []args)
{
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int i = 1; i <= T; i++)
{
System.out.print("Case #" + i + ": ");
int N = in.nextInt();
int S = in.nextInt();
int ... |
B13196 | B11013 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Q3M {
public static void main(String[] args) throws Exception {
compute();
}
private ... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
public class ProblemC {
/**
* @param args
*/
public static void main(String[] args) {
BufferedReader br = null;
BufferedWriter bw = null;
Str... |
A20119 | A21223 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | import java.io.*;
public class Qualifying_B {
public static void main(String[] args) throws Exception {
BufferedReader input = new BufferedReader(new FileReader(args[0]));
int T = Integer.parseInt(input.readLine());
for (int t = 1; t <= T; t++) {
String[] tokens = input.read... |
A11917 | A10021 | 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.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... |
A21396 | A22459 | 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.IOException;
import java.lang.reflect.Array;
import java.util.*;
public class MBHappy extends JamProblem {
Map<Integer, Integer> baseMap;
Map<Long, Integer> minMap = new HashMap<>();
int ile = 0;
void prepare() {
SetUtil.cycleSubsets(bases.size(), new SetUtil.SubsetCallBack()... |
B10245 | B11284 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | import java.io.*;
import java.util.*;
public class Solution {
public static boolean isRecycled(int n, int m){
String strN = Integer.toString(n);
String strM = Integer.toString(m);
String tmp = strN;
for(int i=0; i<strN.length(); i++){
StringBuilder tmpStr = new StringBuilder();
tmpStr.append(tmp.... |
B20856 | B21222 | 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;
//... |
public class RecycledPair {
private int lower;
private int higher;
RecycledPair() {
lower = 0;
higher = 0;
}
RecycledPair(RecycledPair other) {
lower = other.lower;
higher = other.higher;
}
public void set(int left, int right) {
this.lower = Math.min(left, right);
this.higher = Math.max(left, ... |
B10245 | B12233 | 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.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;
public class RecycledNumbers{
public static void main(String... |
B22190 | B21442 | 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... | package jp.funnything.competition.util;
import java.util.Arrays;
import java.util.Iterator;
/**
* Do NOT change the element in iteration
*/
public class Permutation implements Iterable< int[] > , Iterator< int[] > {
public static int[] fromNumber( long value , final int n ) {
final int[] data = new int[... |
B21968 | B20628 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam.y12.round0;
import utils.Jam;
import utils.JamCase;
/**
*
* @author fabien
*/
public class RecycledNumbers extends Jam {
public RecycledNumbers(String filename) {
super(filename);
}
@Over... |
A22078 | A20551 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
public class GooglersDancer {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated metho... | import java.io.*;
import java.util.*;
class dancing
{
public static void main(String[] args) throws Exception
{
BufferedReader r=new BufferedReader(new InputStreamReader(System.in));
String inp;
int i,j;
int T=Integer.valueOf(r.readLine());
for(int a=0;a<T;a++)
{
/*The first integer will be N, the nu... |
B10231 | B11428 | 0 | import java.io.*;
class code1
{
public static void main(String args[]) throws Exception
{
File ii = new File ("C-small-attempt1.in");
FileInputStream fis = new FileInputStream(ii);
BufferedReader br = new BufferedReader(new InputStreamReader (fis));
int cases = Integer.parseInt(br.readLine());
FileOutput... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
/**
*
* @author Suarabh Agarwal
*/
import java.io.*;
import java.util.Scanner;
public class Main3
{
public static void main(String args[])
{
try{
Scanner scan1 = new Scanner(new FileReader("... |
B12115 | B12530 | 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 RecycledNumbers;
import java.io.*;
import java.util.ArrayList;
/**
*
* @author Himeshi
*/
public class RecycledNumbers {
public static void main(String[] args) {
int A, B, N, pairs;
Str... |
B12762 | B11448 | 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.io.IOException;
import java.io.PrintWriter;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReade... |
A11277 | A10075 | 0 | package googlers;
import java.util.Scanner;
import java.util.PriorityQueue;
import java.util.Comparator;
public class Googlers {
public static void main(String[] args) {
int n,s,p,count=0,t;
Scanner sin=new Scanner(System.in);
t=Integer.parseInt(sin.nextLine());
int result[]=new int[t];
int ... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
public class q2 {
public static int calc(int n, int s, int p,ArrayList<Integer> scores) {
int count = 0;
int aboveAve = 0;
for(int i = 0;i < n;i++) {
if(scores.get(... |
A11917 | A13078 | 0 | package com.silverduner.codejam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
public class Dancing {
public static void main(String[] args) throws Exception {
File input = new File("B-small-attempt... |
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class Dance {
Scanner in;
BufferedWriter out;
Dance(String input, String output) throws Exception {
in = new Scanner(new File(input));
FileWriter fs... |
B10231 | B10419 | 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.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class MainClass {
/**
* @param args
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
Scanner sc = new Scanner(new File("C-small-attempt0.in"));
Pri... |
A10996 | A10995 | 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.util.Scanner;
public class DancingWiththeGooglers {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int T = Integer.parseInt(sc.nextLine());
int r[] = new int[T];
for (int i = 0; i < T; i++) {
int N = sc.nextInt();
int S = sc.nextInt();
int p = sc.nextI... |
A20490 | A21925 | 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... | package codejam;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Gedion Moyo
*/
public class dance {
/**
* @param args the command line arguments
*/
s... |
A11917 | A12461 | 0 | package com.silverduner.codejam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
public class Dancing {
public static void main(String[] args) throws Exception {
File input = new File("B-small-attempt... | import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.HashMap;
import java.util.Scanner;
public class P2 {
static Scanner sc;
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated meth... |
B12570 | B12799 | 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 quialification;
import base.Base;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
/**
* Created with IntelliJ IDEA.
* User: babulya
* Date: 14.04.12
* Time: 19:45
* To change this template use File | Settings | File Templates... |
A20382 | A22459 | 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.IOException;
import java.lang.reflect.Array;
import java.util.*;
public class MBHappy extends JamProblem {
Map<Integer, Integer> baseMap;
Map<Long, Integer> minMap = new HashMap<>();
int ile = 0;
void prepare() {
SetUtil.cycleSubsets(bases.size(), new SetUtil.SubsetCallBack()... |
B20856 | B21454 | 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;
//... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import util.MyUtil;
public class ProblemC {
/**
* @param args
* @throws IOException
* @throws NumberFormatException
*/
... |
B20566 | B22071 | 0 | import java.util.Scanner;
import java.io.*;
import java.lang.Math;
public class C{
public static int recycle(String str){
String[] numbers = str.split(" ");
int min = Integer.parseInt(numbers[0]);
int max = Integer.parseInt(numbers[1]);
int ret = 0;
for(int i = min; i < max; i++){
String num = i + "";
... | package qualification_2012;
import java.io.File;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
public class C {
public void run() {
try {
Scanner in = new Scanner(new File("C.in"));
PrintWriter out = new PrintWriter(new File("C.txt"));
int T = in.nextInt();
for ... |
B11318 | B12075 | 0 | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
int casos=1, a, b, n, m, cont;
while(t!=0){
a=sc.nextInt();
b=sc.nextInt();
if(a>b){
int aux=a;
a=b;
b=aux;
}
System.out.printf("Case #%d: ",casos... | package jp.funnything.competition.util;
public class Prof {
private long _start;
public Prof() {
reset();
}
private long calcAndReset() {
final long ret = System.currentTimeMillis() - _start;
reset();
return ret;
}
private void reset() {
_start = Sys... |
B21049 | B21714 | 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.math.BigInteger;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class C {
private static Scanner sc;
public static void main(String[] args) {
sc = new Scanner(System.in);
int t = sc.nextInt();
for (int i = 0; i < t; i++) System.out.printf("Case #%d: %s\n", i + 1... |
A20934 | A21342 | 0 | import java.util.*;
public class B {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
B th = new B();
for (int i = 0; i < T; i++) {
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt()... | import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
class CodeJamTools
// http://snippets.dzone.com/posts/show/1335
{
public static String readFileAsString(String filePath) {
byte[] buffer = new byte[(int) new File(filePath).length()];
Buffere... |
A20382 | A22785 | 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... | package google.contest.A;
import google.loader.Challenge;
import google.problems.AbstractChallenge;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AChallenge extends AbstractChallenge implements Challenge {
private Strin... |
B10361 | B12278 | 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.*;
public class C {
public static void main (String [] arg) {
int [][] store = new int [2000010][7];
for (int i = 1; i<store.length; ++i) {
int ptr = 0;
int j = rotate(i);
while (j != i) {
if (j > i) store[i][ptr++] = j;
j = rotate(j);
}
}
Scanner sc = new Scanner(System... |
B21227 | B20821 | 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.util.Scanner;
import java.util.HashSet;
import java.io.FileWriter;
public class RecyclingNumbers {
public static void main(String... args) {
RecyclingNumbers obj = new RecyclingNumbers();
obj.run();
}
public void run() {
try ... |
A20261 | A20513 | 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... | package com.googlerese.file;
public class GooglersBean {
private int numGooglers;
private int surprising;
private int result;
private int[] scores = new int[100];
public int getNumGooglers() {
return numGooglers;
}
public int getSurprising() {
return surprising;
}
... |
B20291 | B20595 | 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[]... | package be.mokarea.gcj.recyclednumbers;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
import be.mokarea.gcj.common.TestCaseReader;
public class RecycledNumbersTestCaseReader extends
TestCaseReader<RecycledNumbersTestCase> {
private final... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.