F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
B12115 | B11316 | 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.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintStream;
public class prob3 {
/**
* @param args
*/
static BufferedReader openRead(String fileName){
BufferedReader in = null;
try {
... |
B20734 | B20394 | 0 | package fixjava;
public class StringUtils {
/** Repeat the given string the requested number of times. */
public static String repeat(String str, int numTimes) {
StringBuilder buf = new StringBuilder(Math.max(0, str.length() * numTimes));
for (int i = 0; i < numTimes; i++)
buf.append(str);
return buf.toStr... | import java.io.*;
import java.util.ArrayList;
import java.util.HashSet;
public class recycled {
public static void main(String[] args) {
String filename = args[0];
ArrayList<String> input = new ArrayList<String>();
ArrayList<String> output = new ArrayList<String>();
try {
BufferedReader br = new BufferedR... |
B11327 | B11714 | 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.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
public class Counter {
private int T;
private Lock lock;
private ICounterZeroEvent e;
public Counter(int T, ICounterZeroEvent e)
{
this.T = T;
this.e = e;
lock = new ReentrantLock();
}
public void increase() ... |
B12941 | B11811 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejamc;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;
/**
*
* @author strigazi
*/
public class CodejamC {
/**
* @param args the command li... |
A12544 | A10685 | 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.*;
import java.util.*;
public class Main{
String inputFile = "B-small-attempt1.in";
PrintStream output;
Scanner fileScanner;
int outputLine = 0;
double start = System.currentTimeMillis();
public Main(){
newCodeJam();
fileScanner.nextLine();
while (fileS... |
A12273 | A11523 | 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 codejam.is;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
/**
* Created with IntelliJ IDEA.
* User: ofer
* Date: 4/13/12
* Time: 8:53 PM
* To change this template use File | Settings | File Templates.
*/
public class TestRunner {
... |
A22191 | A21419 | 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.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.StringTokenizer;
public class Dancing {
public static void main(String[] args) throws IOException
{
BufferedReader f = new BufferedReader(new FileReader("dancing.in"));
//PrintWriter out = new PrintWriter(n... |
B20006 | B20943 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class ProblemC {
public static void main(String[] args) {
try (BufferedReader reader = ne... |
B11361 | B10767 | 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... | /**
* The HelloWorldApp class implements an application that
* simply prints "Hello World!" to standard output.
*/
import java.io.*;
import java.net.*;
import java.util.*;
import java.lang.Math;
class help{
public help(){
}
static int power(int x, int n)
{
if (n == 0)
return 1; ... |
A12273 | A10852 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Dancing
* Jason Bradley Nel
* 16287398
*/
import java.io.*;
public class Dancing {
public static void main(String[] args) {
In input = new In("input.txt");
int T = Integer.parseInt(input.... | import java.io.*;
import java.util.Locale;
import java.util.StringTokenizer;
public class GCJ2012QualB {
int maxNS[] = new int[31];
int maxS[] = new int[31];
public void run() throws IOException {
for (int s = 0; s <= 30; ++s) {
maxNS[s] = maxS[s] = -1;
}
f... |
B10485 | B11419 | 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.Arrays;
import java.util.Scanner;
public class C {
static Scanner in = new Scanner(System.in);
long solve() {
int A = in.nextInt();
int B = in.nextInt();
int digits = 1;
int mult = 1;
{
int t = A;
while (t>=10) {
t/=10;
++digits;
mult *= 10;
}
}
long ans = 0;
... |
A12460 | A10858 | 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.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class letDance {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
... |
B12669 | B10125 | 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.*;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Comparator;
import java.util.StringTokenizer;
public class C implements Runnable {
private static final String PROBLEM_ID = "C";
private class TestCaseRunner {
int answer(int a, int b) {
int result =... |
A10568 | A10788 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader (new... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package dancing.with.the.googlers;
/**
*
* @author Optee
*/
public class ScoreCounter {
int numberOfGooglers;
int surpriseCount;
int minScore;
int[] scores;
public ScoreCounter(String line) {
... |
A22992 | A21128 | 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.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Main {
/**
* @param args
*/
public static void main(Str... |
B21049 | B21234 | 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.util.ArrayList;
import java.util.List;
public class RecycledNumbers {
/**
* @param args
*/
public static void main(String[] args) {
List<String> inputList = FileIO.readFile("C-large.in");
List<String> outputList = new ArrayList<String>();
int caseNo = 1 ;
int testCaseCount = Integer.par... |
A11277 | A12045 | 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.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class DancingWithGooglers {
final static int[] _3n_2 = new int[] { 2, 5, 8, 11, 14, 17, 20, 23, 26, 29 };
final static int[] _3n_4 = new int[] { 4, 7, 10, 13, 16, 19, 22, 25, 28 };
// return -1 if cannot be written as surpr... |
B13196 | B12291 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Q3M {
public static void main(String[] args) throws Exception {
compute();
}
private ... | import java.io.*;
public class Palindrome
{
public static void main(String args[]) throws IOException
{
int N;
int a,b,i;
String s[];
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
N=Integer.parseInt(br.readLine());
for(i=1;i<=N;i... |
B12570 | B11990 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | package codejam2012qual;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.PrintStream;
import java.io.PrintWriter;
import util.InputReader;
public class RecycledNumbers implements Runnable {
private InputReader in;
priv... |
B12570 | B11839 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | package info.m3o.gcj2012.recyclednumber;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class InputFileLoader {
protected File infile;
protected List<String>... |
B21790 | B20194 | 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 qualification;
import java.io.*;
import java.util.*;
import java.math.*;
public class C
{
//static String PROBLEM_NAME = "c-practice";
//static String PROBLEM_NAME = "c-small-0";
//static String PROBLEM_NAME = "c-small-1";
//static String PROBLEM_NAME = "c-small-2";
//static String PROBLEM_NAME = "c-small... |
B20566 | B22135 | 0 | import java.util.Scanner;
import java.io.*;
import java.lang.Math;
public class C{
public static int recycle(String str){
String[] numbers = str.split(" ");
int min = Integer.parseInt(numbers[0]);
int max = Integer.parseInt(numbers[1]);
int ret = 0;
for(int i = min; i < max; i++){
String num = i + "";
... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
public class ProblemC2
{
public boolean checked[] = new boolean[2000000];
public int min, max;
public static void main(String [] args)
{
new ProblemC2();
}
public ProblemC2()
{
try
{
St... |
B12085 | B11803 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam.qualification.recyclednumbers;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import util.BaseResolver;
import util.Util;
/**
*
* @author bohmd
*/
public class RecycledNumbers... |
B10149 | B12991 | 0 | import java.io.FileInputStream;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeSet;
// Recycled Numbers
// https://code.google.com/codejam/contest/1460488/dashboard#s=p2
public class C {
private static String process(Scanner in) {
int A = in.nextInt();
int B = in.nextInt();
int res =... | import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.StringTokenizer;
public class Main {
/**
* @param args
* @throws IOException
* @throws NumberFormatException
*/
public static void main(S... |
B20566 | B20997 | 0 | import java.util.Scanner;
import java.io.*;
import java.lang.Math;
public class C{
public static int recycle(String str){
String[] numbers = str.split(" ");
int min = Integer.parseInt(numbers[0]);
int max = Integer.parseInt(numbers[1]);
int ret = 0;
for(int i = min; i < max; i++){
String num = i + "";
... | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.Scanner;
import java.util.TreeSet;
class Pair implements Comparable<Pair>{
int a , b;
public Pair(int a, int b) {
this.a = a;
this.b = b;
}
@Override
public boolean equals(Obje... |
A11135 | A10029 | 0 | /**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/3/12
* Time: 11:00 AM
* To change this template use File | Settings | File Templates.
*/
import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;
import java.io.*;
import java.util.*;
import java.uti... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
public class DancingWithGooglers {
static class Googler implements Comparable<Googler>{
int averageScore;
int remainder;
Googler(int averageScore, int remainder) {
this.averageScore = ave... |
A21010 | A20932 | 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... | package org.tritree_tritree;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Scanner;
public class ProblemBLarge {
public static void main(String[] args) th... |
B20006 | B21868 | 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 {
... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.util.*;
import java.math.*;
/**
*
* @author .
*/
public class C {
public static class Num {
int number;
String num;
ArrayList<Integer> recycled;
Num(int number) {
... |
B20023 | B21562 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
public class GoogleC {
public String szamol(String input){
String result="";
String... | import java.io.*;
import java.util.*;
class ProblemC
{
public static void main(String[] args)
{
try{
// Open the file that is the first
// command line parameter
FileInputStream fstream = new FileInputStream("input.txt");
BufferedWriter out = new BufferedWriter(new FileWriter("output.txt"));
// G... |
B20023 | B20636 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
public class GoogleC {
public String szamol(String input){
String result="";
String... |
/**
* Name: Shivam99
* email: shivthedestroyer99@gmail.com
*/
import java.io.*;
public class ProblemC
{
public static void main(String[] args) throws IOException{
FileReader fr=new FileReader(args[0]);
BufferedReader br=new BufferedReader(fr);
String str=br.readLine();
int t=In... |
B10361 | B10958 | 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.*;
import java.math.BigInteger;
import java.util.HashMap;
import java.util.InputMismatchException;
/**
* Created by César Passoni
*/
public class TaskC implements Runnable
{
private InputReader in;
private PrintWriter out;
public static void main(String[] args) {
new Thread(new T... |
B21752 | B20378 | 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.*;
public class C
{
public static int front;
public static int rotate(int in)
{
return (in / 10) + front*(in % 10);
}
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int c = 1; c <= T; c++){
int ans = 0;
... |
B12085 | B10529 | 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 recyclednumbers;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashSet;
/**
* @author Emmanuel JS Hoarau - Google Code Jam 2012
*/
public class RecycledNumbers {
String executeLine(final String line) {
String words[] = line.split(" ");
String sa =... |
A22642 | A22202 | 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 qualification.round.atual;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Googlers {
/**
* @param arg... |
A20119 | A20342 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | import java.util.Scanner;
public class Q2 {
public static void main(String[] args) {
Scanner s = new Scanner(Q2.class.getResourceAsStream("B-large.in"));
int n = s.nextInt();
int nt = 1;
while (n-- > 0) {
int resp = 0;
int ng = s.nextInt();
int ex = s.nextInt();
int nm = s.next... |
A20119 | A22228 | 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 teardrop.jam2012.qr.dancing;
import java.io.IOException;
import java.io.Reader;
import java.io.StreamTokenizer;
import java.io.Writer;
import java.util.ArrayList;
import java.util.List;
public class CaseSolver {
private final Reader reader;
private final Writer writer;
public CaseSolver(Reader re... |
A10699 | A11491 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Dancing {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) ... | import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Scanner;
// Qualification Round 2012
// Problem A
public class DancingWithTheGooglers {
public static void main(String[] args) {
Scanner sc = null;
try {
sc = new Scanner(new Fi... |
A12273 | A13091 | 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 codejam2012.B;
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
/**
*
* @author Rymbu VV
*/
public class DancingWithGooglers {
private Scanner sc;
private PrintWriter pw;
private int CASES;... |
B20856 | B21190 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Happy;
import java.io.*;
import java.math.*;
import java.lang.*;
import java.util.*;
import java.util.Arrays.*;
import java.io.BufferedReader;
//import java.io.IOException;
//import java.io.InputStreamReader;
//... | package googlejam;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class RecycledNumbers {
public static void main(String[] args) throws FileNotFoundException {
Scanner sc = new Scanner(new File... |
A20261 | A21213 | 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.File;
import java.io.FileReader;
import java.io.PrintWriter;
public class ProblemaB {
/**
* @param args
*/
public static void main(String[] args)throws Exception {
int couldHaveBeenQuantity = 0;
int couldHaveBeenSurprinsinglyQuantity = 0;
PrintWriter pw = new... |
B12669 | B13034 | 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 qualification.q1;
import java.util.HashMap;
import java.util.Map;
/**
* Created by IntelliJ IDEA.
* User: ofer
* Date: 14/04/12
* Time: 17:10
* To change this template use File | Settings | File Templates.
*/
public class Q1Solver {
private Map<Character,Character> mapping;
public Q1So... |
B12669 | B10666 | 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.... | //RECYCLED NUMBERS
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 classes / interface from java.io pacckage to work with files
public class Recy... |
B10858 | B10076 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| package qualification;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.PrintStream;
public class C {
static byte[][] MAP = new byte[1000][1000];
private static final char[] CASE = "Case #".toCharArray();
public static void main(String[] args) throws ... |
A12273 | A11704 | 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 y2012.Qualification;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class DancingWithGooglers extends IOStream {
List<Triplet> compl... |
B10149 | B10724 | 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 wwu.quals2012;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import lib.tuple.Pair;
impor... |
B10858 | B11330 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| package recycledNumbers;
public class Solution {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
InputData inputdata = Flow.Readin("src//recycledNumbers//C-small-attempt0.in");
OutputData outputdata = Algorithms.getOutput(inputdata);
Flow.Writeou... |
A10996 | A11872 | 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 qualificationround;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
public class ProblemBDancingGooglers {
public ProblemBDancingGooglers() {
try {
FileReader fr = new FileReader("B-small-attempt0.in");
BufferedReader br = new Buffe... |
A22378 | A22000 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class CodeJam {
// public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt";
public static final String INP... | package Googlers;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class googlers {
static void print(int nbCases, int N, int S, int P, int[] T) {
System.out.print(N + " ");
System.out.print(S + " ");
System.out.print(P);
for (int j = 0; j < N; j++)
{
System.o... |
B10155 | B12498 | 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.*;import java.util.*;
public class Solution3
{
public static void main(String args[]) throws IOException
{
BufferedReader br=new BufferedReader(new FileReader("input.txt"));
PrintWriter pw=new PrintWriter(new BufferedWriter(new FileWriter("output.txt")));
int lines=Integer.parseInt(br.readL... |
B20566 | B21549 | 0 | import java.util.Scanner;
import java.io.*;
import java.lang.Math;
public class C{
public static int recycle(String str){
String[] numbers = str.split(" ");
int min = Integer.parseInt(numbers[0]);
int max = Integer.parseInt(numbers[1]);
int ret = 0;
for(int i = min; i < max; i++){
String num = i + "";
... |
import java.io.*;
/*
* To change this template, choose Tools | Templates and open the template in
* the editor.
*/
/**
* Problem C. Recycled Numbers
*
* @author admin
*/
public class ProblemC_RecycledNumbers {
public static void main(String[] args) throws FileNotFoundException, IOException {
Buffe... |
B10858 | B11569 | 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.util.Scanner;
import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintStream;
public class Recycled {
public static void main(String[] args) {
try {
Scanner sc = new Scanner(new File("input.in"));
FileOutputStream output = new FileOutputStream("output.txt");
PrintStream p = ne... |
A22078 | A21713 | 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.io.FileWriter;
import java.util.Scanner;
public class B {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(new File("B-large.in"));
FileWriter f = new FileWriter("B.out");
int N,S,p;
int googler;
int kol,ost;
int br;
int T=sc.nextInt... |
A12544 | A10045 | 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.*;
import java.util.*;
class B
{
public static void main(String args[]) throws FileNotFoundException
{
Scanner in = new Scanner(new File(args[0]));
int t;
t = Integer.parseInt(in.nextLine());
for (int i=0; i<t; i++)
{
int n = in.nextInt();
int s = in.nextInt();
int p = in.nextInt... |
B12074 | B10457 | 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 Parser;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
public class MyReader {
public String[] taskArray;
public int currentString;
public MyReader(String fileName) {
// TODO Auto-ge... |
A20119 | A21241 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Scanner;
public class Dance {
/* private static int maxScore(int total, boolean isSurprise) {
int base = total / 3;
if (isSurprise) {
switch ( total % 3 ) {
case 0: return base + 1;
case 1: return b... |
B10149 | B12066 | 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 codeJam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashSet;
import java.util.Iterator;
/**
* http://code.google.com/codejam/contest/1460488/dashboard#s=p2
* @author Weiwei Cheng
*/
public class RecycledNumbers {
... |
A12846 | A12413 | 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.io.IOException;
import java.io.PrintStream;
import java.util.Scanner;
//Using the Google Collections library.
public class B {
public static void main(String [] args) throws IOException {
String inputFile = "src/B-small-attempt0.in";
Scanner in = new Scanner(new File(inputFile)... |
B20734 | B21383 | 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 recycledNumbers;
public class RecycledPair {
private int n;
private int m;
public RecycledPair(int n, int m) {
this.n = n;
this.m = m;
}
/**
* @return the n
*/
public int getN() {
return n;
}
/**
* @return the m
*/
public int getM() {
return m;
}
@Override
public boolean equals... |
B10899 | B12236 | 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 gcj2012;
import java.io.File;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
/**
* @author Gaurav Prabhu Gaonkar
* @date Apr 13, 2012
*
*/
public class RecycledNumbers {
public static void main(String[] args) {
String inputDir = "C:\\GcjFiles\... |
A10699 | A10383 | 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 B;
import java.io.*;
public class B {
public static void main(String[] args) throws Exception {
BufferedReader in = new BufferedReader(new FileReader("B.in"));
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("B.out")));
int n = Integer.parseInt(in.readLine());
for (int i = 0;... |
A21557 | A23066 | 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.InputStreamReader;
class DWtG {
public static BufferedReader br = null;
public static int numCases;
public static int numDancers;
public static int numSurprises;
public static int p; // p is given by the problem as the "best score"
public static Str... |
A22191 | A21189 | 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... | /**
* Copyright 2012 Christopher Schmitz. All Rights Reserved.
*/
package com.isotopeent.codejam.lib;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class InputReader<T> extends BufferedReader {
private fina... |
A12460 | A12578 | 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.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class SpeakingTongues extends JamProblem {
Map<Character, Character> map = new HashMap<>();
public static void main(String[] args) throws IOException {
SpeakingTongues p = new SpeakingTongues();... |
A22378 | A21546 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class CodeJam {
// public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt";
public static final String INP... | package com.jp.common;
import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.PrintStream;
import java.util.Scanner;
public class InputOutputProcessor {
private int numberOfCases;
private boolean doesInputHaveDataSetLines;
private int indexOfDataSetLine;
p... |
B12669 | B12295 | 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.... | /**
* Created by IntelliJ IDEA.
* User: SONY
* Date: 19.02.12
* Time: 13:12
* To change this template use File | Settings | File Templates.
*/
import java.io.*;
import java.util.*;
public class Main extends Thread {
public Main(String inputFileName, String outputFileName) {
try {
this.i... |
A11277 | A12720 | 0 | package googlers;
import java.util.Scanner;
import java.util.PriorityQueue;
import java.util.Comparator;
public class Googlers {
public static void main(String[] args) {
int n,s,p,count=0,t;
Scanner sin=new Scanner(System.in);
t=Integer.parseInt(sin.nextLine());
int result[]=new int[t];
int ... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.Scanner;
public class Dancing {
public static void main(String args[]) {
try{
BufferedReader in = new BufferedReader(new FileReader("B-small-attempt0.in"));
BufferedWriter ... |
A13029 | A12554 | 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.*;
public class DancingWithGooglers {
public static void main( String[] args ) {
Scanner in = new Scanner( System.in );
int T = in.nextInt();
for( int z = 1; z <= T; z++ ) {
int N = in.nextInt();
int S = in.nextInt();
int p = in.nextInt();
int coun... |
B10245 | B12862 | 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 google.codejam;
public interface GoogleSolver {
String solve(String str);
}
|
A22191 | A22977 | 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 Game {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new FileReader(new File("/Users/atai/Play/Codejam/input.txt")));
PrintWriter prn = new PrintWriter(new FileWriter("output.txt"));
int numTests = Integ... |
A22360 | A20219 | 0 | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Scanner;
public class Dancing_With_the_Googlers {
/**
* The first line of the input gives the ... | import java.util.Scanner;
public class B2 {
/**
* @param args
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int nbrCases = sc.nextInt();
for (int i = 1; i <= nbrCases; ++i) {
sc.nextLine();
System.out.print("Case #" + i + ": ");
int nbrGoogle... |
B11327 | B13045 | 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]);
}
}
}
|
public class Par {
Integer A,B;
public Par(Integer a,Integer b)
{
A=a;
B=b;
}
public boolean equals(Object o) {
boolean res=false;
Par P=(Par) o;
if ((P.A.equals(A) && P.B.equals(B))||(P.A.equals(B) && P.B.equals(A)))
{
res=true;
}
return res;
}
public int hashCode() {
return (A*B+A.h... |
A20490 | A21783 | 0 | /**
*
*/
package hu.herba.codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io... | import java.io.BufferedReader;
import java.io.FileReader;
import java.util.StringTokenizer;
/**
*
* @author Sreesasanka G
*/
public class Dancers {
public static void main(String args[])throws Exception
{
BufferedReader in = new BufferedReader(new FileReader("B_Small.in"));
int cases = Integ... |
A11502 | A12525 | 0 | package template;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
public class TestCase {
private boolean isSolved;
private Object solution;
private Map<String, Integer> intProperties;
private Map<String, ArrayList<Integer>> intArrayProperties;
private Map<String, Arra... |
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.FileWriter;
import java.io.PrintWriter;
import ... |
A12544 | A10765 | 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.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... |
B12762 | B12983 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.File;
import java.io.FileInputStream;
import java.util.Scanner;
/**
*
* @author imgps
*/
public class C {
public static void main(String args[]) throws Exception{
int A,B;
int ctr ... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
public class QuestionC {
public static void doPuzzle() {
try {
File question... |
B21270 | B20195 | 0 | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
public class CopyOfCopyOfMain {
static int ndigits(int n) {
return (int) (Math.log10(n) + 1);
}
static i... |
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.Reader;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.nio.CharBuffer;
import java.util.ArrayList;
import java.u... |
B12669 | B13249 | 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.InputStreamReader;
class RN {
private static BufferedReader br = null;
private static int numCases;
private static int lowerBound, upperBound;
private static String[] input;
public static void main(String[] args) throws Exception {
try {
... |
B21752 | B22027 | 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 qual2012;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class Kattio extends PrintWriter {
public K... |
B21752 | B20590 | 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 be.mokarea.gcj.common;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.io.Writer;
public abstract class GoogleCodeJamBase<T extends TestCase> {
protected abstract Transformation<T> createTransformation(TestCaseReader<T> testCaseReader, PrintWriter outputWriter) throws Exception;
protecte... |
A20730 | A22169 | 0 | import java.util.Scanner;
public class B {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int zz = 1; zz <= T;zz++){
int N = in.nextInt();
int S = in.nextInt();
int p = in.nextInt();
int x = 0;
for(int i = 0; i < N;i++){
int score = in.n... | import java.io.*;
import java.awt.geom.Point2D;
import java.text.*;
import java.math.*;
import java.util.*;
public class Main implements Runnable {
final String problem = "B";
// final String filename = problem + "-sample";
// final String filename= problem+"-small-attempt0";
// final String filename= problem+"-... |
B13196 | B12796 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Q3M {
public static void main(String[] args) throws Exception {
compute();
}
private ... | import java.io.File;
import java.io.FileNotFoundException;
import java.util.Calendar;
import java.util.Scanner;
public class recycle {
static int cases;
static int[] state;
static String[][] delta;
static void console(Object a, int line){
String time = Calendar.getInstance().getTime().toString();
String ty... |
B12074 | B12655 | 0 | package jp.funnything.competition.util;
import java.math.BigInteger;
/**
* Utility for BigInteger
*/
public class BI {
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger add( final BigInteger x , final BigInteger y ) {
return... | import java.io.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.... |
A20261 | A21637 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
public class CodeJamTextOutputWriter {
private final BufferedWriter writer;
CodeJamTextOutputWriter(File outputFile) throws IOException {
writer = new BufferedWriter(new FileWriter(outputFile));
}
publ... |
A10996 | A12081 | 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 com.renoux.gael.codejam.fwk;
import com.renoux.gael.codejam.utils.Input;
import com.renoux.gael.codejam.utils.Output;
public class Model extends Solver {
public static void main(String... args) throws Exception {
new Model().run();
}
@Override
protected void solveCase(Input in, Outp... |
A11201 | A10609 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | import java.io.BufferedReader;
import java.io.InputStreamReader;
/**
*
* @author andy
*/
public class DancingWithGooglers {
public static void main(String[] args) throws Exception {
//char sd = '1';
//int[] sdf = new int[ 10 ];
//System.out.println( Math.ceil( 17 / 3.0... |
A20261 | A22795 | 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 codejam2012;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.Scanner;
public class QualB {
public static void main(String[] args) throws FileNotFoundException {
Scanner in = new Scanner(... |
A21396 | A20073 | 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.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
public class Dancing {
public static int findmax(int N, int S, int p, ArrayList<Integer> googlers){
int legit = 0;
int s... |
A12211 | A12594 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class Dancing_improved {
static int f_Superan_limites(String params){
int superan_limite=0;
String[] para... | import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws Exception {
Scanner s = new Scanner(new File("input"));
BufferedWriter w = new BufferedWriter(new FileWriter(new File("output")));
int cases = ... |
B11421 | B12412 | 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 taskc;
import java.io.FileNotFoundException;
import java.util.*;
import java.io.File;
import java.io.PrintWriter;
public class TaskC {
private int[] tenPowers = new int[10];
private int[]prevPairs = new int[10];
private void prepareTenPowers(){
tenPowers[0] = 1;
for(int i = 1;... |
B10485 | B11966 | 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 com.my;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.HashSet;
import java.util.Set;
public class Main {
public static void main(String[] args) {
try {
RecycledNumbers r = new RecycledNumbers();
String fileLocation = "C://Training//Google//RecycledN... |
B13196 | B12579 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Q3M {
public static void main(String[] args) throws Exception {
compute();
}
private ... | import java.util.List;
import java.util.ArrayList;
import java.util.Scanner;
public class C {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for (int t = 0; t < T; t++){
int A = in.nextInt(); int B = in.nextInt();
int n = A;
int res = 0;
while (n ... |
A11201 | A12820 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Googlers {
static int judgeGooglersNum(String input) {
int result = 0;
String[] s = input.split(" ");
int N = Integer.parseInt(s[0]);
int S = Integer.p... |
B11421 | B11835 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Recycled {
public static void main(String[] args) throws Exception{
String inputFile = "C-small-attempt0.in... | import java.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.HashMap;
import java.util.Map;
public class RecycledNumbers {
public static void main(String[] args) {
int cases = 0,... |
A20934 | A22931 | 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()... | public class Googlers {
public static int google(int N, int S, int P, int[] googler) {
int counter = 0;
for (int j = 0; j < googler.length; j++) {
if (googler[j] % 3 == 0 && P >= 0) {
if (googler[j] != 0) {
if (googler[j] / 3 >= P) {
counter++;
} else if (googler[j] / 3 + 1 >= P && S != 0) {... |
A20490 | A22371 | 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... | public class Dancing {
public static int atLeast;
public static Googler[] googlers;
public static void main(String[] args) {
doProblems("100\n" +
"6 2 8 29 20 8 18 18 21\n" +
"70 70 7 20 6 28 3 3 27 25 22 18 24 20 2 17 9 27 27 28 2 8 4 10 26 28 3 9 24 28 8 18 3 23 14... |
A10699 | A10514 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Dancing {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) ... | import java.util.*;
public class B {
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for (int t = 1; t <= T; ++t)
{
int N = in.nextInt();
int S = in.nextInt();
int P = in.nextInt();
int withoutS = 0; // those that got it without an S
i... |
B20291 | B21193 | 0 | import java.io.*;
import java.util.*;
class B
{
public static void main(String[] args)
{
try
{
BufferedReader br = new BufferedReader(new FileReader("B.in"));
PrintWriter pw = new PrintWriter(new FileWriter("B.out"));
int X = Integer.parseInt(br.readLine());
for(int i=0; i<X; i++)
{
String[]... | import java.util.Scanner;
public class QuestionB extends Question{
private int N;
private int S;
private int p;
private int[] dancers;
public QuestionB(Result result, Counter counter)
{
super(result, counter);
}
@Override
public void readInput(Scanner scanner) {
N = scanner.nextInt();
S = scanner.n... |
B20006 | B21292 | 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 qualification_2012;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;
public class PC {
static Scanner sc = new Scanner(System.in);
static PrintWriter pw = new PrintWriter(System.out);
public static void main(String[] args) {
int n = sc.nextInt();
for (int i = 1; i <= n... |
A10568 | A11006 | 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.awt.image.BufferStrategy;
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.util.ArrayList;
import java.util.Scanner;
public class DancingGooglers {
public static void ... |
B12669 | B12067 | 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.ivantod.codejam2012;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Numbers {
private void process() throws Exception {
Scanner s=new Scanner(System.in);
int numCases=s.nextInt();
s.nextLine();
for (int ca=1; ca<=numCases; ca++) {
int A=s.nextInt()... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.