F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
A12113 | A10182 | 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.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
public class Googlers {
public static void main(String args[]) throws IOException {
int num = 0;
i... |
B11696 | B12338 | 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 com.example;
import java.io.IOException;
import java.util.List;
public class ProblemC {
static int[] data = new int[2000001];
public static void main(String[] a) throws IOException {
// if(true) {
// precalc();
//
//// System.out.println("min = "+ findMinimum(3210));
//
// return;... |
A11277 | A10833 | 0 | package googlers;
import java.util.Scanner;
import java.util.PriorityQueue;
import java.util.Comparator;
public class Googlers {
public static void main(String[] args) {
int n,s,p,count=0,t;
Scanner sin=new Scanner(System.in);
t=Integer.parseInt(sin.nextLine());
int result[]=new int[t];
int ... | package be.mokarea.gcj.common;
import java.io.PrintWriter;
public abstract class Transformation<T extends TestCase> {
private TestCaseReader<T> caseReader;
private final PrintWriter outputWriter;
public Transformation(TestCaseReader<T> caseReader, PrintWriter outputWriter) {
this.caseReader = caseReader;
this... |
A21557 | A20427 | 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.util.Scanner;
import java.io.*;
public class Prob2 {
public static void main(String[] args) throws IOException{
Scanner in = new Scanner(new File("D:/B-large.in"));
PrintStream out = new PrintStream(new File("D:/outputProb2.txt"));
int lineAmount = Integer.parseInt(in.nextLine());
... |
A21396 | A22196 | 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.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
import static java.lang.Math.abs;
public class B {
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(new FileReader("input.in"));
BufferedW... |
A10793 | A11757 | 0 | import java.io.*;
import java.math.*;
import java.util.*;
import java.text.*;
public class b {
public static void main(String[] args) {
Scanner sc = new Scanner(new BufferedInputStream(System.in));
int T = sc.nextInt();
for (int casenumber = 1; casenumber <= T; ++casenumber) {
... | import java.util.Scanner;
public class Dance {
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);
int linenum = cin.nextInt();
for(int idx = 1; idx < linenum+1; idx++)
{
System.out.print("Case #" + idx + ": ");
int n = cin.nextInt();
int s = cin.nextInt();
int p = c... |
B21752 | B22077 | 0 | package Main;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
/**
* Created with IntelliJ IDEA.
* User: arran
* Date: 14/04/12
* Time: 3:12 PM
* To change ... | import java.util.*;
import java.io.*;
import java.math.*;
public class Prac3 {
public static String shift(String i){
String num=i;
String num2=num.substring(num.length()-1,num.length())+num.substring(0,num.length()-1);
return num2;
}
public static boolean rec(Integer a, int b){
Integer original=a;
... |
B10899 | B10056 | 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(... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejamc;
import java.io.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.*;
/**
*
* @author usuario
*/
public class CodejamC {
/**
* @param args the command line... |
B21752 | B20093 | 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 googlecodejam;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
/**
*
* @author Muhammad Zahran
*/
public class rec... |
B12082 | B10861 | 0 | package jp.funnything.competition.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.apache.commons.io.IOUtils;
public class QuestionReader {
pr... | package be.mokarea.gcj.recyclednumbers;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
import be.mokarea.gcj.common.TestCaseReader;
public class RecycledNumbersTestCaseReader extends
TestCaseReader<RecycledNumbersTestCase> {
private final... |
A12460 | A12418 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author mohamedmohideenebrahim
*/
public... |
A10699 | A11686 | 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) ... | public class Result {
public String output;
public int i;
public Result(int i) {
this.i = i;
}
@Override
public String toString() {
return "Case #"+i+": " + output;
}
}
|
B11327 | B12240 | 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.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
public class RecycledNumbers {
private static FileReader freader;
private static BufferedReader buffreader;
private static FileWriter fwriter;
... |
B10245 | B13118 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | package phase1.problemC;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class RecycledNumbers {
/**
* @param args
*/
public static void main(String[] args) {
Recy... |
B10155 | B11660 | 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... | /*
* 3rd task of this years google Code Jam, lets see what I can do
*/
//Import of java classes and packages
import java.util.Locale;
import java.util.Scanner;
//Body class
public class RecycledNumbers {
//main class start
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
sc.us... |
B12115 | B12445 | 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.BufferedInputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class Main {
public static void solve() throws Exception{
int T = in.readInt(),t = 0;
String format = "Case #%d: ";
... |
A22078 | A21621 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package test2;
import java.util.LinkedList;
/**
*
* @author Student
*/
public class Best {
public static LinkedList<Score> scores(int som) {
LinkedList<Score> res = new LinkedList<Score>();
int ... |
A12113 | A12108 | 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 qualif.problem2;
import qualif.problem1.ReadWrite;
public class Main2 {
private static String pathToFile = "src/qualif/problem2/";
private static String fileName = "B-small";
private static String outputName = "output";
private static String filePath = pathToFile + fileName + ".txt";
private static St... |
A20382 | A22196 | 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.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
import static java.lang.Math.abs;
public class B {
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(new FileReader("input.in"));
BufferedW... |
A10568 | A13211 | 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.*;
import java.nio.charset.Charset;
import java.nio.file.Path;
import java.util.ArrayList;
public class ReadWriter
{
public ArrayList<String> readFile(String path){
File file = new File(path);
ArrayList<String> strings = new ArrayList<String>();
BufferedReader reader = null;
... |
B12669 | B12636 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package year_2012.qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.... | package com.google.codejam.C;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
public class Recycled {
public stati... |
A11277 | A10765 | 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.IOException;
import java.io.PrintWriter;
import java.io.Reader;
public class Processor {
public void process(TestCaseFactory factory, String filenameIn,
String filenameOut) throws IOException, MalformedInputFileExceptio... |
A12846 | A11759 | 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.*;
import java.util.*;
public class Problem2
{
static ArrayList<Integer> scores;
public static void main(String args[])
{
try
{
FileInputStream fstream = new FileInputStream("B-small-attempt0.in");
DataInputStream in = new DataInputStream(fstream);
... |
A20382 | A22689 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... | import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class Second {
int surprises;
boolean isSurprisesLeft = false;
int min;
int[] scores;
int result;
public Second(String[] input) {
scores = new int[Integer.valueOf(input[0])];
surprises = Integer.valueOf(input[1]);
if... |
A20382 | A22114 | 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.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class DancingWithTheGooglers {
private static final String COMIENZO = "Case #";
private static final char ESPACIO = ' ';
public stati... |
A20261 | A22726 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class gcjq1 {
public ... |
B20856 | B20421 | 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.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
public class main {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
BufferedReader dat=new BufferedRe... |
A10568 | A11110 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader (new... | package com.seol.codejam;
import java.io.File;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;
/**
* Solution for http://code.google.com/codejam/contest/1150485/dashboard#s=p1
*/
public class DancingWithTheGooglers {
public static int solveCase(int[] scores, int surpriseNum, int neededS... |
A22191 | A20503 | 0 | package com.example;
import java.io.IOException;
import java.util.List;
public class ProblemB {
enum Result {
INSUFFICIENT,
SUFFICIENT,
SUFFICIENT_WHEN_SURPRISING
}
public static void main(String[] a) throws IOException {
List<String> lines = FileUtil.getLines("/B-large.in");
int cases = Int... | import java.io.*;
import java.util.*;
public class Q2{
static Map<Integer, Integer> m1 = new HashMap<Integer, Integer>();
static Map<Integer, Integer> m2 = new HashMap<Integer, Integer>();
static {
for (int i = 0;i<31;i++){
m1.put(i, max1(i));
m2.put(i, max2(i));
}
}
private static int m... |
B10485 | B10499 | 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.Hashtable;
import java.util.Scanner;
class RecycleResult{
private int lowerBound, upperBound, numberOfDigits;
public RecycleResult(int a, int b, int d){
lowerBound = a;
upperBound = b;
numberOfDigits = d;
}
public int solve(){
int count = 0;
for (int i = lowerBound; i < upperBound; i++){... |
B12074 | B10873 | 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 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... |
B20856 | B20668 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Happy;
import java.io.*;
import java.math.*;
import java.lang.*;
import java.util.*;
import java.util.Arrays.*;
import java.io.BufferedReader;
//import java.io.IOException;
//import java.io.InputStreamReader;
//... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.HashSet;
impor... |
B20291 | B20294 | 0 | import java.io.*;
import java.util.*;
class B
{
public static void main(String[] args)
{
try
{
BufferedReader br = new BufferedReader(new FileReader("B.in"));
PrintWriter pw = new PrintWriter(new FileWriter("B.out"));
int X = Integer.parseInt(br.readLine());
for(int i=0; i<X; i++)
{
String[]... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Scanner;
import java.util.Set;
public class Numbers {
public stat... |
B12941 | B11931 | 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.util.*;
import java.io.*;
public class C {
public static void main(String[] args) {
int n = 0;
int[] a = null;
int[] b = null;
try {
File file = new File(args[0]);
Scanner sc = new Scanner(file);
n = sc.nextInt();
a = new int[n];
b = new int[n];
for (int i=0;i<n;i++) {
a[i] =... |
B11361 | B12061 | 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 code.google.codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
/**
* @author sunilkumarp
*
*/
public abst... |
A20119 | A21822 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... |
package gcj12_dancinggooglers;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.List;
public class GCJ12_DancingGooglers {
publi... |
A21010 | A21504 | 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.lang.*;
import java.util.*;
public class B {
public static void main(String[] args) {
B prob = new B();
prob.run(args[0]);
}
public void run(String fileName) {
try {
Scanner fin = new Scanner(new File(fileName));
PrintWriter fout = new PrintWriter(new File(f... |
A13029 | A11458 | 0 | import java.util.List;
public class Case implements Runnable {
private int id;
private String output;
private int n;
private int s;
private int p;
private List<Integer> g;
public Case(int id) {
this.id = id;
}
public Case(int id, int n, int s, int p, List<Integer> g) {
super();
this.id = id;
this... | import java.util.*;
import java.io.*;
public class Dancing
{
public static void main(String[] args)
{
try
{
Scanner scan = new Scanner(new File("Dancing.in"));
int x = Integer.parseInt(scan.nextLine());
for(int y=0;y<x;y++)
{
... |
B10361 | B12168 | 0 | package codejam;
import java.util.*;
import java.io.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("in.txt"));
PrintWriter out = new PrintWriter(new File("out.txt"));
int T = Integer.parseInt(in.readLine());... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.*;
public class Recycle {
public static void main(String args[]){
Recycle t=new Recycle();
Scanner sc;
int T;
int A, B;
int temp, len;
int div, rem, no, goo;
int coun... |
A12113 | A12722 | 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.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
public class B {
public static void main(String[] args) throws FileNotFoundException {
Scanner in = new Scanner(new File(B.class.getSimpleName() + ".in"));
PrintWriter out = new PrintW... |
A21396 | A21572 | 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 B {
private static int googlers(String s) {
StringTokenizer st = new StringTokenizer(s);
final int N = Integer.parseInt(st.nextToken());
int S = Integer.parseInt(st.nextToken());
int p = Integer.parseInt(st.nextToken());
int score[] = new int[N];
int r ... |
A20261 | A21350 | 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... |
public class Goggledance {
private boolean isSurprising=false;
private boolean isCandidate=false;
int total,p;
public Goggledance(int total,int p){
this.total=total;
this.p=p;
determinesurprising();
}
private void determinesurprising() {
// TODO Auto-generated method stub
if(total/3>=p){
isSurprisin... |
B12669 | B10689 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package year_2012.qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* C
*/
/**
* @author de... |
B22190 | B20921 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
public class Recycled {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.par... | package 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... |
B12941 | B10950 | 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.IOException;
import java.util.InputMismatchException;
import java.util.Set;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.FileInputStream;
import java.io.Writer;
import java.math.BigInteger;
import java.util.HashSet;
import java.io.InputStream;
... |
A22992 | A20311 | 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.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class CodeJam {
private static final String FILE_NAME = "E:/download/B-large.in";
public static void main(String[] args) throws IOException {
File file = new File(FILE_NAME)... |
A22360 | A21012 | 0 | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Scanner;
public class Dancing_With_the_Googlers {
/**
* The first line of the input gives the ... |
package de.ivu.swa.jam;
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.Arrays;
import java.util.List;
/**
* 0 - 10 Maximal 2 auseinander, also 7..9
*
*/
... |
A22642 | A21019 | 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.util.Scanner;
public class GoogleDancers {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
for (int i = 1; i <= n; i++) {
int N = scan.nextInt();
int S = scan.nextInt();
int p = scan.nextInt();
int count = 0;
int p2 = (p - 1) + ... |
A22078 | A22970 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
public class GooglersDancer {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated metho... |
import java.io.*;
import java.util.Scanner;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author joshuahm
*/
public class codejamB {
public static void main(String[] args) throws FileNotFoundException, IOException {
FileReader inFile = ne... |
B10245 | B11667 | 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.*;
public class Recycled{
public static void main(String args[])
{
try{
File myFile = new File("C-small-attempt0.in");
FileReader fileReader = new FileReader(myFile);
BufferedReader reader = new BufferedReader(fileReader);
FileWriter fileWriter = new FileWriter("C-small-attempt0.out");
BufferedWriter w... |
B11421 | B12328 | 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 main;
import java.io.BufferedReader;
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.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.uti... |
B10361 | B13070 | 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.FileNotFoundException;
import java.util.HashMap;
import java.util.Map;
public class Jam {
private static String in = "in";
public static void main(String[] args) throws FileNotFoundException, InterruptedException {
parse(args);
Parser parser = new Parser(in);
//Map<Thread, Case> tasks = ... |
B20566 | B21297 | 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.gdacarv.codejam;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
public class ProblemC {
public static void main(String [ ] args){
try{
FileInputStream fstream = new FileInputStream("input_problemC.in");
DataInputSt... |
B20291 | B20514 | 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.*;
import java.util.*;
/**
* @author Ivan Romanov
*/
public class C {
private String solve() throws IOException {
int a = nextInt();
int b = nextInt();
int ans = 0;
for (int i = a; i < b; i++) {
if (recycle.containsKey(i)) {
for (int j :... |
A12113 | A12505 | 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.File;
import java.io.PrintWriter;
import java.util.Scanner;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author xeyyam
*/
public class DancingWiththeGooglers {
boolean[][] ansNoS = new boolean[31][11];
boolean[][] ansS = new bo... |
A22771 | A20434 | 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.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class ProblemUtils {
public static String[] readInput(String path) throws Exception {
FileInputStream in = new ... |
B21790 | B21098 | 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 gcj_c;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.loggi... |
B10702 | B10451 | 0 | import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Recycle {
private static HashMap<Integer, HashSet<Integer>> map = new HashMap<Integer, HashSet<Integer>>();
private static HashSet<Integer> toSkip = new HashSet<Integer>();
/**
* @param args
*/
public static void main(S... | package MyAllgoritmicLib;
public class BinnomNeutona {
public static int C(int k, int n){
return factorial(n)/(factorial(k)*factorial(n-k));
}
public static int factorial(int n){
int result = 1;
for(int i = n; i > 1; i--){
result *= i;
}
return result;
}
}
|
B10485 | B12448 | 0 |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class Recycle
{
public static void main(String[] args)
{
/* Set<Integer> perms = getPermutations(123456);
for(Integer i: p... | package qual;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
public class C {
public static int[] prepare(int m, int base, int k){
int[] res = new int[m];
for (int i = 0; i < m; i++){
int rest = k % 10;
k /= 10;
k += rest * base;
r... |
A22378 | A21192 | 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.IOException;
import java.util.Scanner;
public class code12 {
public static int nosurprise(int n){
int p= (n/3);
if(n%3==0){return p;}else{return (p+1);}}
public static int surprise(int n){
int p=(n/3);
if(n%3==2){return (p+2);}else{
if(n%3==1){return (p+1);}
el... |
B10485 | B12075 | 0 |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class Recycle
{
public static void main(String[] args)
{
/* Set<Integer> perms = getPermutations(123456);
for(Integer i: p... | package jp.funnything.competition.util;
public class Prof {
private long _start;
public Prof() {
reset();
}
private long calcAndReset() {
final long ret = System.currentTimeMillis() - _start;
reset();
return ret;
}
private void reset() {
_start = Sys... |
A21396 | A21811 | 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.Scanner;
public class P2 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int t = Integer.parseInt(scan.nextLine());
for (int i = 0; i < t; i++) {
String[] a = scan.nextLine().split(" ");
int n = Integer.parseInt(a[0]);
int s = Integer.parseInt(a[1... |
B11318 | B10392 | 0 | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
int casos=1, a, b, n, m, cont;
while(t!=0){
a=sc.nextInt();
b=sc.nextInt();
if(a>b){
int aux=a;
a=b;
b=aux;
}
System.out.printf("Case #%d: ",casos... | import java.io.*;
import java.util.*;
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[]... |
A20382 | A20424 | 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.FileNotFoundException;
import java.io.PrintWriter;
import java.util.*;
public class Dance {
private static int raw_num;
private static int pot_num;
public static void main(String[] args) throws FileNotFoundException{
Scanner in = new Scanner(System.in);
PrintWriter out = new PrintWriter("dance_ou... |
B12570 | B12682 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class Input {
BufferedReader reader;
StringTokenizer st = new StringTokenizer("");
public Input( BufferedReader... |
B10361 | B13148 | 0 | package codejam;
import java.util.*;
import java.io.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("in.txt"));
PrintWriter out = new PrintWriter(new File("out.txt"));
int T = Integer.parseInt(in.readLine());... | import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
public class RecycledNumbersSolver {
public static voi... |
B21752 | B20138 | 0 | package Main;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
/**
* Created with IntelliJ IDEA.
* User: arran
* Date: 14/04/12
* Time: 3:12 PM
* To change ... | import java.util.*;
import java.io.*;
public class C
{
public static int roll (int i, int a, int b)
{
int found = 0;
int digits = (""+i).length();
int[] vit = new int[digits];
int magic;
int keep, move,done;
for (int d = 1; d < digits; d++)
{
magic = (int)Math.pow(10, d);
keep = i/... |
A12273 | A13162 | 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 tr0llhoehle.cakemix.utility.googleCodeJam;
import java.text.ParseException;
/**
* This class is a base class for all concrete problems. It is used to define
* some methods necessary for the IOManager to work. It is crucial that the
* addValue-Method gets extended and called (super.addValue(o)) by the exten... |
A12460 | A11703 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package test2;
/**
*
* @author Student
*/
public class Score {
private int i;
private int j;
private int k;
private boolean surp;
public Score(int i, int j, int k,boolean surp) {
this.i ... |
B22190 | B22197 | 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 static java.lang.System.in;
import static java.lang.System.out;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;
public class Recycled {
public static void main(String... |
B21968 | B21652 | 0 | import java.util.*;
import java.io.*;
public class recycled_numbers {
public static void main(String[]a) throws Exception{
Scanner f = new Scanner(new File(a[0]));
int result=0;
int A,B;
String n,m;
HashSet<String> s=new HashSet<String>();
int T=f.nextInt(); //T total case count
for (int t=1; t<=T... | package RecycledNumbers;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashSet;
/**
*
* @author Nikhil
*/
public class c {
public static void main(String[] args) throws FileNotFoundException, IO... |
B21790 | B22177 | 0 | import java.io.*;
import java.util.*;
public class C {
void solve() throws IOException {
in("C-large.in"); out("C-large.out");
long tm = System.currentTimeMillis();
boolean[] mask = new boolean[2000000];
int[] r = new int[10];
int t = readInt();
for (int cs = 1; cs... | package y2012.quals;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
public class C {
public static void main(String[] args) throws FileNotFoundException {
Scanner in = new Scanner(new File("C.in"));
PrintWriter out = new ... |
B12115 | B12874 | 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.*;
import java.util.*;
public class C {
public static void main(String[] args) {
new C().run();
}
BufferedReader br;
StringTokenizer st;
PrintWriter out;
boolean eof;
public void run() {
try {
// br = new BufferedReader(new InputStreamReader(System.in));
// out = new PrintWriter(System.... |
A22642 | A21850 | 0 | import java.util.*;
import java.io.*;
public class DancingWithTheGooglers
{
public DancingWithTheGooglers()
{
Scanner inFile = null;
try
{
inFile = new Scanner(new File("inputB.txt"));
}
catch(Exception e)
{
System.out.println("Problem ope... | package Utils;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class FileHelper {
private Str... |
A10996 | A10635 | 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.PrintWriter;
import java.util.Scanner;
/**
*
* @author yilianz
*/
public class DancingGoogler{
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws Exception{
// Read file
Scanner inFile = new Scanner(ne... |
B10485 | B12002 | 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.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Recycle {
private BufferedReader br;
private int numCases;
public Recycle(String input){
try{
FileInputStream fstream = new FileInpu... |
B20291 | B21888 | 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[]... | /**
* Created by IntelliJ IDEA.
* User: kingsto
* Date: 4/15/12
* Time: 1:10 AM
* To change this template use File | Settings | File Templates.
*/
// to be run with -Xmx1024m
import java.util.*;
import java.io.*;
public class RecycledNumbers {
class Testcase {
int ans;
public Testcase() {
... |
B11696 | B12533 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recycled;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util... | package recyclednumbers;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
/**
*
* @author Kocmi
*/
public class RecycledNumbers {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(Sy... |
A12846 | A11115 | 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... | package com.googlecode.codejam.model;
import java.util.Iterator;
import java.util.concurrent.Callable;
public abstract class JamCaseResolverFactory {
public abstract Callable<String> newJamCaseResolver(int caseNumber, Iterator<String> lineIterator);
}
|
B12941 | B11648 | 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.jp.common;
public interface Puzzle {
public String[] solve(String[] dataSet );
}
|
A12211 | A10891 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package utils;
/**
*
* @author Fabien Renaud
*/
public interface JamParser {
public JamCase getJamCase(int number);
} |
B12941 | B12123 | 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 Television;
public class Pair{
public int a, b;
public Pair(int a, int b)throws Exception
{
if(a>=b)
throw new Exception("invalid input for pair");
this.a=a;
this.b=b;
}
public boolean equls(Object po)
{
Pair p = (Pair)po;
if(p.a == this.a && p.b==this.b)
return true;
return false;
}... |
A11917 | A12618 | 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 com.google.code.jam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class B {
public static int Case,N,S,p;
public static int[] Ti = new int[102];
... |
A10996 | A11673 | 0 | import java.util.Scanner;
import java.io.*;
class dance
{
public static void main (String[] args) throws IOException
{
File inputData = new File("B-small-attempt0.in");
File outputData= new File("Boutput.txt");
Scanner scan = new Scanner( inputData );
PrintStream print= new PrintStream(outputData);
... | package problem2;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class Bsmall implements Runnable {
private fin... |
B21270 | B21296 | 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 recycling;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.HashSet;
import java.util.Scanner;
public class Main {
public static int lint(int n){
if(n == 0)
return 0;
return 1 + lint(n / 10);
}
public static void permut(int[] tab){
int l = tab.length;
int temp = ta... |
B20734 | B20575 | 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 codejam;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.util.HashMap;
import java.util.Map;
public class RecycledNumbers {
private StreamTokenizer in;
private PrintWrit... |
B21049 | B21012 | 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.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
long... |
B22190 | B20253 | 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.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
/*
* To change this template, choose Tools | Templates and open the template in
* the editor.
*/
/**
*
* @author megaterik
*/
public cl... |
A12211 | A11862 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class Dancing_improved {
static int f_Superan_limites(String params){
int superan_limite=0;
String[] para... | import java.util.*;
public class B
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int test = 1, cases = sc.nextInt();
int n, s, p, g, score, count, even, extra;
while(test <= cases)
{
count = 0;
n = sc.nextInt();
s = sc.nextInt();
p = sc.nextInt();
for(g = ... |
B10702 | B12011 | 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.util.*;
public class C
{
public static void main(String[] args)
{
new C(new Scanner(System.in));
}
ArrayList<Integer> makeNice(int v)
{
ArrayList<Integer> vs = new ArrayList<Integer>();
while (v > 0)
{
vs.add(v%10);
v = v/10;
}
return ... |
A22771 | A22393 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package dancingwithgoogler;
/**
*
* @author WC
*/
public class DancingWithGoogler {
private int numberOfSurprising = 0;
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
... |
B12115 | B11247 | 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.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;
public class RecycledNums {
public static String rootDir = System.getProperty("user.dir") + File.separator;
public static ... |
A10996 | A11507 | 0 | import java.util.Scanner;
import java.io.*;
class dance
{
public static void main (String[] args) throws IOException
{
File inputData = new File("B-small-attempt0.in");
File outputData= new File("Boutput.txt");
Scanner scan = new Scanner( inputData );
PrintStream print= new PrintStream(outputData);
... | package DancingWithGooglers;
public class Googler implements Comparable {
/**
* @param args
*/
private int base;
private int remainder;
private int max;
private int total;
private boolean mayBeSurprising;
public Googler(int score){
total = score;
remainder = score %3 ;
base = (score - remainder) /3... |
A20261 | A21880 | 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 codejam;
import java.util.HashMap;
import java.util.Scanner;
public class DanceScores {
public static void main(String[] args) {
HashMap<Integer,int[]> best = new HashMap<Integer, int[]>();
best.put(1 , new int[]{1,1});
best.put(2 , new int[]{2,3});
best.put(3 , new int[]{4,6});
best.put(4 , new i... |
B10858 | B12732 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| import java.io.*;
public class googleJam3 {
/**
* @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("C-small-attempt0.in"));
writer = ne... |
B20424 | B21382 | 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... | package recycledNumbers;
public class Limits {
private int lower;
private int upper;
public Limits(int l, int u) {
this.lower = l;
this.upper = u;
}
public int getLow() {
return lower;
}
public int getUpp() {
return upper;
}
}
|
B12115 | B12968 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam2012;
/**
*
* @author ESIEN
*/
public class C {
static int numOfDigits;
final static int max = 1001;
static int div;
static boolean[] found = new boolean[max];
... |
B10361 | B11852 | 0 | package codejam;
import java.util.*;
import java.io.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("in.txt"));
PrintWriter out = new PrintWriter(new File("out.txt"));
int T = Integer.parseInt(in.readLine());... | import java.io.BufferedReader;
import java.io.IOException;
public class CaseReader {
public static String[][] getCases(String s, int linesPerCase) {
int cases = Integer.parseInt(s.split("\n")[0]);
String[][] ret = new String[cases][linesPerCase];
String[] v = s.split("\n");
for (int i = 0;i < cases;i++)
{
... |
B21227 | B21832 | 0 | import java.util.HashSet;
import java.util.Scanner;
public class C {
static HashSet p = new HashSet();
static int low;
static int high;
int count = 0;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int no = sc.nextInt();
for (int i = 1; i <= no; i++) {
p.clear();
lo... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.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.util.ArrayList;
import java.util.... |
A10793 | A11638 | 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.InputStreamReader;
import java.io.IOException;
public class Dance {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int numCases = Integer.parseInt(br.readLine());
for ( int i = 1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.