F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
B21270 | B20718 | 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 midnighter.googlejam.y2012;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class QualificationC
{
static final String inFileName = "inputs/C-large.in";
static final String outFileName = "ou... |
B10899 | B11127 | 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(... | package codejam;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.*;
public class Third {
public static void main(String[] args) throws FileNotFoundException {
String path = ClassLoader.getSystemClassLoader().getResource("codejam/").getPath();
... |
B21270 | B21823 | 0 | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
public class CopyOfCopyOfMain {
static int ndigits(int n) {
return (int) (Math.log10(n) + 1);
}
static i... | import java.util.Scanner;
/**
*
* @author Yasura
*/
public class C {
public static void main(String[] args) {
Scanner scanInt = new Scanner(System.in);
int noOfCases = scanInt.nextInt();
int count, length, A, B, tmp, base, invBase;
for (int i = 0; i < noOfCases; i++) {
... |
A11135 | A10082 | 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 qualificationRound;
public class Dancing {
/**
*
* @param N
* Number of Googlers
* @param S
* number of surprising triplets of scores
* @param P
*
* @param Ti
* the total points of the Googlers
*
* @return what is the maximum number of Googlers that c... |
B21790 | B20276 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package solution;
import com.sun.xml.internal.ws.server.InvokerTube;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Vector;
/**
*
* @author Aditya
*/
import j... |
B11421 | B12083 | 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 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[... |
B20291 | B21615 | 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.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Scanner;
public class C {
static long[] ten;
public static void main(String[] args) throws IOException... |
A12113 | A10637 | 0 | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class B {
static int[][] memo;
static int[] nums;
static int p;
public static void main(String[] args)throws IOException
{
Scanner br=new Scanner(new File("B-small-attempt0.in"... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
//Importing Java.io package classes to perform file management operations
//DANCE OF GOOGLERS
public class Da... |
A21557 | A22179 | 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.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class B {
PrintWriter out;
public void read() throws IOException {
BufferedReader br = new BufferedReader(new File... |
B12085 | B11178 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | import java.io.*;
import java.util.*;
import java.lang.*;
class Source2
{
public static void main(String[] args) throws IOException
{
String s,word,buffer;
FileReader input = new FileReader("C-small.in");
BufferedReader in = new BufferedReader(input);
File file = new File("C-small.out");
BufferedWriter ... |
A11917 | A10576 | 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... | package codejam2012.qualification.b;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class Round {
private static Logger log = LoggerFactory.getLogger(Round.class);
private final List<Integer> totals;
private final Memory memory;
public Round(List<Integ... |
A22078 | A22587 | 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 qualifiers;
import java.io.*;
import java.util.*;
import java.util.concurrent.*;
public class QualifierB {
class Task implements Runnable {
private int num;
private String line;
public Task(int num, String line) {
this.num = num;
this.line = line;
}
@Override
public void run() {
String... |
A10699 | A11140 | 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;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class Googlers {
public static void main(String[] args) throws IOException {
final Scanner reader = new Scanner(new File("in.txt"));
final FileWriter writer = new FileWr... |
B10361 | B11898 | 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 ch7.rec;
import java.util.HashSet;
import java.util.Scanner;
public class Recycled {
static HashSet p = new HashSet();
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();
... |
A22992 | A21346 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author dannocz
*/
public class InputReader {
public static Input r... | import java.util.*;
import java.io.*;
public class Qual2012 {
public static void lame() {
try {
FileReader fr = new FileReader("input.txt");
BufferedReader reader = new BufferedReader(fr);
PrintWriter writer = new PrintWriter("output.txt");
HashMap<String,String> dictionary = new HashMap<String,St... |
B10485 | B11337 | 0 |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class Recycle
{
public static void main(String[] args)
{
/* Set<Integer> perms = getPermutations(123456);
for(Integer i: p... | import java.util.Scanner;
public class Main extends AbstractCodeJam {
@Override
protected Problem readProblem(Scanner scan) {
ProblemSample pb = new ProblemSample();
// PARAMETRES A LIRE !!!
pb.setA(scan.nextInt());
pb.setB(scan.nextInt());
scan.nextLine();
retu... |
B21752 | B21556 | 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.round1;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;
public class ProblemC {
public static void main(String[] args) throws Exception {
BufferedReader bufferedReader = new Buffe... |
A22078 | A22632 | 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.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... |
A11201 | A11796 | 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 ex2;
import java.util.Scanner;
public class main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
for(int i = 0; i < n; i++) {
int g = in.nextInt(); // participants
int su = in.nextInt(); // anomalies
int s = in.nextInt(); // note maximu... |
A21557 | A20721 | 0 | import java.io.*;
import java.util.*;
public class DancingWithGooglers {
public static class Googlers {
public int T;
public int surp;
public boolean surprising;
public boolean pSurprising;
public boolean antiSurprising;
public boolean pAntiSurprising;
public Googlers(int T, int surp) ... | package gcj2012qual;
import java.io.*;
import java.util.*;
public class Dancing {
/**
* @param args
*/
public static void main(String[] args) throws Exception{
// TODO Auto-generated method stub
Scanner input = new Scanner(new File("B-large.in"));
PrintWriter output = new PrintWriter(new FileWriter("ou... |
B12762 | B10841 | 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 nithin.codejam;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Solution {
static int valid_pairs[][];
static int no_valid_pairs=0;
public static void main(String args[]) throws IOException
{
BufferedReader br=ne... |
A10996 | A10177 | 0 | import java.util.Scanner;
import java.io.*;
class dance
{
public static void main (String[] args) throws IOException
{
File inputData = new File("B-small-attempt0.in");
File outputData= new File("Boutput.txt");
Scanner scan = new Scanner( inputData );
PrintStream print= new PrintStream(outputData);
... | import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class main {
public static void main(String[] args) throws FileNotFoundException {
Scanner sc = new Scanner(System.in);
//Scanner res = new Scanner( new File("/home/loic/INF422/workspace/CodeJam1/bin/Result.txt")... |
A20934 | A20903 | 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 jam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.Map;
import java.util.TreeMap;
public class Jam2 {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new Fi... |
B20006 | B20820 | 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 {
... | /**
* 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... |
B21227 | B20492 | 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.Scanner;
import java.io.*;
public class Pair {
public static int a, b, l;
public static boolean inr(String x) {
int t = Integer.parseInt(x);
if ((t + "").length() != l) return false;
if (t <= b && t >= a) {
return true;
}
else return false;
}
public static String t... |
B12115 | B11182 | 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.io.*;
public class RecycledNumbers {
/**
* @param args
*/
public static void main(String[] args) {
try {
FileInputStream fstream = new FileInputStream("CProblem/C-small-attempt2.in");
// Get the object of DataInputStream
DataInputStream in = new DataInputStream(fstream);
BufferedReader... |
A10568 | A12400 | 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.util.Arrays;
import java.util.Scanner;
public class BSmall {
static GoogleanScore[] allScores = new GoogleanScore[31];
static int T, S, N, p, sums[];
// static GoogleanScore[] scores;
static Scanner scanf;
public static void main(Strin... |
A12846 | A13227 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam.common;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Lance Chen
*/
public class CodeHelper {
private static String FILE_ROOT = "D:/workspace/googlecodejam/meta";
publi... | import java.io.File;
import java.util.Scanner;
public class surprising {
public static int solve(String input)
{
String[] inputs = input.split(" ");
int count = Integer.parseInt(inputs[0]);
int surprises = Integer.parseInt(inputs[1]);
int best = Integer.parseInt(inputs[2]);
int[] scores = new... |
A11277 | A11227 | 0 | package googlers;
import java.util.Scanner;
import java.util.PriorityQueue;
import java.util.Comparator;
public class Googlers {
public static void main(String[] args) {
int n,s,p,count=0,t;
Scanner sin=new Scanner(System.in);
t=Integer.parseInt(sin.nextLine());
int result[]=new int[t];
int ... | import java.io.*;
import java.util.*;
public class B{
public static void main(String[] args) throws Exception{
BufferedReader fin = new BufferedReader(new FileReader("B.txt"));
PrintWriter fout = new PrintWriter(new FileWriter("Bout.txt"));
String s = fin.readLine();
int t = Integer.parseInt(s);
s = fin.re... |
A12113 | A12190 | 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 codejam2012;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Scanner;
class ProbB{
public static void main(String[] args) throws FileNotFoundException{
File in;
File out;
... |
A20934 | A20373 | 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 sholay;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.... |
A22771 | A20872 | 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.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
public class qb {
public static void main(String [] args)
{
String fileName = "B-large.in";
try{
FileReader fr = new FileReader(fileName);
BufferedReader br = new BufferedReader(fr);
... |
B13196 | B10873 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Q3M {
public static void main(String[] args) throws Exception {
compute();
}
private ... | package de.at.codejam.problem3.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.StringTokenizer;
import de.at.codejam.problem3.Problem3Case;
import de.at.codejam.util.AbstractInputFileParser;
import de.at.codejam.util.TaskStatus;
public cla... |
B22190 | B20495 | 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... | //saurabh
import java.io.*;
import java.util.*;
public class Recycle
{
public static void main(String args[]) throws IOException
{
Recycle ob=new Recycle();
int T,A,B;
Scanner c= new Scanner(new File("Recycle.txt"));
T=c.nextInt();
int ans[]=new int[T];
for(int i=0;i<T;i++)
{
A=c.nextInt();
B=c... |
A10793 | A11961 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
class Case {
public int N;
public int[] t;
public int S;
public int P;
public Case(int n... |
A22992 | A20772 | 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 qualification.Dancing;
import java.io.*;
public class IO {
/**
* Reads a line of text from the input.
*
* @return The text entered. @comp Best and worst case are O(U) where U is
* the complexity of BufferedReader.readLine method for the input.
*/
public static String readln()... |
A13029 | A12394 | 0 | import java.util.List;
public class Case implements Runnable {
private int id;
private String output;
private int n;
private int s;
private int p;
private List<Integer> g;
public Case(int id) {
this.id = id;
}
public Case(int id, int n, int s, int p, List<Integer> g) {
super();
this.id = id;
this... |
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Scanner;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Akash Agrawal
*/
public class DWG {
public static void main(String [] args) ... |
B10899 | B11901 | 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.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashMap;
public class GCJC {
static HashMap<Integer,Integer> map = new HashMap<Integer,Integer>();
public static void main(String[] args) {
try {
FileReader i... |
B12085 | B11615 | 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 quiz2012.quiz3;
import java.util.HashSet;
import java.util.Set;
import domain.QuizSolver;
import domain.QuizTestCaseInput;
import domain.QuizTestCaseOutput;
public class Quiz3Solver implements QuizSolver {
@Override
public QuizTestCaseOutput solve(QuizTestCaseInput testCaseInput) {
Quiz3TestCaseInput inp... |
B12074 | B11783 | 0 | package jp.funnything.competition.util;
import java.math.BigInteger;
/**
* Utility for BigInteger
*/
public class BI {
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger add( final BigInteger x , final BigInteger y ) {
return... | package com.gcj2012.qr;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
public class ProblemC {
private int caseNum = -1;
private ArrayList<Case> testCases = new ArrayList<Case>();
private class Pair{
private int m;
private int n;
}
priv... |
A12544 | A12330 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.*;
import java.util.*;
/**
*
* @author Alex
*/
public class GooglePartay
{
public static void main(String sArgs[]) throws IOException
{
Scanner oScan = new Scanner(new File... |
B11696 | B12432 | 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 glycine.gcj2012.qr;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public class ProblemC {
private static Set<String> set = new HashSet<String>();
private static void count... |
B20006 | B22088 | 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.*;
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;
... |
B11421 | B12702 | 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 cj;
import java.io.IOException;
import java.io.FileReader;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.FileWriter;
import java.util.List;
import java.util.ArrayList;
import java.util.Scanner;
public class Utils {
public static int[] toInts(String str, String sep) {
Str... |
A12113 | A11897 | 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 com.google.codejam.util;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
public class CodeJamOutputFile extends File {
/**
*
*/
private static final long serialVersionUID = -6971460798309687528L;
private FileWriter writer;
private Boolean caseZero = false;
public CodeJ... |
B11361 | B12571 | 0 | import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
public class C{
Scanner sc=new Scanner(System.in);
int INF=1<<28;
double EPS=1e-9;
int caze, T;
int A, B;
void run(){
T=sc.n... | import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
Scanner sc = new Scann... |
A22378 | A20051 | 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.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;
public class B {
static StringTokenizer st;
static BufferedReader br;
static PrintWriter pw;
public static void main(String[] args) throws IOException {
br = new Bu... |
B10245 | B10326 | 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.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map.Entry;
import java.util.Set;
public class CodeJam
{
private Set<Integer> generateCombination(Inte... |
A21396 | A21150 | 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.util.*;
import java.io.*;
public class Dancer
{
public static void main(String[] args)
{
Scanner in = new Scanner(new BufferedInputStream(System.in));
int T = in.nextInt();
for(int i = 0; i < T; i++)
{
int N = in.nextInt();
int S = in.nextInt();
int p = in.nextInt();... |
A22771 | A21706 | 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 javax.swing.*;
import java.util.Scanner;
import java.io.*;
class ProblemB
{
public static void main (String []sdvv) throws IOException
{
int cases=0, N, S, p, normal, surprise, number, total;
String palabra="";
Scanner sc;
PrintWriter es;
try
{
sc = new Scanner(new File("Blarge.IN"));
es = ... |
B21270 | B20683 | 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.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class RecycledNumbers {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
Scanner sc = new Scanne... |
A20261 | A22364 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.util.Scanner;
/**
*
* @author leonardo
*/
public class Dance {
static boolean canBeSurprising(int x1, int x2, int x3) {
if (x1 > 10 || x2 > 10 || x3 > 10)
ret... |
A12570 | A12477 | 0 | package util.graph;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
public class DynDjikstra {
public static State FindShortest(Node start, Node target) {
PriorityQueue<Node> openSet = new PriorityQueue<>();
Set<Node> closedSet = new HashSet<>();
openSet.add... | import java.util.*;
import java.io.*;
class DancingWithTheGooglers{
Scanner input;
PrintWriter output;
StringBuilder answer = new StringBuilder();
public static void main(String[] args){
DancingWithTheGooglers app = new DancingWithTheGooglers();
app.openInput(args[0]+".in");
app.setOutput(args[0]+".out");
... |
A22642 | A20130 | 0 | import java.util.*;
import java.io.*;
public class DancingWithTheGooglers
{
public DancingWithTheGooglers()
{
Scanner inFile = null;
try
{
inFile = new Scanner(new File("inputB.txt"));
}
catch(Exception e)
{
System.out.println("Problem ope... | import java.awt.Point;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
public class Prob3 {
private static String doAlgorithm(String[] lines) {
StringBuilder ans = new StringBu... |
B12941 | B12249 | 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;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
public class Recycle {
/**
* @param args
* @throws IOException
* @throws NumberFormatExcept... |
B10702 | B13255 | 0 | import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Recycle {
private static HashMap<Integer, HashSet<Integer>> map = new HashMap<Integer, HashSet<Integer>>();
private static HashSet<Integer> toSkip = new HashSet<Integer>();
/**
* @param args
*/
public static void main(S... | import java.io.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 {
/**
* @... |
B20006 | B20431 | 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 {
... | package base;
public interface Assignment {
String solve();
}
|
A21396 | A21337 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
public class ProblemB {
public static void main (String[] args) throws Exception{
BufferedReader fin = new BufferedReader(new FileReader("E:/B-large.in"));
String line = fin.readLine();
BufferedW... |
A11277 | A10281 | 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.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author home
*/
publi... |
A12460 | A10930 | 0 | /**
*
*/
package pandit.codejam;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Scanner;
/**
* @author Manu Ram Pandit
*
*/
public class DancingWithGoogle... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
/**
*
*/
/**
* @author antonio081014
* @time: Apr 13, 2012, 5:01:31 PM
*/
public class Main {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
... |
A20382 | A21150 | 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.util.*;
import java.io.*;
public class Dancer
{
public static void main(String[] args)
{
Scanner in = new Scanner(new BufferedInputStream(System.in));
int T = in.nextInt();
for(int i = 0; i < T; i++)
{
int N = in.nextInt();
int S = in.nextInt();
int p = in.nextInt();... |
A22771 | A21181 | 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... | /**
* Copyright 2012 Christopher Schmitz. All Rights Reserved.
*/
package com.isotopeent.codejam;
import com.isotopeent.codejam.lib.SolverBase;
import com.isotopeent.codejam.lib.Utils;
import com.isotopeent.codejam.lib.converters.IntArrayLine;
public class Solver extends SolverBase<int[]> {
private static final ... |
B21270 | B20624 | 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 utils;
/**
*
* @author Fabien Renaud
*/
public class StopWatch {
private long startTime = -1;
private long stopTime = -1;
private boolean running = false;
public StopWatch start() {
startTime = System.currentTimeMillis();
running = true;
return this;
}
public StopWatch stop() {
... |
B21049 | B21925 | 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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;
/**
*
* @author Anirban
*/
public class RecycledNumbersLarge {
static int MAXN = 2000000;
static int arr[] = new int[MAXN + 1];
public static boole... |
A20934 | A22567 | 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.*;
public class googleJam2 {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
BufferedReader reader = null;
PrintWriter writer = null;
try{
reader = new BufferedReader(new FileReader("B-large.in"));
int numInputs = Inte... |
A20382 | A21337 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
public class ProblemB {
public static void main (String[] args) throws Exception{
BufferedReader fin = new BufferedReader(new FileReader("E:/B-large.in"));
String line = fin.readLine();
BufferedW... |
A12113 | A10532 | 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 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;
}
... |
A12544 | A10119 | 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... | import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
/**
* Date: 14/4/12
* Time: 10:43 AM
*/
public class ProblemB {
public static void main(String[] args) throws IOException {
ArrayList<String> al = GoogleFileStream.get... |
B10899 | B12202 | 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(... | package com.archu.contest;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashSet;
public class RecycledNum
{
/**
* @param args
*/
public static void main(String[] args)
{
File inputFile = null;
File... |
A20490 | A21125 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package dancinggooglers;
import java.io.*;
/**
*
* @author Oscar
*/
public class DancingGooglers {
public static String resolver(String[] parametros) {
int num = Integer.parseInt(parametros[0]);
... |
B12570 | B11968 | 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.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;
import java.util.StringTokenizer;
public class CodeJam3 {
private static HashMap<Character, Character> map = new HashMap<Character, Character>();
private static ArrayList<String> results = new ArrayList<S... |
B12074 | B11524 | 0 | package jp.funnything.competition.util;
import java.math.BigInteger;
/**
* Utility for BigInteger
*/
public class BI {
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger add( final BigInteger x , final BigInteger y ) {
return... | package wangshu.codejam.google.com;
import java.io.File;
import java.io.FileWriter;
import java.util.Arrays;
import java.util.Scanner;
import java.lang.*;
public class QC {
public static long calculateNumber(int A, int B){
int size = B-A+1; // Number of integers between A and B
int A1; // Auxiliary variabl... |
A11502 | A12063 | 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 util;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class MyUtil {
public static BufferedReader getReader(String filename){
try {
return new BufferedReader(ne... |
A20934 | A20480 | 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()... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.*;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
/**
*
* @author Sagar
*/
public class Dancing_With_the_Googlers
{
Map m;
int no_of_test_cases = 0;
StringBuff... |
B12669 | B12211 | 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 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... |
B20424 | B20485 | 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.util.*;
public class Main{
static int power(int d)
{
if(d== 0) return 1;
else if(d%2 == 0)
{
int a = power(d/2);
return a*a;
}
else
{
int a = power(d/2);
return a*a*10;
}
}
public static void main(String [] args)
{
Scanner in = new Scanner(System.in);
int T = in.nextInt(... |
B10155 | B11739 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
/**
*
* @author eblanco
*/
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
impo... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Hashtable;
public class C {
ArrayList<String > result=new ArrayList<String>();
public void op(String A,String B)
{
Hash... |
A12570 | A12981 | 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.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
public class GJ_QR_B {
public static int solve(int N, int S, int p, int[] t){
int[][] s = new int[31][2];
for (int i=0; i<31; i++){
... |
B22190 | B21647 | 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.File;
import java.io.FileNotFoundException;
import java.util.*;
public class GoogleC {
public static void main(String[] args) throws FileNotFoundException{
Scanner scan = new Scanner(new File("B-small.txt"));
//finit2();
int n = scan.nextInt();
for (int i = 0; i < n; i++){
ht.clear();
Sys... |
A12544 | A12854 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication3;
import java.io.*;
import java.math.*;
import java.util.*;
public class Dance {
public static final String INPUT = "dance";
@SuppressWarnings("unchecked")
private static void solv... |
A13029 | A11989 | 0 | import java.util.List;
public class Case implements Runnable {
private int id;
private String output;
private int n;
private int s;
private int p;
private List<Integer> g;
public Case(int id) {
this.id = id;
}
public Case(int id, int n, int s, int p, List<Integer> g) {
super();
this.id = id;
this... | class CodeJam2012 {
public static void main(String[] args) {
String[] input = "100 3 1 5 15 13 11 3 0 8 23 22 21 2 0 4 9 8 2 0 4 16 4 2 0 8 20 5 1 0 6 7 1 0 4 17 3 1 4 25 9 8 3 1 5 12 12 11 3 0 6 6 12 8 2 0 10 26 26 3 0 8 21 21 1 1 0 3 6 3 0 10 2 28 10 2 1 3 5 6 3 3 4 18 8 3 1 0 9 23 1 0 4 9 3 3 0 4 24 21 3 3 ... |
A20261 | A21722 | 0 | package com.gcj.parser;
public class MaxPoints {
public static int normal(int value){
int toReturn = 0;
switch (value) {
case 0 : toReturn = 0 ; break;
case 1 : toReturn = 1 ; break;
case 2 : toReturn = 1 ; break;
case 3 : toReturn = 1 ; break;
case 4 : toReturn = 2 ; break;
case 5 : toReturn = 2 ; b... | import java.io.*;
import java.util.Arrays;
import java.util.Comparator;
public class Qualify {
public static void main(String[] args) {
try {
BufferedReader reader = new BufferedReader(new FileReader(new File("B-small-attempt3.in")));
int cases = Integer.parseInt(reader.readLine());
for (int d = 0; d < ca... |
A12460 | A13218 | 0 | /**
*
*/
package pandit.codejam;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Scanner;
/**
* @author Manu Ram Pandit
*
*/
public class DancingWithGoogle... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.StringTokenizer;
public class dancers {
/**
* @param args
*/
public static void main(String[] args) throws IOException
{
// TODO Auto-generated method stub
BufferedReader br = new BufferedReader(new File... |
A11201 | A12120 | 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.util.*;
public class Dancing {
static int[] topS;
static int[] topN;
public static void main(String[] args){
Scanner reader = new Scanner(System.in);
fill();
int times = reader.nextInt();
for(int k = 1; k <= times; k++){
int n = reader.nextInt();
int s = reader.nextInt();
int p = reader... |
A12544 | A11765 | 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... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Shell {
private static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
private static final String ERROR = "Error!";
private static final String ERROR_INVALID_INT =
... |
B20734 | B21740 | 0 | package fixjava;
public class StringUtils {
/** Repeat the given string the requested number of times. */
public static String repeat(String str, int numTimes) {
StringBuilder buf = new StringBuilder(Math.max(0, str.length() * numTimes));
for (int i = 0; i < numTimes; i++)
buf.append(str);
return buf.toStr... | package inam.qual;
import java.io.File;
import java.io.FileInputStream;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class C {
public void go() {
Scanner in = new Scanner(System.in);
int cc = in.nextInt();
for (int c = 1; c <=... |
A20119 | A20757 | 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,... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package dancing.with.the.googlers;
import java.io.*;
import java.util.logging.Level;
import java.util.logging.Logger;
public class DancingWithTheGooglers {
static int numberOfTests;
static int[] testResults;
... |
B21207 | B21206 | 0 | /*
* Problem C. Recycled Numbers
*
* Do you ever become frustrated with television because you keep seeing the
* same things, recycled over and over again? Well I personally don't care about
* television, but I do sometimes feel that way about numbers.
*
* Let's say a pair of distinct positive integers (n, m) ... | package google.codejam.commons;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class Utils {
public static String[] readFromFile(String fileName... |
B11327 | B10831 | 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.InputStreamReader;
import java.util.HashMap;
public class RecycledNumber {
public static void main(String[] args) {
try {
FileInputStream fstream = new FileInputStream(args[0]);
DataInputStream in... |
A22771 | A21915 | 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.*;
import java.util.*;
public class ProblemB
{
public static void main(String[] args) throws Exception
{
final String base = "B-large";
BufferedReader reader = new BufferedReader(new FileReader(base+".in"));
BufferedWriter writer = new BufferedWriter(new FileWriter(base+".out"));
reader.readLi... |
A21396 | A23033 | 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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
public class DancingWithTheGooglers
{
static HashMap<Integer, Integer[]> absoluteMap = new HashMap<Integer, Integer[]>();... |
A12273 | A10741 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Dancing
* Jason Bradley Nel
* 16287398
*/
import java.io.*;
public class Dancing {
public static void main(String[] args) {
In input = new In("input.txt");
int T = Integer.parseInt(input.... | package dancing;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;
public cl... |
B10149 | B10230 | 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 com.google.code;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.Reader;
/**
* @author Wellington Tadeu dos Santos [wellsantos@wellsantos.com]
*/
public class ProblemC {
boolean endOfLine;
Reader reader;
Appendable writer;
public ProblemC(Reader in, Appendable out) thr... |
B21790 | B21885 | 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.HashSet;
import java.util.Scanner;
public class C_Recycled {
static boolean recycled (String n, String B, String i) {
return (n.compareTo(i) < 0) && (i.compareTo(B) <= 0);
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for (int cas ... |
A20490 | A20686 | 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.*;
import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.text.DecimalFormat;
/**
*
*
*/
public class B {
public static void main(String[] args) {
try {
Scanner scanner = (new Scanner(new File("c:/input.txt")));
int N = s... |
B12085 | B11073 | 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 fixjava;
import java.util.ArrayList;
/**
* String splitter, this fixes the problem that String.split() has of losing the last token if it's empty. It also uses
* CharSequences rather than allocating new String objects.
*/
public class Split {
/**
* String splitter, this fixes the problem that String.sp... |
A10793 | A10175 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class GoogleDancing {
public static void main(String [] args) throws IOException {
Scanner fileScan = new Scanner(new File("B-small-attempt0.in"));
BufferedWriter out = new ... |
A20261 | A20589 | 0 | package com.gcj.parser;
public class MaxPoints {
public static int normal(int value){
int toReturn = 0;
switch (value) {
case 0 : toReturn = 0 ; break;
case 1 : toReturn = 1 ; break;
case 2 : toReturn = 1 ; break;
case 3 : toReturn = 1 ; break;
case 4 : toReturn = 2 ; break;
case 5 : toReturn = 2 ; b... | import java.io.*;
import java.util.*;
import java.math.BigInteger;
public class B{
public static void main(String []args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t, x = 0, n, s, p, ans;
t = Integer.parseInt(br.readLine());
while(t>0) {t--; x++;... |
B11361 | B13141 | 0 | import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
public class C{
Scanner sc=new Scanner(System.in);
int INF=1<<28;
double EPS=1e-9;
int caze, T;
int A, B;
void run(){
T=sc.n... | package googleCodeJam;
import static java.lang.System.out;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.Set;
import java.util.TreeSet;
public class RecycledNumbers {
public static void main(String[] args) throws Exception {
if (args.length == 1) {
// opening the input
... |
B20424 | B21644 | 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.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 C {
private void work() throws IOException {
Scanner sc = new Scanner(new FileReader("C-large.in"));
PrintWriter pw... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.