F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
B10231 | B11672 | 0 | import java.io.*;
class code1
{
public static void main(String args[]) throws Exception
{
File ii = new File ("C-small-attempt1.in");
FileInputStream fis = new FileInputStream(ii);
BufferedReader br = new BufferedReader(new InputStreamReader (fis));
int cases = Integer.parseInt(br.readLine());
FileOutput... | import java.util.ArrayList;
import java.util.Scanner;
public class RecycleNumber {
/**
* @param args
*/
int NoOfTestCase = 0;
int A = 0;
int B = 0;
ArrayList<Integer> knownList = new ArrayList<Integer>();
public static void main(String[] args) {
// TODO Auto-generated method stub
RecycleNumber rn = ne... |
B10485 | B11993 | 0 |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class Recycle
{
public static void main(String[] args)
{
/* Set<Integer> perms = getPermutations(123456);
for(Integer i: p... | import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
public class C {
C() {
Scanner in=new Scanner(System.in);
for (int T=in.nextInt(),TC=1; T-->0; ++TC) {
int A=in.nextInt(),B=in.nextInt();
int cnt=0;
for (int m=2; m<=B; ++m)
cnt+=count(A,m);
System.out.printf("Case #%d: %... |
B10149 | B11371 | 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.util.Scanner;
public class C {
int A = 0;
int B = 0;
int cnt = 0;
public int getDig(int x){
int temp = x;
int dig = 0;
while(temp>0){
dig++;
temp/=10;
}
return dig;
}
public int flip(int x, int time){
int temp = x;
int base = 1;
for(int i = 1; i<=time;i++) base*=10... |
A21010 | A20221 | 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 codejam2;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Date;
import java.util.Scanner;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
public a... |
A11917 | A11466 | 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... |
public class Triplet implements Comparable<Triplet> {
private int s1;
private int s2;
private int s3;
public Triplet(int _s1,int _s2,int _s3){
s1=_s1;
s2=_s2;
s3=_s3;
}
@Override
public int compareTo(Triplet o) {
return new Integer(o.getMax()).compareTo(this.getMax());
}
public boolean isSurpr... |
A22378 | A21837 | 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.util.Scanner;
import java.util.StringTokenizer;
/**
*
* @author rama
*/
public class Codejam1 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n=Integer.parseInt(in.nextLine());
... |
A22771 | A20215 | 0 | package com.menzus.gcj._2012.qualification.b;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class BProcessorFactory extends AbstractProcessorFactory<BInput, BOutputEntry> {
public BProcessorFactory(Str... | package com.google.code;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.Reader;
/**
* @author Wellington Tadeu dos Santos [wellsantos@wellsantos.com]
*/
public class ProblemB {
boolean endOfLine;
Reader reader;
Appendable writer;
public ProblemB(Reader in, Appendable out) thr... |
A20934 | A20936 | 0 | import java.util.*;
public class B {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
B th = new B();
for (int i = 0; i < T; i++) {
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt()... | import java.io.*;
import java.util.*;
public class DancingGooglers {
static class InputReader {
BufferedReader bin;
StringTokenizer tokenizer;
public InputReader(InputStream in) {
bin = new BufferedReader(new InputStreamReader(in));
tokenizer = null;
}
public InputReader(String fname) {
try... |
B10231 | B11568 | 0 | import java.io.*;
class code1
{
public static void main(String args[]) throws Exception
{
File ii = new File ("C-small-attempt1.in");
FileInputStream fis = new FileInputStream(ii);
BufferedReader br = new BufferedReader(new InputStreamReader (fis));
int cases = Integer.parseInt(br.readLine());
FileOutput... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.BitSet;
public class ProbC {
public static long solve(int A, int B) {
int[] basePower = new int[8];
basePower[0] =1;
for(int i=1; i<8; i++)
basePower[i] = basePower[i-1] * 10;
... |
B21752 | B20464 | 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 recyclednumbers;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.Vector;
/**
*
* @author Kholoud
*/
public cl... |
B11327 | B10503 | 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]);
}
}
}
| package year2012.RecycledNumbers;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
final class RecycledNumbers {
/**
* @param args
* @throws IOException
*/
static int solve(i... |
B13196 | B12427 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Q3M {
public static void main(String[] args) throws Exception {
compute();
}
private ... | import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class RecycleNumbers {
public static void main(String[] args) {
try{
BufferedReader fileIn = new BufferedReader(new FileReader("C-small-attempt0.in"));
int cases = In... |
B20734 | B22078 | 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.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.Hashtable;
public class GJ_QR_C {
public static int recycle(int A, int n){
String st = (new Integer(A)).toString();
return I... |
A11201 | A12396 | 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.... |
public class possible {
int Anom;
int High;
int count = 0;
possible(int anom, int high){
Anom = anom;
High = high;
}
public void canDo(int score){
int Score = score;
if(High > 0 && Score - High - (2 * (High- 1 )) >= 0){
++count;
}else if( Anom > 0 && High > 1 && Score - High - (2 * (High-... |
A20382 | A20216 | 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.*;
class code3
{
public static void main(String args[]) throws Exception
{
File ii = new File ("B-large.in");
FileInputStream fis = new FileInputStream(ii);
BufferedReader br = new BufferedReader(new InputStreamReader (fis));
int cases = Integer.parseInt(br.readLine());
FileOutputStream fo... |
B10245 | B10874 | 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 de.at.codejam.problem3.util;
import java.io.File;
import de.at.codejam.problem3.Problem3Case;
import de.at.codejam.util.AbstractOutputFileWriter;
public class Problem3OutputFileWriter extends
AbstractOutputFileWriter<Problem3Case> {
public Problem3OutputFileWriter(File outputFile) {
super(outputFile);
... |
B10149 | B12149 | 0 | import java.io.FileInputStream;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeSet;
// Recycled Numbers
// https://code.google.com/codejam/contest/1460488/dashboard#s=p2
public class C {
private static String process(Scanner in) {
int A = in.nextInt();
int B = in.nextInt();
int res =... | import java.io.*;
import java.util.*;
public class RecycledNumbers {
private static ArrayList<String> A,B;
public static void main(String[] args) throws Exception {
File in = new File("C-small-attempt0.in");
File out = new File("out.txt");
RecycledNumbers.read(in);
RecycledNumbers.print(out);
}
public static ... |
A11201 | A11090 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | package DancingWithTheGooglers;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.Collections;
import java.util.Scanner;
import java.util.ArrayList;
public class DancingWithTheGooglers {
public static void main(String[]... |
B13196 | B11683 | 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 ... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package uk.co.epii.codejam.recyclednumbers;
import java.util.TreeSet;
import uk.co.epii.codejam.common.AbstractProcessor;
/**
*
* @author jim
*/
public class RecycledNumbersProcessor extends AbstractProcessor {
... |
B13196 | B11859 | 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.HashSet;
public class Recycled {
public static void main (String[] args) {
In in = new In("input.txt");
int N = in.readInt();
for (int i = 1; i <= N; i++) {
int A = in.readInt();
int B = in.readInt();
int result = 0;
... |
B20424 | B20763 | 0 | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
// static int MAX = 10000;
static int MAX = 2000000;
static Object[] All = new Object[MAX+1];
static int size( int x ) {
if(x>999999) return 7;
if(x>99999) return 6;
if(x>9999) return 5;
if(x>999) retu... | import java.io.*;
import java.util.*;
public class C {
BufferedReader ins;
PrintStream outs;
static String INPUT = "C-large.in";
static String OUTPUT;
static {
OUTPUT = "C-large.out";
}
Map<String, Set<String>> map = new HashMap<String, Set<String>>();
public C(BufferedR... |
B22190 | B20945 | 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 ponder.CodeJamQualify;
import java.io.*;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;
/**
* @author: sg Date: 15.04.12
*/
public class TaskC
{
static Set<Integer> rotations(int x, int min, int max)
{
Set<Integer> rotations = new HashSet<Integer>();
String s = Inte... |
A21010 | A22713 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class Dance {
static int no_Test_Cases =0; //number of test cases
static String input_Array[]; //to read input f... |
B21752 | B20196 | 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 sun.reflect.generics.tree.Tree;
import java.io.*;
import java.util.TreeSet;
/**
* User: Andrii Baranov
* Date: 14.04.12
* Time: 14:11
*/
public class RecycledNumbers {
public static void main(String args[]) throws IOException {
BufferedReader br = new BufferedReader(new FileReader("in/C/C-large... |
B20291 | B20840 | 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.HashSet;
import java.util.Scanner;
import java.util.regex.Pattern;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author alvin
*/
public class RecycledNumbers {
public static void main(String[] args) {
Scanner sc = new... |
B11361 | B13195 | 0 | import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
public class C{
Scanner sc=new Scanner(System.in);
int INF=1<<28;
double EPS=1e-9;
int caze, T;
int A, B;
void run(){
T=sc.n... |
import java.io.*;
import java.util.*;
public class CodeJam2012_Q_C {
public int calc(int A, int B) {
boolean[] checked = new boolean[B-A+1];
int cnt = 0;
int D = String.valueOf(A).length();
int unit =1;
for(int i=1; i<D; i++) unit*=10;
for(int i=A; i<=B; i++) {
if(!checked[i-A]) {
checked[i-A]... |
B21790 | B22237 | 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 com.abuhijleh.googlejam;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class GoogleJam {
static final String code = "yhesocvxduiglbkrztnwjpfmaq";
public static void main(String[] args) {
File input = new File("inputFile");
String[] result;
Scanner scan;
... |
B12085 | B11126 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class rec1 {
public static void main(String args[]) throws Exception{
FileInputStream fs = new FileInputStream("input2.tx... |
A11917 | A12314 | 0 | package com.silverduner.codejam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
public class Dancing {
public static void main(String[] args) throws Exception {
File input = new File("B-small-attempt... | import java.io.*;
import java.util.*;
public class dancing {
private void go() throws Exception{
File infile = new File("B-small-attempt0.in");
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(infile)));
int num_of_cases = Integer.parseInt(br.readLine());
for(int i=1;i<=num_of_c... |
B11318 | B12210 | 0 | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
int casos=1, a, b, n, m, cont;
while(t!=0){
a=sc.nextInt();
b=sc.nextInt();
if(a>b){
int aux=a;
a=b;
b=aux;
}
System.out.printf("Case #%d: ",casos... | package hk.polyu.cslhu.codejam.solution.impl;
import hk.polyu.cslhu.codejam.solution.Solution;
import java.util.ArrayList;
import java.util.List;
public class StoreCredit extends Solution {
private int amountOfCredits, numOfItems;
private List<Integer> priceList;
@Override
public void setProblem(List<String> t... |
A22360 | A21976 | 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 com.renoux.gael.codejam.fwk;
import java.io.File;
import com.renoux.gael.codejam.utils.FluxUtils;
import com.renoux.gael.codejam.utils.Input;
import com.renoux.gael.codejam.utils.Output;
public abstract class Solver {
public void run() {
if (!disableSample())
runOnce(getSampleInput(), getSampleOutput(... |
A21010 | A20995 | 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 fixjava;
/**
* Convenience class for declaring a method inside a method, so as to avoid code duplication without having to declare a new method
* in the class. This also keeps functions closer to where they are applied. It's butt-ugly but it's about the best you can do in
* Java.
*/
public interface Lambd... |
B21227 | B21250 | 0 | import java.util.HashSet;
import java.util.Scanner;
public class C {
static HashSet p = new HashSet();
static int low;
static int high;
int count = 0;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int no = sc.nextInt();
for (int i = 1; i <= no; i++) {
p.clear();
lo... | import java.util.*;
import java.io.*;
import java.text.*;
public class Q {
private static long solve(int from, int to) {
int[] flag = new int[2000001];
long res = 0;
int t=from/10, b = 1;
while (t>0) {
b*=10;t/=10;
}
for (int i = from; i < to; ++i) {
t = i;
do {
t = (t /10) + (t%10 * b);
... |
A10699 | A12103 | 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.*;
import java.io.*;
class GooglerDancing2{
static int S,p,count=0;
static int[] g=new int[10];
static int[] v=new int[10];
static PrintWriter pw ;
public static void main(String[] args){
try {
File file = new File("B-small-attempt4.in");
FileReader fr = new FileReader(file);
BufferedReader br = ... |
A11917 | A11681 | 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.codejam._2012;
import java.io.File;
import java.util.Scanner;
public class DancingWithGooglers
{
int[][] maxScores;
private void setup()
{
maxScores = new int[31][2];
for(int i = 0; i <= 30; i++)
maxScores[i][1] = -1;
for(int score = 0; sco... |
A21010 | A22504 | 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.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Scanner;
public class B {
public static void main(String[] args) {
try {
// so eclipse can read file from system in
System.setIn(new FileInputStream(new File("large.in")));
} catch (IOException e) {
e.pri... |
A20934 | A20620 | 0 | import java.util.*;
public class B {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
B th = new B();
for (int i = 0; i < T; i++) {
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt()... | package net.anzix.learn.codejam.qr12;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class DancingWithTheGooglers {
private InputStream input;
private PrintStream output... |
A21396 | A20781 | 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.math.*;
import java.io.*;
import static java.lang.System.*;
import static java.lang.Math.*;
import static java.lang.Integer.*;
import static java.lang.Double.*;
import static java.lang.Long.*;
public class QB {
static String[] parts(BufferedReader br) throws Exception {
Stri... |
A20119 | A21858 | 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.Arrays;
import java.util.Scanner;
public class B {
int N;
int S;
int p;
int[] A = new int[100];
int[][] memo = new int[100][100];
boolean[][] normal = new boolean[11][31];
boolean[][] surprise = new boolean[11][31];
B() {
for (int a=0; a<=10; ++a) {
for (int b=a; b<=10 && b<=a+2; ... |
B10858 | B12987 | 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.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.*;
public class C {
Scanner sc;
PrintStream ps;
public void solve() {
int A = sc.nextInt();
int B = sc.nextInt();
int nr = 0;
for (int n=A; n<=B; n++) {
String s = n+""... |
A13029 | A11232 | 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... | package codejam2012.qualified;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class ProblemB {
static BufferedReader buffReader = null;
static BufferedWriter buffWriter = nu... |
A22992 | A23061 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package googlecodejam;
/**
*
* @author Bhanu
*/
import java.util.*;
public class DancingGooglers {
public static void main(String arg[]) throws Exception
{
int s1[] = {0,1,2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,... |
B12082 | B11795 | 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 gcj2012.qualificationround;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
public class RecycledNumbers {
public static void main(String[... |
B20424 | B21600 | 0 | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
// static int MAX = 10000;
static int MAX = 2000000;
static Object[] All = new Object[MAX+1];
static int size( int x ) {
if(x>999999) return 7;
if(x>99999) return 6;
if(x>9999) return 5;
if(x>999) retu... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class RecycledNumbersCodeJam2012Q {
public long solves(String A,String B){
long a = Long.parseLong(A);
long b = Long.parseLong(B);
long s = 0 ;
for(long i ... |
A22992 | A20527 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author dannocz
*/
public class InputReader {
public static Input r... | package practice;
import java.util.*;
public class GoogleDance {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int cases = Integer.parseInt(sc.nextLine());
for(int i = 0; i<cases; i++){
//Case starts here
int caseCounter = i+1;
String caseLine = sc.nextLine();
String[... |
A13029 | A13185 | 0 | import java.util.List;
public class Case implements Runnable {
private int id;
private String output;
private int n;
private int s;
private int p;
private List<Integer> g;
public Case(int id) {
this.id = id;
}
public Case(int id, int n, int s, int p, List<Integer> g) {
super();
this.id = id;
this... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.PrintWriter;
public class Main2 {
public static final String fileName = "A-small-attempt0.in";
/**
* @param args
* @throws FileNotFoundException
*/
public static void main(Stri... |
B10155 | B12379 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
/**
*
* @author eblanco
*/
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
impo... | import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
File file = new File("c:\\java\\results.txt");
file.createNewFile();
PrintStream out = new ... |
A12113 | A10669 | 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.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class DancingGoogle {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOExc... |
A10996 | A11014 | 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 fixjava;
import java.util.ArrayList;
import java.util.concurrent.Callable;
/** Parallel quicksort (inefficient initially, doubles the number of threads at each pivot) */
public class ParallelQuicksort<T extends Comparable<T>> implements Callable<Void> {
private ArrayList<T> list;
private ParallelWorkQueueD... |
B12570 | B13003 | 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 mgg.main;
import mgg.problems.ProblemC;
import mgg.utils.FileUtil;
public class Main {
// public final static String inFileName = ProblemA.EXAMPLE_IN;
// public final static String outFileName = ProblemA.EXAMPLE_OUT;
// public final static String inFileName = ProblemA.A_SMALL_IN;
// public final static Stri... |
A22642 | A20648 | 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.io.FileReader;
import java.io.LineNumberReader;
import java.io.PrintWriter;
import java.util.Scanner;
public class go2 {
public static final String IN_FILE = "B-large.in";
public static final String OUT_FILE = "out.txt";
public static void main(String[] args) throws Throwable {
try ... |
A21396 | A21233 | 0 | import java.util.*;
public class Test {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int i = 1; i<=T; i++) {
int n = in.nextInt();
int s = in.nextInt();
int p = in.nextInt();
int result = 0;
for(int j = 0; j<n; j++){
... | package codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.PrintWriter;
public class CodeJamRunner {
private PrintWriter pw = null;
/**
* Override this to do the real stuff.
* @param inputLine
*/
protected void process( int lineNr, String inputLine )
{
... |
A11502 | A10299 | 0 | package template;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
public class TestCase {
private boolean isSolved;
private Object solution;
private Map<String, Integer> intProperties;
private Map<String, ArrayList<Integer>> intArrayProperties;
private Map<String, Arra... | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class Dance {
private File file = new File("D:\\Sources\\GoogleCodeJam\\files\\B-small-attempt0.in");
private File outFile = new File("D:\\Sources\\GoogleCodeJam\\files\\result.out");
private Integer[]... |
B22190 | B21715 | 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 code.jam;
import java.io.*;
import java.util.*;
public class CodeJam {
public static void main(String[] args) throws FileNotFoundException, IOException {
String name = "test";
Scanner in = new Scanner( new BufferedReader( new FileReader(name + ".in") ) );
Buf... |
B13196 | B11006 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Q3M {
public static void main(String[] args) throws Exception {
compute();
}
private ... | package contests.GoogleCodejam.GCJ2012.qualification;
import contests.GoogleCodeJam.practice.GCJ2010.qualification.ProblemA;
import java.io.FileNotFoundException;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
/**
* Created with IntelliJ IDEA.
* User: vas... |
A22378 | A22327 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class Dancing_Googlers {
public static void main(String args[]) throws Exception
{
FileWriter ofstream = new FileWriter(... |
B20023 | B20300 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj2012.qual;
import java.io.File;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
/**
*
* @author scbit
*/
public class P3 {
/**
* @param args the command line argum... |
B10858 | B11710 | 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.*;
import java.util.*;
import java.math.*;
import java.text.*;
public class C {
public static void pl(Object O) {System.out.println(O);}
public static void pl() {System.out.println();}
public static void pr(Object O) {System.out.print(O);}
public static void p(Object O) {System.out.print(O);}
publi... |
A22191 | A22136 | 0 | package com.example;
import java.io.IOException;
import java.util.List;
public class ProblemB {
enum Result {
INSUFFICIENT,
SUFFICIENT,
SUFFICIENT_WHEN_SURPRISING
}
public static void main(String[] a) throws IOException {
List<String> lines = FileUtil.getLines("/B-large.in");
int cases = Int... | /**
*
*/
package asem.googe.codejam.qround;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
/**
* @author A.Alathwari
*
* Problem C :
*
*/
public class ProblemC implements Runnable {
asem.core.util.InputReader fin;
java.io.PrintWri... |
A11135 | A11621 | 0 | /**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/3/12
* Time: 11:00 AM
* To change this template use File | Settings | File Templates.
*/
import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;
import java.io.*;
import java.util.*;
import java.uti... | package codejam.surprisingGooglers;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class Solver {
public int getMaximumNumberOfPHavers(int numberOfSurprises, int bestResult, Integer... totals){
List<PossibleSurpriseCase> allCases = buildCases(numbe... |
A20382 | A21233 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... | package codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.PrintWriter;
public class CodeJamRunner {
private PrintWriter pw = null;
/**
* Override this to do the real stuff.
* @param inputLine
*/
protected void process( int lineNr, String inputLine )
{
... |
B21790 | B21511 | 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 codejam;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
public class QualificationC extends CodeJam {
public QualificationC(String file) throws Exception {
super(file);
}
@Override
public Object processCase(int caseNumber) throws Exception {
String readLine = readLine();... |
A20490 | A20293 | 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.io.IOException;
import java.io.PrintWriter;
public class DancingwithGooglers {
public static void main(String args[]) throws IOException{
String inputFile = args[0];
String outputFile = args[1];
BufferedReader input = new BufferedReader(ne... |
B12082 | B11400 | 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... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
public class Recycle {
public Recycle() {
String line;
Integer maxInputs,output;
Integer a, b;
try {
BufferedReader read = new BufferedReader(new Inp... |
B12074 | B12052 | 0 | package jp.funnything.competition.util;
import java.math.BigInteger;
/**
* Utility for BigInteger
*/
public class BI {
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger add( final BigInteger x , final BigInteger y ) {
return... | import java.io.*;
import java.util.HashSet;
public class ProblemC
{
public static void main(String[] args) throws Exception
{
String base = "C-small-attempt0";
BufferedReader reader = new BufferedReader(new FileReader(base+".in"));
BufferedWriter writer = new BufferedWriter(new FileWriter(base+".out"));
int ... |
A12544 | A11152 | 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.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
/**
*
* @author ZIYAN
*/
public class Codejam2 {
/**
* @param args the command line arguments
*/
public static void main(Stri... |
A10568 | A12438 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader (new... | import java.util.Scanner;
public class dance {
public static void main(String... args){
Scanner in = new Scanner(System.in);
int cases = in.nextInt();
int[] counts = new int[cases];
for(int i = 0;i<cases;i++){
int n = in.nextInt();
int s = in.nextInt();
int p = in.nextInt();
int sUsed = 0; // ... |
B11421 | B13135 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Recycled {
public static void main(String[] args) throws Exception{
String inputFile = "C-small-attempt0.in... | import java.util.ArrayList;
import java.util.HashMap;
public class Danc3 {
static ArrayList<Integer> allTheNumbers = new ArrayList<Integer>();
static HashMap<Long, Long> binomCoeff = new HashMap<Long, Long>();
public static int solveC(int A, int B)
{
allTheNumbers = new ArrayList<Integer>();
int count = 0;
... |
A11135 | A11324 | 0 | /**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/3/12
* Time: 11:00 AM
* To change this template use File | Settings | File Templates.
*/
import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;
import java.io.*;
import java.util.*;
import java.uti... | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
public class Evans2012B {
private final St... |
A12846 | A12230 | 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.IOException;
import java.util.ArrayList;
public class Main {
/**
* @param args
* @throws IOException
* @throws NumberFormatException
*/
public static void main(String[] args) throws NumberFormatException, IOException {
ArrayList<Problem> problems = Inputter.getProblems("B-small-attempt2... |
A22992 | A22065 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author dannocz
*/
public class InputReader {
public static Input r... | package hk.polyu.cslhu.codejam.solution.impl;
public class AlienLanguage {
}
|
A22378 | A20683 | 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... | /*
* Google Code Challenge Java
*
* Code written for the Google Code Challenge by Greg Dougherty
* Created: May 7, 2011
*
* Copyright 2011 by Greg Dougherty
*/
package com.google.GregTD.CodeJam2012Quals.Dancing;
import java.io.*;
/**
* @author Greg Dougherty
*
*/
public class Dancing
{
private static ... |
B12570 | B10609 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | import java.util.*;
import java.io.*;
public class C {
public static String convert(int num) {
char[] arr = Integer.toString(num).toCharArray();
Arrays.sort(arr);
return new String(arr);
}
public static void main(String[] args) throws Exception{
Scanner in = new Scanner(System.in);
int T = in.nextInt();... |
B10245 | B10729 | 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 qualificationRound;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
public class P3 {
public static int recycle(int j, int b) {
int ret = 0;
String old = Integer.toString(j);
int size = old.length();
HashSet<St... |
B21227 | B21606 | 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.*;
import java.util.*;
public class Java{
public static void main(String[] args) {
try {
BufferedReader in = new BufferedReader(new FileReader("C-large.in"));
int cases = Integer.parseInt(in.readLine());
for (int i = 1; i <= cases; i ++){
String[] temp = (in.readLine()).split(" ");
... |
A21010 | A21036 | 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.util.*;
import java.io.*;
import java.math.*;
public class Solver
{
private String key = "yhesocvxduiglbkrztnwjpfmaq";
public int[] convert(String[] s) {
int[] res = new int[s.length];
for(int i = 0;i < s.length; i++) {
res[i] = Integer.parseInt(s[i]);
}
return res;
}
private String de... |
A10699 | A10455 | 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) ... | /*
ID: yourID
LANG: JAVA
TASK: Dancing_With_the_Googlers
*/
import java.io.*;
import java.math.*;
import java.util.*;
/*public class Dancing_With_the_Googlers {
}
*/
public class Dancing_With_the_Googlers implements Runnable {
// based on Petr's template
boolean localDebug = false;
private void solve() throws IOE... |
B12941 | B11741 | 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.Scanner;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
/**
*Recycled Numbers
*/
/**
* @author Avengee
*/
public class Demo {
public static void main(String[] args) throws IOException {
//Reading and Writing Files
Scanner scan = new... |
A10793 | A10825 | 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.*;
import java.util.*;
public class GCJ_Q_B
{
// public static String
// public static int
// ArrayList list = new ArrayList();
// HashMap map = new HashMap();
// HashSet set = new HashSet();
// for(int i=0;i<;i++)
// for(int j=0;j<;j++)
// for(int k=0;k<;k++)
// System.out.println();
// Syste... |
A12544 | A11022 | 0 | package problem1;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Arrays;
public class Problem1 {
public static void main(String[] args) throws FileNotFoundException, IOException{
try {
TextIO... | package fixjava;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
import java.util.Map.Entry;
public class CountedSet<T> implements Set<T> {
HashMap<T, Integer> map = new HashMap<T, Integer>();
private static final Integer ONE = new... |
B10155 | B11847 | 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... | package info.m3o.gcj2012.recyclednumber;
import java.util.ArrayList;
import java.util.List;
public class RawInputLines_NotUsed {
protected List<String> rawInputLines;
public List<String> getRawInputLines() {
if (rawInputLines == null) {
rawInputLines = new ArrayList<String>();
}
... |
A12846 | A12980 | 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.Arrays;
public class Main{
public static void main(String[] args) throws Exception {
int t = Integer.parseInt(finB.readLine());
int test = 1;
while(test <= t){
int n = fnextInt();
int s = fnextInt();
int p = fnextInt();
int[] a = new int[n];
for(int i = 0; i <... |
B20023 | B20180 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public class Distincts {
public static void main(String[] args) throws Exception {
BufferedRea... |
A22378 | A22910 | 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.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
public class Dance {
static int getMaxGooglers(int N,int S, int p, int[] t) {
int count=0;
int surpriseCount=0;
int avg=p*3;
for(int i=0;i<N;i++) {
/*if(t[i]>=avg)
count... |
B20566 | B20702 | 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 org.moriraaca.codejam;
public interface TestCase {
}
|
A10699 | A12489 | 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.Scanner;
public class Dancing {
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
for (int C=1;C<=N;C++)
{
System.out.printf("Case #%d: ", C);
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt();
int count = 0;
... |
A21010 | A22681 | 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.BufferedWriter;
import java.util.*;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.lang.Math;
import java.util.ArrayList;
import java.util.HashMap;
import java.math.BigInteger;
public cla... |
A11135 | A12441 | 0 | /**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/3/12
* Time: 11:00 AM
* To change this template use File | Settings | File Templates.
*/
import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;
import java.io.*;
import java.util.*;
import java.uti... | package org.mlai.google.codejam;
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.Map;
public class DancingWi... |
A12460 | A10868 | 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.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Collections;
import java.util.HashMap;
public class tongue {
static HashMap<Str... |
A22078 | A20649 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
public class GooglersDancer {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated metho... | import java.util.*;
import java.io.*;
class Dancing{
public static void main(String args[])
{
File file = new File("B-large.in");
try{
FileWriter fstream = new FileWriter("result.txt");
BufferedWriter out = new BufferedWriter(fstream);
Scanner sc = new Scanner(file);
int tcs = s... |
B10245 | B12700 | 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 commons;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
public class FileUtilities {
public static void writeFile(List<String> strings, File file)
th... |
B13196 | B10460 | 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 ... |
public class codejam {
public static void main(String argv[]) throws Exception{
RecycledNumbers recycledNumbers=new RecycledNumbers();
recycledNumbers.start();
}
}
|
B22190 | B21897 | 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.util.*;
import java.util.regex.*;
import java.text.*;
import java.math.*;
import java.awt.geom.*;
import java.io.*;
public class cx{
public static void main(String[] args){
try{
File output;
FileWriter outputwriter;
BufferedWriter out;
String filename = "bx.out";
output = new File(... |
A12460 | A11486 | 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.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class Dancing {
public static void main(String[] args) throws IOException {
int count = 0;
int special = 0;
int googler = 0;
int best = 0;
int sp_co = 0;
int sat = 0;
... |
A12570 | A10189 | 0 | package util.graph;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
public class DynDjikstra {
public static State FindShortest(Node start, Node target) {
PriorityQueue<Node> openSet = new PriorityQueue<>();
Set<Node> closedSet = new HashSet<>();
openSet.add... | import java.io.*;
import java.util.*;
public class surprise
{
public static StringTokenizer st;
public static void main(String[] args)
{
try
{
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream("B-small-attempt0.in")));
PrintWriter pw = new PrintWriter(new FileWriter("outpu... |
A12846 | A10082 | 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 qualificationRound;
public class Dancing {
/**
*
* @param N
* Number of Googlers
* @param S
* number of surprising triplets of scores
* @param P
*
* @param Ti
* the total points of the Googlers
*
* @return what is the maximum number of Googlers that c... |
A22992 | A20431 | 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.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class DancingWithTheGooglers {
public static int count(int N, int S, int p, int[] num){
int sureCount = 0;
int possibleCount = 0;
for(... |
B10155 | B12277 | 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... | /*************************************************************************
* Compilation: javac StdIn.java
* Execution: java StdIn
*
* Reads in data of various types from standard input.
*
*************************************************************************/
import java.io.BufferedInputStream;
import... |
B12082 | B10535 | 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... | import java.util.*;
public class RecycledNum
{
private static int testCase;
public static void main( String[] args )
{
Scanner s = new Scanner( System.in );
RecycledNum r = new RecycledNum();
r.setTestCase(Integer.parseInt(s.nextLine()));
for( int i = 0; i < testCase; i++ )
{
int A ... |
B10149 | B13193 | 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.util.ArrayList;
import java.util.Scanner;
public class Prob3 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
int num = scan.nextInt();
scan.nextLine();
for(int... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.