F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
A12460 | A13089 | 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.*;
import java.util.Arrays;
import java.util.Locale;
import java.util.Scanner;
public class DancingWithTheGooglers {
// -ea âXmx256M âXss64M
int N, S, p;
int[] t;
private Object solve() throws Exception {
Arrays.sort(t);
int result = 0;
for (int i = t.length ... |
B12570 | B12012 | 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 int computeDigits(int x){
if(x<10){
return 1;
}else{
return 1+computeDigits(x/10);
}
}
public static boolean recycled(int x, int y){
int n = computeDigits(x);
for(int i = 1;i<n;i++){
int c = (int)Math.pow(10,i);
int number = ... |
B21968 | B20930 | 0 | import java.util.*;
import java.io.*;
public class recycled_numbers {
public static void main(String[]a) throws Exception{
Scanner f = new Scanner(new File(a[0]));
int result=0;
int A,B;
String n,m;
HashSet<String> s=new HashSet<String>();
int T=f.nextInt(); //T total case count
for (int t=1; t<=T... | import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Solution {
public static void main(String[] args)
{
Scanner s = new Scanner(System.in);
int size = s.nextInt();
for (int count = 1; count <= size; count++){
int lowB = s.nextInt();
int highB = s.nextInt();
in... |
B10485 | B13238 | 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.LinkedList;
import java.util.Scanner;
public class Recycle {
private static int[] total(int r) {
int i=1, t=10;
while(r/t > 0) {
i++;
t*=10;
}
return new int[] {i,t/10};
}
private static int pow(int c) {
int t=1;
while(c-->0)
t*=10;
return t;
}
private static int recy... |
B22190 | B22243 | 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.Arrays;
import java.util.Scanner;
/**
* @author Dmitry Levshunov (levshunov.d@gmail.com)
*/
public class TaskC {
private static boolean[] used = new boolean[2000001];
private static int length;
private static int pow;
public static void main(String[] args) throws Exception {
... |
B20566 | B20713 | 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.util.*;
public class c{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
long[] powers = new long[10];
for(int j = 0; j<10; j++){
powers[j]=(long)Math.pow(10,j);
}
for(int tt = 1; tt<=T; tt++){
int a =sc.nextInt();
int b =sc.nextInt();
... |
B13196 | B12564 | 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.Scanner;
public class CodeC{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int tcase;
int a, b;
int numDigit;
int num;
tcase=sc.nextInt();
for(int q=1;q<=tcase;q++){
a=sc.nextInt();
b=sc.nextInt();
num=0;
for(int i=a;i<=b;i++){
numDigit=(i... |
B12082 | B11740 | 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.*;
import java.io.*;
public class recycle {
public static int[] pow10 = {1,10,100,1000,10000,100000,1000000,10000000};
public static void main(String[] args) throws Throwable {
Scanner input=new Scanner(new File("recycle.in"));
PrintWriter out=new PrintWriter(new File("recycle.out"));
int ... |
B13196 | B10836 | 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 codejam;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
public class RecycledNumbers {
private StreamTokenizer in;
private PrintWriter out;
// private Set<Chain> map = new HashSet<... |
B12085 | B10378 | 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.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
/**
*
* @author pulasthi
*/
public class QC12 {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
PrintWriter out = new PrintWriter("c.txt");
int T = sc.nextI... |
B12570 | B10236 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
public class prob2 {
public static void main(String[] args) {
BufferedReader inputStream = null;
try {
inputStream = new BufferedReader(new FileReader(
"C:/Users/vpamarty.SYMPHONY/Downloads/C-small-attempt1.in"));
Str... |
B20856 | B20064 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Happy;
import java.io.*;
import java.math.*;
import java.lang.*;
import java.util.*;
import java.util.Arrays.*;
import java.io.BufferedReader;
//import java.io.IOException;
//import java.io.InputStreamReader;
//... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;
public class recycled {
private static File f = new File("C:/Users/Cybermask/Desktop/myfile.txt");
private static File outfile = ... |
A21010 | A20159 | 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.util.Scanner;
class B{
public static void main(String[] args) {
if(args.length==0){
System.out.println("Error :: Please provide input file name as first command line argument");
System.out.println("Usage :: java Main <file_name>");
System.out.println("Example :: java Main ... |
B20856 | B22090 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Happy;
import java.io.*;
import java.math.*;
import java.lang.*;
import java.util.*;
import java.util.Arrays.*;
import java.io.BufferedReader;
//import java.io.IOException;
//import java.io.InputStreamReader;
//... |
import java.util.*;
import java.io.*;
public class template {
private StringBuilder result = new StringBuilder();
public static void main(String[] args) {
new template().go();
}
public void go() {
File inputFile = new File("/Users/amornchaikanokpullwad/Documents/input.in");
... |
B10155 | B11691 | 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.util.Scanner;
public class ProblemC {
public static int rotate(int x) {
int y = x % 10;
x /= 10;
int cd = (x + "").length();
if (x == 0) {
cd = 0;
}
y *= Math.pow(10, cd);
y += x;
return y;
}
public static String rotate(String x) {
String r = x.substring(0, 1);
if (x.length() ... |
A11277 | A11286 | 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.io.IOException;
public class DanceScore {
String[] result = new String[9000];
int testCases = 0;
public static void main(String[] args)throws Exception{
DanceScore bp = new DanceSc... |
B12115 | B11693 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... | import java.util.Scanner;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int numTestCases = Integer.valueOf(scanner.nextLine());
for ( int i =0; i < numTestCases; i++ ) {
String theCase = scanner.nextLine();
//Error checki... |
B21968 | B20662 | 0 | import java.util.*;
import java.io.*;
public class recycled_numbers {
public static void main(String[]a) throws Exception{
Scanner f = new Scanner(new File(a[0]));
int result=0;
int A,B;
String n,m;
HashSet<String> s=new HashSet<String>();
int T=f.nextInt(); //T total case count
for (int t=1; t<=T... | package gcj2012;
import java.io.File;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.Scanner;
public class C {
static String BASEPATH = "x:\\gcj\\";
static boolean LARGE = true;
static String INPATH = BASEPATH + C.class.getSimpleName()... |
B10702 | B11717 | 0 | import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Recycle {
private static HashMap<Integer, HashSet<Integer>> map = new HashMap<Integer, HashSet<Integer>>();
private static HashSet<Integer> toSkip = new HashSet<Integer>();
/**
* @param args
*/
public static void main(S... | import java.util.ArrayList;
import java.util.Scanner;
public class QuestionC extends Question{
private int A;
private int B;
private int significant;
private int digits;
public QuestionC(Result result, Counter counter)
{
super(result, counter);
}
@Override
public void readInput(Scanner scanner) {
A = ... |
B12762 | B10633 | 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.*;
import java.util.*;
public class GoogleQual2012C
{ public static void main(String[] args) throws Throwable
{ new GoogleQual2012C();
}
public GoogleQual2012C() throws Throwable
{ Scanner in = new Scanner(new File("C-small-attempt0.in"));
PrintWriter out = new PrintWr... |
A10568 | A12956 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader (new... | import java.io.*;
import java.util.*;
public class b {
public static void main(String[] args) {
Scanner fin = new Scanner(System.in);
int numCases = fin.nextInt();
for (int loop=1; loop<=numCases; loop++) {
int numPeople = fin.nextInt();
int numSurprise = fin.nextInt();
int threshold = fin.nextInt... |
A10996 | A12512 | 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);
... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package dancingwithgoogler;
/**
*
* @author WC
*/
public class DancingWithGoogler {
private int numberOfSurprising = 0;
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
... |
A12570 | A10604 | 0 | package util.graph;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
public class DynDjikstra {
public static State FindShortest(Node start, Node target) {
PriorityQueue<Node> openSet = new PriorityQueue<>();
Set<Node> closedSet = new HashSet<>();
openSet.add... | package base;
public interface Assignment {
String solve();
}
|
B10245 | B10586 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
public class C {
public static void main(String[] args) throws Exception{
Scanner sc = new Scanner(new File("C.in"));
PrintWriter out = new PrintWriter(new ... |
B20566 | B20433 | 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.*;
import java.util.*;
public class GoogleQual2012C
{ public static void main(String[] args) throws Throwable
{ new GoogleQual2012C();
}
public GoogleQual2012C() throws Throwable
{ Scanner in = new Scanner(new File("C-large.in"));
PrintWriter out = new PrintWriter(new ... |
B11318 | B12975 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Madu
*/
import java.io.*;
public class Ex3 {
public static void main(String[] args) {
try {
FileInputStream fstream = new FileInputStream("C:/Users/Madu/Documents/NetBeansP... |
A10568 | A12116 | 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;
import java.io.OutputStream;
import java.io.IOException;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.io.FileInputStream;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
* @author Prabu
*/
public class Main {
publi... |
B11327 | B12161 | 0 | package recycledNumbers;
public class OutputData {
private int[] Steps;
public int[] getSteps() {
return Steps;
}
public OutputData(int [] Steps){
this.Steps = Steps;
for(int i=0;i<this.Steps.length;i++){
System.out.println("Test "+(i+1)+": "+Steps[i]);
}
}
}
| import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.Vector;
public class problemC {
Vector<String> lines = new Vector<String>();
public static void main(String[] arg) {
problemC pc = new problemC();
pc.lines = pc.readfile("C:... |
B20734 | B21699 | 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 static java.util.Arrays.deepToString;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.concurrent.Callable;
import java.util.concurrent.... |
B11421 | B12503 | 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 qualifier;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class TC {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
PrintWrit... |
B11318 | B11103 | 0 | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
int casos=1, a, b, n, m, cont;
while(t!=0){
a=sc.nextInt();
b=sc.nextInt();
if(a>b){
int aux=a;
a=b;
b=aux;
}
System.out.printf("Case #%d: ",casos... | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Scanner;
/**
* @author Mark Devine
*
*/
public class C {
static final boolean DEBUG = false;
static Scanner in;
static PrintStream out;
public static void main(String[] args) throw... |
A22992 | A22418 | 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 googlecodejam;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Scanner;
public class GoogleCodeJam {
public static int calcGooglers(int p, int s, int[] g) {
int avg = p*3;
int n = g.length;
int cont = 0;
for (int i = 0... |
B20856 | B20900 | 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;
//... | /**
* Copyright 2012 Christopher Schmitz. All Rights Reserved.
*/
package com.isotopeent.codejam;
import com.isotopeent.codejam.lib.SolverBase;
import com.isotopeent.codejam.lib.Utils;
import com.isotopeent.codejam.lib.converters.IntArrayLine;
public class Solver extends SolverBase<int[]> {
private static final ... |
A21396 | A22160 | 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++){
... | /*************************************************************************
* Compilation: javac In.java
* Execution: java In
*
* Reads in data of various types from: stdin, file, URL.
*
* % java In
*
* Remarks
* -------
* - isEmpty() returns true if there is no more input or
* it is all whi... |
B10858 | B10323 | 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.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.StringTokenizer;
/**
*
*/
/**
* @author Bageshwar
*
*/
public class Recycle {
/**
* @param args
* @throws IOException
*/
public static void main(Strin... |
A22992 | A21197 | 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 dancingWithTheGooglers;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class DancingWithTheGooglers {
public static void main(String[] args) {
F... |
B11327 | B12170 | 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 recycled;
import java.util.Scanner;
public class Recycled {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int t = scanner.nextInt();
int[] count = new int[t];
for (int i = 0; i < t; i++) {
int a = scanner.nextInt();
... |
B22190 | B20855 | 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.Scanner;
public class RecycledNumbers {
static int recycle(int n, int B) {
String nString = String.valueOf(n);
int out = 0;
for (int i = 0; i < nString.length(); i++) {
int cut = nString.length() - (i + 1);
String temp = nString.substring(cut) + nString.substring(0, cut);
in... |
B10485 | B13036 | 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 qualification.q2;
/**
* Created by IntelliJ IDEA.
* User: ofer
* Date: 14/04/12
* Time: 18:47
* To change this template use File | Settings | File Templates.
*/
public class Q2Solver {
public int solve(int n,int s,int p, int[] sums){
int res = 0;
int surprisesLeft = s;
... |
A11201 | A10560 | 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 qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.HashMap;
public class DancingWithGoogler {
public static void main(String[] args) thro... |
A20934 | A21988 | 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.util.Scanner;
public class Dancing {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int numCases = sc.nextInt();
for (int i = 0; i < numCases; i++) {
int N = sc.nextInt();
int S = sc.nextInt();
int S_counter = S;
int p = sc.... |
A22191 | A21716 | 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.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class DancingWithTheGooglers {
private int calc(){
return 0;
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int total = in.nextInt();
int totGooglers = 0;
int totStriplets = 0;
int... |
A22771 | A22656 | 0 | package com.menzus.gcj._2012.qualification.b;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class BProcessorFactory extends AbstractProcessorFactory<BInput, BOutputEntry> {
public BProcessorFactory(Str... | import java.io.*;
import java.util.*;
public class tr
{
public static void main(String args[])throws FileNotFoundException,IOException
{
RandomAccessFile in=new RandomAccessFile("B-large.in","r");
FileOutputStream out= new FileOutputStream("out.txt");
int o=Integer.parseInt(in.readLine());
int... |
A20382 | A22160 | 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... | /*************************************************************************
* Compilation: javac In.java
* Execution: java In
*
* Reads in data of various types from: stdin, file, URL.
*
* % java In
*
* Remarks
* -------
* - isEmpty() returns true if there is no more input or
* it is all whi... |
A22771 | A20561 | 0 | package com.menzus.gcj._2012.qualification.b;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class BProcessorFactory extends AbstractProcessorFactory<BInput, BOutputEntry> {
public BProcessorFactory(Str... |
import java.io.File;
import java.io.FileReader;
import java.util.Scanner;
/**
*
* @author Gershom
*/
public class DancingWithGooglers {
public static void main(String[] args0) {
try {
File f = new File("example");
Scanner s = new Scanner(new FileReader(f));
int num... |
A12544 | A12773 | 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.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner r = new Scanner(System.in);
int T = r.nextInt();
int caseNumber = 1;
while(T-- > 0){
int N = r.nextInt();
int S = r.nextInt();
int P = r.nextInt();
int[] a = new int[N];
... |
B10702 | B11950 | 0 | import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Recycle {
private static HashMap<Integer, HashSet<Integer>> map = new HashMap<Integer, HashSet<Integer>>();
private static HashSet<Integer> toSkip = new HashSet<Integer>();
/**
* @param args
*/
public static void main(S... | import java.io.*;
public class Recycler {
public static void main(String[] args) {
Recycler rec = new Recycler();
String line = "";
BufferedReader br;
BufferedWriter output;
FileWriter fstream;
int x;
int y;
try {
br = new BufferedReader(new FileReader("C-small-attempt0.in"));
li... |
B20566 | B20950 | 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.util.ArrayList;
import java.util.Scanner;
public class Recycle2 {
private static int solve(int L, int H) {
class Slice {
int L,H,mul,dig;
Slice(int LL,int HH,int Mull,int digg) {
L=LL; H=HH; mul=Mull; dig=digg;
}
public String toString() { return String.format("%d-%d, %d(%d)", L,H,mu... |
B20734 | B20101 | 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 qualifying;
import java.util.*;
public class RecycledNumbers {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
final int NUM_TESTS = in.nextInt();
for (int t = 1; t <= NUM_TESTS; ++t) {
final int A = in.nextInt();
final int B = in.nextInt();
final int num... |
B20291 | B21746 | 0 | import java.io.*;
import java.util.*;
class B
{
public static void main(String[] args)
{
try
{
BufferedReader br = new BufferedReader(new FileReader("B.in"));
PrintWriter pw = new PrintWriter(new FileWriter("B.out"));
int X = Integer.parseInt(br.readLine());
for(int i=0; i<X; i++)
{
String[]... | package recyclednumbers;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
/**
*
* @author Kocmi
*/
public class RecycledNumbers {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(Sy... |
A11502 | A10071 | 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.*;
public class CodeJamQual2 {
/**
* @param args
*/
public static void main(String[] args) {
try{
// Open the file that is the first
// command line parameter
File file = new File("input.in");
FileInputStream fstream = new FileInputStream("input.in");
// Get the object of DataIn... |
B12762 | B10924 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.File;
import java.io.FileInputStream;
import java.util.Scanner;
/**
*
* @author imgps
*/
public class C {
public static void main(String args[]) throws Exception{
int A,B;
int ctr ... | package utils;
/**
*
* @author Fabien Renaud
*/
public abstract class JamCase implements Runnable, JamCaseSolver {
protected final int number;
protected String result;
private final StopWatch timer;
private final Jam parent;
protected JamCase(Jam parent, int number) {
this.parent = parent;
this.... |
B12082 | B12797 | 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 com.problemC;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class RecycledNumber {
private static int A = 1111;
private static int B = 2222;
public static int count = 0;
public static void main(String[] args) {
String[] s... |
B21968 | B20925 | 0 | import java.util.*;
import java.io.*;
public class recycled_numbers {
public static void main(String[]a) throws Exception{
Scanner f = new Scanner(new File(a[0]));
int result=0;
int A,B;
String n,m;
HashSet<String> s=new HashSet<String>();
int T=f.nextInt(); //T total case count
for (int t=1; t<=T... | import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class ProblemSample implements Problem {
private int solution;
private int A;
@Override
public void solve() {
int resultat = 0;
for (int n = A; n <= B; n++) {
// o... |
B12570 | B12083 | 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 jp.funnything.competition.util;
import java.util.Arrays;
import java.util.Iterator;
/**
* Do NOT change the element in iteration
*/
public class Permutation implements Iterable< int[] > , Iterator< int[] > {
public static int[] fromNumber( long value , final int n ) {
final int[] data = new int[... |
B20566 | B20268 | 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 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());... |
A12113 | A11012 | 0 | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class B {
static int[][] memo;
static int[] nums;
static int p;
public static void main(String[] args)throws IOException
{
Scanner br=new Scanner(new File("B-small-attempt0.in"... | package 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 Lamb... |
A20119 | A20560 | 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;
import java.util.Arrays;
public class Main {
private final static int N_MAX = 1024;
public static void main(String[] args) {
int T,N,S,P;
Scanner stdin = new Scanner(System.in);
T = stdin.nextInt();
for(int i = 1;i <= T;++i) {
N = stdin.nextInt();
S = stdin.nextInt();
... |
B10155 | B12993 | 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 mgg.utils;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
/**
* @author manolo
* @date 13/04/12
*/
public class CombinatoryUtils {
public static List<Integer> findAddingCombination(int total,
List<Integer> listOfNumbers) {
ArrayList<Integer> solution = new ArrayList<I... |
A12846 | A10630 | 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.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;
import java.util.List;
import java.util.StringTokenizer;
import java.util.Tre... |
A20261 | A21230 | 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.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class DancingGooglers
{
public static void main(String[] args)
{
try
{
BufferedReader reader = new BufferedReader(new FileReader(args[0]));
FileWriter fileWriter = new FileWri... |
A10699 | A11138 | 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.util.Scanner;
public class Dance {
public static void main(String[] args) throws FileNotFoundException {
File file = new File("input.in");
Scanner in = new Scanner(file);
int cases = in.nextInt();
for (int i = 0; i < cases; i++) {
... |
A11135 | A12745 | 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.util.List;
import java.util.Map;
public class Dwtg {
List<List<List<String>>> input;
public Dwtg(List<List<List<String>>> input){
this.input = input;
}
public void solve(){
int googlers;
int surprise;
int p;
int res;
int scoreOk;
int nbOk;
int potentialSurp;
int nbSurp;
for(... |
A20934 | A22996 | 0 | import java.util.*;
public class B {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
B th = new B();
for (int i = 0; i < T; i++) {
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt()... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.util.Arrays;
/**
*
* @author dannocz
*/
public class Triplet {
private int x;
private int y;
private int z;
public Triplet(int x, int y, int z) {
int[] array={x,... |
A12211 | A12375 | 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.*;
public class DancingGooglers {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int T = 0;
int N = 0;
int S = 0;
int p = 0;
int ptr = 0;
int maxCount = 0;
int scoreSum = 0;
int score1 = 0;
int score2 = 0;
int score3 = 0;
... |
B11327 | B10875 | 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 de.at.codejam.problem3.util;
import de.at.codejam.problem3.Problem3Case;
import de.at.codejam.util.AbstractCaseSolver;
import de.at.codejam.util.TaskStatus;
public class Problem3CaseSolver extends AbstractCaseSolver<Problem3Case> {
@Override
public String solveCase(TaskStatus taskStatus, Problem3Case caseT... |
B12115 | B10007 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... | import java.io.*;
import java.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 {
... |
B20023 | B21729 | 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.File;
import java.io.FileNotFoundException;
import java.util.HashMap;
import java.util.Scanner;
public class CodeJam2012Ex3 {
public static void main(String arg[]) throws FileNotFoundException {
File file = new File("C-large.in");
String output;
Scanner scanner = new Scanner(file);
int numTestC... |
B10485 | B13049 | 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 googleCodeJam;
import java.io.*;
import java.util.*;
public class firstExercise {
/**
* @param args
*/
public static void main(String[] args) {
try{
FileInputStream fstream = new FileInputStream("C-small-attempt3.in");
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = n... |
B20006 | B20394 | 0 | import java.io.*;
import java.math.BigInteger;
import java.util.*;
import org.jfree.data.function.PowerFunction2D;
public class r2a
{
Map numMap = new HashMap();
int output = 0;
/**
* @param args
*/
public static void main(String[] args)
{
r2a mk = new r2a();
try {
... | import java.io.*;
import java.util.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... |
A11502 | A12643 | 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.util.Scanner;
import jp.ne.sakura.yuki2006.CodeJam.CodeJam;
import jp.ne.sakura.yuki2006.CodeJam.ITestCase;
/**
*
*/
/**
* @author yuki
*
*/
public class DancingWithTheGooglers implements ITestCase {
/*
* (é Javadoc)
*
* @see jp.ne.sakura.yuki2006.CodeJam.ITestCase#testCase(java.util.Scann... |
A12846 | A12373 | 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 taskb;
import java.io.FileNotFoundException;
import java.util.*;
import java.io.File;
import java.io.PrintWriter;
public class TaskB {
private void solve(Scanner in, PrintWriter out, int caseNum){
int res = 0;
int N = in.nextInt();
int S = in.nextInt();
int p = in.... |
A11201 | A12662 | 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.FileNotFoundException;
import java.io.FileReader;
import java.util.Iterator;
import java.util.Scanner;
public class DancingWithGooglers {
public static class Scores {
public final int S;
public final int p;
public final int[] t;
public Scores(int S, int p, int[] t) ... |
B12082 | B10594 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
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.StringTokenizer... |
A20261 | A22738 | 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 er.dream.codejam.helpers;
import java.io.File;
import java.util.List;
public abstract class ProblemSolver {
protected FileHandler fileHandler = new FileHandler();
protected abstract List<String> handleInput();
public void execute(){
File[] files = fileHandler.listFiles();
for(File f : files){
... |
A22078 | A22826 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
public class GooglersDancer {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated metho... | package mgg.utils;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
/**
* @author manolo
* @date 13/04/12
*/
public class StringUtils {
public static List<Integer> stringWithIntegersToList(String str, int numItems, String delim){
ArrayList<Integer> list = new ArrayList<Inte... |
A21396 | A22463 | 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++){
... | public abstract class JamCase {
int lineCount;
}
|
A11277 | A10668 | 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.IOException;
import java.util.StringTokenizer;
public class Judging {
private int cases;
public Judging() throws IOException {
cases = Integer.valueOf(getLine());
run();
}
public String getLine() throws IOException {
String s = "";
char c;
while ((c = (char) System.in.read()) != '\n') {... |
B10149 | B12303 | 0 | import java.io.FileInputStream;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeSet;
// Recycled Numbers
// https://code.google.com/codejam/contest/1460488/dashboard#s=p2
public class C {
private static String process(Scanner in) {
int A = in.nextInt();
int B = in.nextInt();
int res =... | package com.mohit.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;
public class RecycledNumbers {
public static void main(String[] args) {
try {
int noOfTests = 0;
... |
B21207 | B21921 | 0 | /*
* Problem C. Recycled Numbers
*
* Do you ever become frustrated with television because you keep seeing the
* same things, recycled over and over again? Well I personally don't care about
* television, but I do sometimes feel that way about numbers.
*
* Let's say a pair of distinct positive integers (n, m) ... | import java.io.*;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class Main {
public static void main(String[] args) throws Exception {
PrintWriter out = new PrintWriter(new FileOutputStream(new File("output.txt")), false);
BufferedReader in = new B... |
A22642 | A21833 | 0 | import java.util.*;
import java.io.*;
public class DancingWithTheGooglers
{
public DancingWithTheGooglers()
{
Scanner inFile = null;
try
{
inFile = new Scanner(new File("inputB.txt"));
}
catch(Exception e)
{
System.out.println("Problem ope... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package google.code.jam;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Bogatinovi
*/
public cla... |
A22360 | A20293 | 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.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... |
B10245 | B10923 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package utils;
/**
*
* @author fabien
*/
public interface JamCaseSolver {
public void parse();
public void solve();
} |
A20382 | A21632 | 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.*;
import java.util.Arrays;
/**
* @author Dmitry Korolev
*/
public class Task2 {
public static void main(String[] args) throws IOException {
Reader inputReader = /*new InputStreamReader(System.in);*/ new FileReader("B-large.in");
Writer outputWriter = /*new Outpu... |
A20382 | A22463 | 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... | public abstract class JamCase {
int lineCount;
}
|
A22771 | A21805 | 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.codejam.util;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
public class CodeJamOutputFile extends File {
/**
*
*/
private static final long serialVersionUID = -6971460798309687528L;
private FileWriter writer;
private Boolean caseZero = false;
public CodeJ... |
B21049 | B20731 | 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... | 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... |
B12570 | B12702 | 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 cj;
import java.io.IOException;
import java.io.FileReader;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.FileWriter;
import java.util.List;
import java.util.ArrayList;
import java.util.Scanner;
public class Utils {
public static int[] toInts(String str, String sep) {
Str... |
B20291 | B20457 | 0 | import java.io.*;
import java.util.*;
class B
{
public static void main(String[] args)
{
try
{
BufferedReader br = new BufferedReader(new FileReader("B.in"));
PrintWriter pw = new PrintWriter(new FileWriter("B.out"));
int X = Integer.parseInt(br.readLine());
for(int i=0; i<X; i++)
{
String[]... | package ch.googlecodejam.qualround;
import java.util.ArrayList;
import java.util.List;
public class RecycledNumbers {
public static String solve(List<List<String>> values) {
StringBuilder result = new StringBuilder();
int numberOfLine = 1;
for (List<String> line : values) {
... |
A21396 | A22131 | 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 cats;
import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
public class Main {
public Main() throws Exception{
FileReader fr = new FileReader(new File("input.txt"));
BufferedReader in = new BufferedReader(fr);
File outFile = new File("output.txt");
outFile.createNewFile();
... |
B10485 | B10287 | 0 |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class Recycle
{
public static void main(String[] args)
{
/* Set<Integer> perms = getPermutations(123456);
for(Integer i: p... | import java.io.*;
import java.util.Scanner;
public class jam3Rec {
public static void main(String args[]) throws java.lang.Exception
{
int a,b,n,m, cnt=0,len=0;
//a=1111;b=2222;
int t,cas=1;
//System.out.println();
//Scanner scan=new Scanner(System.in);
//Scanner scan=new Scanner(new FileReader("i... |
A10699 | A10167 | 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.FileInputStream;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.Scanner;
/**
* @author: Ahmad Medhat Othman
* @codeJame: AMedOs
* @topCoder: AMedOs
* @email :amedhat.cs@gmail.com
* */
public class B {
public static void main(String[] args) throws Exception {
/... |
B10361 | B10261 | 0 | package codejam;
import java.util.*;
import java.io.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("in.txt"));
PrintWriter out = new PrintWriter(new File("out.txt"));
int T = Integer.parseInt(in.readLine());... | package qualification;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
import core.ExtendedBufferedReader;
import core.Template;
public class ProblemC extends Template {
int _numberOfCases;
Vector<List<Integer>> _cases = new Vector<List<Integer>>();
@Override
public void feedData(Ex... |
B10245 | B10486 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;
public class Solution {
/**
* @param args
* @throws Exception
*/
public void doMain() throws Exception {
Scanner sc = new Scanner(new FileReader("input.txt"));
PrintWri... |
B10485 | B13066 | 0 |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class Recycle
{
public static void main(String[] args)
{
/* Set<Integer> perms = getPermutations(123456);
for(Integer i: p... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
public class Recycled {
private static boolean contains(Li... |
B20023 | B21019 | 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.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
/**
*
* @author Chadi
*/
class TestCase {
int A;
int B;
public TestCase() {
}
public in... |
A21557 | A22662 | 0 | import java.io.*;
import java.util.*;
public class DancingWithGooglers {
public static class Googlers {
public int T;
public int surp;
public boolean surprising;
public boolean pSurprising;
public boolean antiSurprising;
public boolean pAntiSurprising;
public Googlers(int T, int surp) ... | import java.util.Scanner;
public class BS {
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
int count = in.nextInt();
for (int i = 1; i <= count ; i++) {
int n = in.nextInt();
int s = in.nextInt();
int p = in.nextInt();
int p_count = 0;
int s_count = 0;
for (... |
A21557 | A21462 | 0 | import java.io.*;
import java.util.*;
public class DancingWithGooglers {
public static class Googlers {
public int T;
public int surp;
public boolean surprising;
public boolean pSurprising;
public boolean antiSurprising;
public boolean pAntiSurprising;
public Googlers(int T, int surp) ... | package 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 {
... |
B11421 | B10352 | 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.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("in1.txt")... |
B10899 | B12156 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
public class ReadFile {
public static void main(... | import java.util.*;
public class Recycled {
static int CAP = 2000000;
static long[] f;
static int[] pow = new int[]{1,10,100,1000,10000,100000,1000000};
public static void main(String[] args){
Scanner reader = new Scanner(System.in);
int times = reader.nextInt();
for(int k = 1; k <= times; k++){
int n ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.