F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
B12085 | B10492 | 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.util.Scanner;
public class TemplateClass {
protected Scanner sc;
protected BufferedWriter bw;
protected int testCases = 0;
File ficheroEntrada;
File ficheroSalida;
public TemplateClass() {
}
public TemplateClass(St... |
A22642 | A22806 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Madu
*/
import java.io.*;
public class Ex2 {
public static void main(String[] args) {
try{
FileInputStream fstream = new FileInputStream("C:/Users/Madu/Documents/NetBe... |
B12941 | B12709 | 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.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
public class C {
/**
* @param args
*/
public static String rest(ArrayList<String> list) {
String n = list.get(0);
list.remove(0);
return n;
};
public static void main... |
B21227 | B20066 | 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.*;
public class Recycle
{
int t=0,A=0,B=0;
String output="";
int count=1;
public void readFile(String fn)
{
String data="";
try{
File in=new File(fn);
BufferedReader br=new BufferedReader(new InputStreamReader(new FileInputStream(in)));
data=br.readLine();
t=Integer.parseInt(data);
while(count<=t)
{
data... |
B20856 | B21093 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Happy;
import java.io.*;
import java.math.*;
import java.lang.*;
import java.util.*;
import java.util.Arrays.*;
import java.io.BufferedReader;
//import java.io.IOException;
//import java.io.InputStreamReader;
//... | package codejam.is;
/**
* Created with IntelliJ IDEA.
* User: ofer
* Date: 4/13/12
* Time: 8:49 PM
* To change this template use File | Settings | File Templates.
*/
public abstract class TestAbstract implements Test {
private final static String newline = System.getProperty("line.separator");
@Overrid... |
A22078 | A22575 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class CodeJamB
{
public static void main(String args[]) throws Exception
{
Scanner in = new Scanner(new File("in.txt"));
BufferedWriter out = new BufferedWriter(new FileWriter("out.txt"));
int cases ... |
B20424 | B22143 | 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.util.ArrayList;
import java.util.Formatter;
import java.util.List;
import java.util.Scanner;
public class recycled {
static int A;
static int B;
static int count=0;
static int n;
private static Scanner x;
private static Formatter y;
static String newline = System.getProperty... |
B12074 | B11094 | 0 | package jp.funnything.competition.util;
import java.math.BigInteger;
/**
* Utility for BigInteger
*/
public class BI {
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger add( final BigInteger x , final BigInteger y ) {
return... | import java.io.*;
import java.util.*;
public class C {
BufferedReader ins;
PrintStream outs;
static String INPUT = "C-small-attempt0.in";
static String OUTPUT;
static {
OUTPUT = "C.out";
}
Map<String, Set<String>> map = new HashMap<String, Set<String>>();
public C(Buffer... |
B11696 | B10531 | 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 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... |
B21752 | B21748 | 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 ... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam3;
import java.io.File;
import java.io.*;
import java.util.*;
/**
*
* @author saad
*/
public class Codejam3 {
/**
* @param args the command line arguments
*/
static int convert(Inte... |
B12085 | B11218 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package google;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.uti... |
A22771 | A21399 | 0 | package com.menzus.gcj._2012.qualification.b;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class BProcessorFactory extends AbstractProcessorFactory<BInput, BOutputEntry> {
public BProcessorFactory(Str... | import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
public class source {
public static void main(String args[ ]) throws IOException {
FileInputStream fstream = new ... |
B10702 | B11991 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package googleJamCode2;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.*;
/**
*
* @author gollum1er
*/
public class Permutation {
... |
B21049 | B20968 | 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
{
static int start, end;
public static void main(String[] args) throws IOException
{
Scanner scan = new Scanner(new File("c_large.in"));
int numCases = scan.nextInt();
for (int z = 1; z <= numCases; z++)
{
... |
B11327 | B10536 | 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]);
}
}
}
| import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
public class Recycle {
// Method to Solve the Problem
public void Solve(int c ,String a , String b){
int first = Integer.parseInt(a);
int second ... |
B21207 | B20210 | 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.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
public class C {
static int[] tens = { 1, 10, 100, 1000, 10000, 100000, 1000000 };
static HashSet<Integer> set = new HashSet<Intege... |
B11327 | B12792 | 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]);
}
}
}
| import java.io.File;
import java.io.FileNotFoundException;
import java.util.HashSet;
import java.util.Scanner;
/**
* Created by IntelliJ IDEA.
* User: james
* Date: 4/14/12
* Time: 3:20 PM
* To change this template use File | Settings | File Templates.
*/
public class Recycled
{
public static void main(Strin... |
B13196 | B10308 | 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.File;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Scanner;
public class C {
public static void main(String[] args) throws Exception {
Scanner in = new Scanner(new File("input"));
System.setOut(new PrintStream("output"));
int T = in.nextInt();
for (int t = 1; t <= T... |
B21968 | B20380 | 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.*;
public class RecycledNumbers
{
public void RecycledNumbers()throws IOException
{
FileInputStream fstream = new FileInputStream("C:/Users/m.l/Desktop/C-large.in");
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(ne... |
B21227 | B20573 | 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.util.ArrayList;
import java.util.Scanner;
public class CodeJam3 {
public static void main(String[] args) {
Scanner kb=new Scanner(System.in);
int cases=kb.nextInt();
for(int i=0;i<cases;i++)
{
long count=0;
long value1=kb.nextInt();
long value2=kb.nextInt();
ArrayList<String> al=new ... |
B10149 | B12332 | 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.HashSet;
public class Solution {
public static void main(String[] args) throws IOException {
StreamTokenizer in = new StreamTokenizer(new BufferedReader (new FileReader("input.in")));
PrintWriter out = new PrintWriter(new File("output.out"));
in.nextToken();
int t = (int)... |
B21049 | B20825 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package problem.c;
import java.util.Scanner;
import java.io.*;
/**
*
* @author Jason
*/
public class ProblemC {
/**
* @param args the command line arguments
*/
public static void main(String[] args... |
B12762 | B10455 | 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 MyAllgoritmicLib;
public class SimpleNumbers {
public static boolean[] masInt;
public static void initSimpleInt(int n) { // âõîäíûå äàííûå
masInt = new boolean[n + 1];
for(int i=0; i<=n;i++){
masInt[i] = true;
}
masInt[0] = masInt[1] = false; // åñëè êòî-òî áóäåò èñïîëüçîâàòü ýòè
// çíà÷åíèÿ
... |
B12941 | B12204 | 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 com.google.codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class ContentReader {
public static ArrayList<String> getContents(String fileName) {
... |
A12273 | A12765 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Dancing
* Jason Bradley Nel
* 16287398
*/
import java.io.*;
public class Dancing {
public static void main(String[] args) {
In input = new In("input.txt");
int T = Integer.parseInt(input.... | import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.Scanner;
public class B {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
// bug eliminator
Scanner in = new Scanner(new Fi... |
A21557 | A22730 | 0 | import java.io.*;
import java.util.*;
public class DancingWithGooglers {
public static class Googlers {
public int T;
public int surp;
public boolean surprising;
public boolean pSurprising;
public boolean antiSurprising;
public boolean pAntiSurprising;
public Googlers(int T, int surp) ... | import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class GoogleDancers {
public static void main(String[] args){
try{
// Open the file that is the first
// command line parameter
FileInpu... |
B10155 | B11300 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
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.Arrays;
... |
A11201 | A10633 | 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.... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
/**
*
* @author sarwar
*/
public class problemB {
static... |
A11135 | A11350 | 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.*;
import static java.lang.Integer.*;
import static java.lang.Math.*;
public class CodeJamB {
static boolean is(int a){
return a>=0&&a<=10;
}
static int normal(int n){
int max=0;
if(n%3==0)max=n/3;
if((n+1)%3==0&&is((n+1)/3)&&is((n+1)/3-1))max=max(max,(n+1)/3);
if((n-1)%3... |
B12074 | B11482 | 0 | package jp.funnything.competition.util;
import java.math.BigInteger;
/**
* Utility for BigInteger
*/
public class BI {
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger add( final BigInteger x , final BigInteger y ) {
return... | import java.util.*;
public class Recycled {
public static void main(String[] args) {
Scanner p = new Scanner(System.in);
int tests = p.nextInt();
for(int i = 0; i<tests; i++) {
int count = 0;
boolean[] used = new boolean [1001];
Integer a = p.nextInt();
Integer b = p.nextInt();
if( b == 100... |
B21207 | B20416 | 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.FileInputStream;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class RecycledNumbers {
public static void main(String[] argv) throws Exception {
// Scanner s = new Scanner(System.in);
Scanner s = new S... |
B11421 | B11520 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Recycled {
public static void main(String[] args) throws Exception{
String inputFile = "C-small-attempt0.in... | package duyonggang;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.List;
public class RecycledNumbers {
public static int pass(int n, int a, int b)
{
if(n < 10)
return 0;
int counter = 0;
String s = Integer.toString(n);
int ... |
B20291 | B22116 | 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 googlejam;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
public class ProblemCLinear {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int numberOf... |
A10568 | A10558 | 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.FileNotFoundException;
import java.io.PrintStream;
import java.util.Scanner;
public class B {
public static void main(String[] args) throws FileNotFoundException {
Scanner scan = new Scanner(new File("B-small-attempt1.in"));
System.setOut(new PrintStream("B-small-attempt1.out")... |
A11201 | A12122 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class Main {
/**
* @param args
*/
public static void main(String[] args)
{
try{
// Open the file that is the ... |
A10568 | A11301 | 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.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
public class B{
Scanner sc=new Scanner(System.in);
int INF=1<<28;
double EPS=1e-9;
int caze, T;
int n, s, p;
int[] ts;
void r... |
B13196 | B10208 | 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.*;
import java.util.*;
public class RN {
private static String fileName = RN.class.getSimpleName().replaceFirst("_.*", "");
private static String inputFileName = "D:\\santosh\\cj12\\"+fileName + ".in";
private static String outputFileName = "D:\\santosh\\cj12\\"+fileName + ".out";
private static Sc... |
A11502 | A10046 | 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 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 ... |
A10568 | A12307 | 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.*;
import java.util.jar.JarEntry;
/**
* Created with IntelliJ IDEA.
* User: vitaly
* Date: 4/14/12
* Time: 9:24 AM
* To change this template use File | Settings | File Templates.
*/
public class Main {
public static Map<Integer, Integer> crea... |
A12211 | A12903 | 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 qual2012;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
/**
* Magicka
*/
public class B {
public static void main(String[] args) throws FileNotFoundException {
Kattio io;
// io = new Kattio(System.in, System.out);
// io = new Kattio(new FileInpu... |
B21790 | B21052 | 0 | import java.io.*;
import java.util.*;
public class C {
void solve() throws IOException {
in("C-large.in"); out("C-large.out");
long tm = System.currentTimeMillis();
boolean[] mask = new boolean[2000000];
int[] r = new int[10];
int t = readInt();
for (int cs = 1; cs... | import java.util.Scanner;
import java.util.TreeMap;
public class RecycledNumbers {
public static void main(String[]args){
Scanner sc = new Scanner(System.in);
//Read in the T int -- Test Cases
int T = Integer.parseInt(sc.nextLine());
for (int t = 1; t <= T; t++) {
int num = 0;
//START OF CODE
int a ... |
A12113 | A11564 | 0 | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class B {
static int[][] memo;
static int[] nums;
static int p;
public static void main(String[] args)throws IOException
{
Scanner br=new Scanner(new File("B-small-attempt0.in"... | package codeJam;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class DancingWithGooglers {
private static int inputLength = 1;
/**
* @param args the comm... |
B10149 | B10946 | 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 google.codejam;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Scanner;
public class Stark_C {
/**
* @param args
*/
public static int getDig(int t1){
if(t1==0) return 0;
else if(t1<10) return 1;
else if(t1<100) return 2;
else if(t1<1000) retu... |
A10699 | A10062 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Dancing {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) ... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import static java.lang.Math.abs;
import static java.lang.Math.max;
public class DancingWithGooglers {
public static void main(String[] args) throws IOException {
new DancingWithGooglers().solveAll();
}
... |
A11135 | A12787 | 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.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
public class QualifiRound2012B {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
... |
A20490 | A20856 | 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.qualification;
import java.io.File;
import java.io.IOException;
import java.util.Scanner;
public class Dancing {
/**
* @param args
*/
public static void main(String[] args) throws IOException {
String file = "input2big";
Scanner in = new Scanner(new File(file));
int tot = Integer.parseInt... |
B10485 | B12705 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.util.*;
import java.math.*;
/**
*
* @author .
*/
public class C {
public static class Num {
int number;
String num;
ArrayList<Integer> recycled;
Num(int number) {
... |
A12273 | A11175 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Dancing
* Jason Bradley Nel
* 16287398
*/
import java.io.*;
public class Dancing {
public static void main(String[] args) {
In input = new In("input.txt");
int T = Integer.parseInt(input.... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package leider.ken;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Callable;
/**
*
* @author ken
*/
class DancingAlgorithm implements Callable<String> {
private final int caseNumb... |
A22992 | A21550 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author dannocz
*/
public class InputReader {
public static Input r... | import java.io.*;
import java.util.*;
public class Googlers {
public static int surprise = 0;
public static int beatTarget = 0;
public static boolean bestScore(int totalScore, int targetScore) {
int bestNoSurprise = (int) Math.ceil(totalScore/3.0);
// If this googler beat the target score
if(bestNoSu... |
B10361 | B13144 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
public class Principal {
public static void main(String[] args) {
Reader reader = new Reader();
Case[] cases = reader.read();
try {
File file = new File("out.txt");
file.delete();
Buffered... |
A10793 | A12413 | 0 | import java.io.*;
import java.math.*;
import java.util.*;
import java.text.*;
public class b {
public static void main(String[] args) {
Scanner sc = new Scanner(new BufferedInputStream(System.in));
int T = sc.nextInt();
for (int casenumber = 1; casenumber <= T; ++casenumber) {
... |
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Scanner;
//Using the Google Collections library.
public class B {
public static void main(String [] args) throws IOException {
String inputFile = "src/B-small-attempt0.in";
Scanner in = new Scanner(new File(inputFile)... |
B20856 | B20487 | 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.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("... |
B20291 | B20435 | 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[]... |
///REMOVE ALL OUTPUT AND USE STRINGTOKENIZER!
/*
ID: mfranzs1
LANG: JAVA
TASK: RecycledNumbers
*/
import java.io.*;
import java.util.*;
public class RecycledNumbers {
static BufferedReader f;
public static void main (String [] args) throws IOException {
long unixTime = System.currentTimeMillis();
// Use Buff... |
B20566 | B22120 | 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 com.google.codejam.recycle;
import java.io.FileReader;
import java.io.IOException;
import java.io.LineNumberReader;
import java.util.LinkedList;
import java.util.List;
/**
* Class to read input file and prepare list of test cases.
* @author Sushant Deshpande
*/
public class InputReader {
/**
* Me... |
A10996 | A11902 | 0 | import java.util.Scanner;
import java.io.*;
class dance
{
public static void main (String[] args) throws IOException
{
File inputData = new File("B-small-attempt0.in");
File outputData= new File("Boutput.txt");
Scanner scan = new Scanner( inputData );
PrintStream print= new PrintStream(outputData);
... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class Main {
private static final String toRead = "/home/jean/tmp/B-small-attempt3.in";
private static final String toWrite = "/home/jean/t... |
A11135 | A11244 | 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... | /**
* Copyright 2012 Christopher Schmitz. All Rights Reserved.
*/
package com.isotopeent.codejam.lib.converters;
import com.isotopeent.codejam.lib.InputConverter;
public class StringLine implements InputConverter<String> {
private String input;
@Override
public boolean readLine(String data) {
input = data;... |
B10149 | B12006 | 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 recycledNumbers;
import java.awt.font.NumericShaper;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.S... |
B10485 | B12099 | 0 |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class Recycle
{
public static void main(String[] args)
{
/* Set<Integer> perms = getPermutations(123456);
for(Integer i: p... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.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
*/
... |
A22078 | A20076 | 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.util.Scanner;
/**
* Abdulaziz
* 4/13/12
* Problem
* <p/>
* You're watching a show where Googlers (employees of Google) dance, and then each dancer is given a triplet of scores by three judges. Each triplet of scores consists of three integer scores from 0 to 10 inclusive. The judges have very similar ... |
B10485 | B10629 | 0 |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class Recycle
{
public static void main(String[] args)
{
/* Set<Integer> perms = getPermutations(123456);
for(Integer i: p... | import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;
public class Solver2 {
public static void main(String[] args) {
new Solver2();
}
private Scanner in;
public Solver2(){
try {
in = new Scanner(new File("../Text/C-small-attempt0.in"));
} catc... |
A11135 | A13081 | 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.File;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.ArrayList;
public class B {
private String nombreInputOutput;
private BufferedReader input;
public int surprising = 0;
public B(String nombreInputOutput) {
this.nombreInputOutput = nombr... |
A10699 | A12727 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Dancing {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) ... | import java.io.*;
import java.util.Scanner;
public class DancingGoogler {
static String outputFile, inputFile;
public static void main(String[] args) throws IOException {
if (args.length != 2)
return;
inputFile = args[0];
outputFile = args[1];
// Create FileReader Object
FileReader inputFileReader =... |
B12669 | B11329 | 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 recycledNumbers;
import java.util.ArrayList;
public class test {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int a = 1111;
int b = 2222;
int result = 0;
for(int i=a;i<b+1;i++){
ArrayList<Integer> number = new ArrayList<Integer>();
Ar... |
A22378 | A21762 | 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 Q1;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
public class Dancing {
/**
* @param args
*/
public static void main(String[] args) {
//Open the file for reading
String this... |
B10231 | B11599 | 0 | import java.io.*;
class code1
{
public static void main(String args[]) throws Exception
{
File ii = new File ("C-small-attempt1.in");
FileInputStream fis = new FileInputStream(ii);
BufferedReader br = new BufferedReader(new InputStreamReader (fis));
int cases = Integer.parseInt(br.readLine());
FileOutput... | package codeJam;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class RecycledNumbers {
private static int inputLength = 1;
/**
* @param args the command ... |
B12669 | B11464 | 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.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
/*********************************************************************
* FileUtils class of static constants and basic file checking routines.
* This is the header file of constants and methods that might... |
B12570 | B11690 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | import java.io.File;
import java.io.FileNotFoundException;
import java.util.Formatter;
import java.util.HashSet;
import java.util.Scanner;
public class RecycledNumbers {
private static String solve(int A, int B) {
int count = 0;
final HashSet<Integer> seen = new HashSet<Integer>(10);
for (int n = A; n < B; n++... |
A12113 | A13202 | 0 | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class B {
static int[][] memo;
static int[] nums;
static int p;
public static void main(String[] args)throws IOException
{
Scanner br=new Scanner(new File("B-small-attempt0.in"... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;
public class DancingGooglers {
/**
* @param arg... |
B21270 | B20625 | 0 | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
public class CopyOfCopyOfMain {
static int ndigits(int n) {
return (int) (Math.log10(n) + 1);
}
static i... | package codejam;
import codejam.y12.round0.RecycledNumbers;
import utils.Jam;
/**
*
* @author Fabien Renaud
*/
public class MainEntryPoint {
public static void main(String[] args) {
Jam j = new RecycledNumbers("/home/fabien/C-large.in");
j.run();
}
}
|
B21049 | B21809 | 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.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()... |
A11135 | A10117 | 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.BufferedInputStream;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.StringTokenizer;
public class code_jam {
/**
* @param args
*/
public static void main(String[] args) {
F... |
A22191 | A20266 | 0 | package com.example;
import java.io.IOException;
import java.util.List;
public class ProblemB {
enum Result {
INSUFFICIENT,
SUFFICIENT,
SUFFICIENT_WHEN_SURPRISING
}
public static void main(String[] a) throws IOException {
List<String> lines = FileUtil.getLines("/B-large.in");
int cases = Int... | package codejam2012.qualification;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;
public class ProblemB {
public static void... |
B12115 | B12050 | 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 RecycleNum {
static int digit(int x){
int d = 0;
while( x>0 ){
d++;
x /= 10;
}
return d;
}
static int power(int x){
int n = 1;
while(x>0){
n *= 10;
x--;
}
return n;
}
static int cirNum(int n, int m){
int d = digit(n);
n = (n%power(d-m))*power(... |
A21010 | A20794 | 0 | package codejam;
import fixjava.Pair;
public class Utils {
public static long minLong(long firstVal, long... otherVals) {
long minVal = firstVal;
for (int i = 0; i < otherVals.length; i++)
minVal = Math.min(firstVal, otherVals[i]);
return minVal;
}
public static int minInt(int firstVal, int... otherVals... | import java.io.*;
import java.util.*;
public class GCJ_Q_B
{
// public static String
// public static int
// ArrayList list = new ArrayList();
// HashMap map = new HashMap();
// HashSet set = new HashSet();
// for(int i=0;i<;i++)
// for(int j=0;j<;j++)
// for(int k=0;k<;k++)
// System.out.println();
// Syste... |
A11502 | A10782 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class DanceGoogle {
public static void main( String[] args ) throws IOException {
File fileOut = new File( "B-small-attempt4.out" );
BufferedWriter writer = new BufferedWrit... |
A12570 | A10427 | 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 MyAllgoritmicLib;
import java.util.ArrayList;
public class Dejkstra {
// ---------------------------------------------------------------------------
// Àëãîðèòì Äåéêñòðû.ïîèñêà êðàò÷àéøåãî ïóòè
int v;
int infinity=Integer.MAX_VALUE; // Áåñêîíå÷íîñòü
int p= 6; // Êîëè÷åñòâ... |
B10899 | B11944 | 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.util.Scanner;
public class A {
/**
* @param args
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T,no1,no2,k=0;
A obj=new A();
T=sc.nextInt();
int cnt=0;
while(T>0)
{ cnt++;
no1=sc.nextInt();
no2=sc.nextInt();
k=0;
for(int i=no1;i<=no2... |
A11135 | A12175 | 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;
import java.util.List;
import org.apache.log4j.Logger;
public abstract class Solution implements Cloneable {
public static Logger logger = Logger.getLogger(Solution.class);
protected String result;
/**
* Set the problem to be solved
*
* @param problemDesc List<S... |
A21396 | A21530 | 0 | import java.util.*;
public class Test {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int i = 1; i<=T; i++) {
int n = in.nextInt();
int s = in.nextInt();
int p = in.nextInt();
int result = 0;
for(int j = 0; j<n; j++){
... | package gcj2012.qual;
import java.io.*;
import java.util.*;
import java.math.*;
import static java.lang.Math.*;
import static java.lang.Character.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
import static java.math.BigInteger.*;
public class B {
static final char PROB = B.class.getSim... |
A12460 | A12942 | 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... | public class P {
public static void main(String[] arg) {
//greedyPossibleTuple(new int[] {29,20,8,18, 18,21},8,2);
//greedyPossibleTuple(new int[] {8,0}, 1,1);
//greedyPossibleTuple(new int[] {23, 22, 21, 20, 29}, 8, 0);
//System.out.println(parseLine("6 2 8 29 20 8 18 18 21"));
jav... |
A20261 | A21813 | 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.udit.codeJam;
import java.io.*;
public class Gogglers
{
static DataInputStream in = new DataInputStream(new
BufferedInputStream(System.in));
static BufferedReader din = new BufferedReader( new InputStreamReader(in));
public static void main(String[] args)
{
... |
A22992 | A20176 | 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 codejam;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
public class fileHandler {
FileInputStream input;
FileOutputStream output;
BufferedReader buf;
public... |
A22378 | A22763 | 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.*;
import java.util.*;
public class googlers {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
Scanner fe = new Scanner(new FileInputStream(
"/home/gllera/Desktop/data.in"));
FileWriter fs = new FileWriter("/home/gllera/Desktop/dat... |
B10899 | B10122 | 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 com.sun.xml.internal.messaging.saaj.packaging.mime.util.LineInputStream;
import sun.tools.tree.ReturnStatement;
import javax.swing.*;
import java.io.*;
import java.util.ArrayList;
/**
* Date: 14/4/12
* Time: 9:19 AM
*/
public class GoogleFileStream {
public static ArrayList<String> getInput() throws IOE... |
B20023 | B22001 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
public class GoogleC {
public String szamol(String input){
String result="";
String... | import java.io.*;
import java.util.*;
public class newRecycledNumbers
{
static HashMap<String,String> map;
static int[] recycleNumber(int a){
String s = Integer.toString( a );
int[] arr = new int[s.length()];
arr[0] = a;
for ( int i = 1; i < s.length() ; i++)
arr[i] =... |
B22190 | B20387 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
public class Recycled {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.par... | import java.io.*;
import java.util.*;
public class recycle
{
public static void main(String[] args) throws Exception
{
int cases;
BufferedReader in=new BufferedReader(new FileReader("input.in"));
PrintWriter out=new PrintWriter(new BufferedWriter(new FileWriter("recycle.out")));
cases=Integer.parseInt(in.re... |
A11917 | A12353 | 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.*;
import java.util.*;
/**
* @author: Ignat Alexeyenko
* Date: 4/14/12
*/
public class DancingWithGooglersMain {
public static final int MAX_LENGTH = 80;
public static void main(String[] args) {
DancingWithGooglersMain main = new DancingWithGooglersMain();
main.runConsoleApp... |
A21557 | A20310 | 0 | import java.io.*;
import java.util.*;
public class DancingWithGooglers {
public static class Googlers {
public int T;
public int surp;
public boolean surprising;
public boolean pSurprising;
public boolean antiSurprising;
public boolean pAntiSurprising;
public Googlers(int T, int surp) ... | import java.io.BufferedReader;
import java.io.IOException;
public class SolverModule {
public StringBuilder process(BufferedReader in, StringBuilder builder)
throws IOException {
in.readLine();
String line = in.readLine();
int count = 1;
while (line != null) {
appendLine(line, builder,count);
count+... |
B21270 | B20605 | 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.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class recy {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int... |
B21968 | B20966 | 0 | import java.util.*;
import java.io.*;
public class recycled_numbers {
public static void main(String[]a) throws Exception{
Scanner f = new Scanner(new File(a[0]));
int result=0;
int A,B;
String n,m;
HashSet<String> s=new HashSet<String>();
int T=f.nextInt(); //T total case count
for (int t=1; t<=T... | import java.util.Scanner;
import java.io.BufferedInputStream;
import java.util.HashSet;
public class C
{
public static void main(String[] args)
{
Scanner scanner = new Scanner(new BufferedInputStream(System.in));
int n = scanner.nextInt();
for (int i = 0; i < n; i++)
{
int count = 0;
int low = scanne... |
B10245 | B13022 | 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 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;
... |
A20490 | A21839 | 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.*;
public class CodeJamB {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int t = scan.nextInt();
for (int i = 1; i <= t; i++) {
int n = scan.nextInt();
int s = scan.nextInt();
int p = scan.nextInt();
int a = 0;
int b = 0;
for (int j = 0; j ... |
B12115 | B10567 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... | package qualification;
import java.util.ArrayList;
import utils.IOHelper;
import utils.Pair;
public class RecycledNumbers
{
public static void main(String[] args)
{
try
{
String[] input = IOHelper.readFile(args[0]);
int[] results = new int[input.length];
for (int line = 0; line < input.length; line++... |
B21270 | B20070 | 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.*;
import java.util.*;
public class ProblemC {
public static void main(String[] args) {
try {
Set<Integer> alltuples = new HashSet<Integer>();
PrintWriter fout = new PrintWriter(new FileWriter("CJ"));
BufferedReader fin = new BufferedReader(new FileReader("C-large.in"));
String l;
St... |
B10361 | B11024 | 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 org.moriraaca.codejam;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.fail;
import java.io.BufferedReader;
import java.io.File;
import java.io.FilenameFilter;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.Collection;
import java.util.LinkedL... |
A22771 | A21909 | 0 | package com.menzus.gcj._2012.qualification.b;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class BProcessorFactory extends AbstractProcessorFactory<BInput, BOutputEntry> {
public BProcessorFactory(Str... | package com.utility;
public enum Constants {
BLANK(""),
SPACE_REG_EXP("\\s+"),
RESOURCES_LOCATION("/Users/sandeep/Work/WorkSpace/Sample/src/main/resources/");
private void Constants() {
}
private Constants(String constant) {
this.constant = constant;
}
private String constant;
public String ... |
A20382 | A21530 | 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 gcj2012.qual;
import java.io.*;
import java.util.*;
import java.math.*;
import static java.lang.Math.*;
import static java.lang.Character.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
import static java.math.BigInteger.*;
public class B {
static final char PROB = B.class.getSim... |
B12115 | B11135 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... | package recyclednumbers.recycler;
import junit.framework.Assert;
import org.junit.Test;
public class RecyclerTest {
@Test
public void exampleTest() {
Recycler recycler = new Recycler();
Assert.assertTrue(recycler.isRecycledPair(12345, 34512));
Assert.assertEquals(0, recycler.countP... |
B10245 | B11637 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class CRecycled {
public static void main(String[] args) throws FileNotFoundException {
Scanner in = new Scanner(new File("C-small.in"));
... |
B21752 | B21239 | 0 | package Main;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
/**
* Created with IntelliJ IDEA.
* User: arran
* Date: 14/04/12
* Time: 3:12 PM
* To change ... | package codejam;
import java.util.*;
/**
*
* @author JoeJev
*/
public class ProblemC {
Scanner scan;
public ProblemC(Scanner scan) {
this.scan = scan;
}
public void processProblem(){
int cases = scan.nextInt();
for (int m = 1; m <= cases; m++){
System.out.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.