F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
B20566 | B20744 | 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 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... |
A12460 | A12029 | 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... | /*
* Google Code Jam 2012 - Qualification Round (14.04.2012)
* Thomas "ThmX" Denoréaz - thomas.denoreaz@gmail.com
*/
package codejam._2012.qualif;
import static java.lang.Math.abs;
import static java.lang.Math.max;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.... |
B12941 | B12355 | 0 | package com.menzus.gcj._2012.qualification.c;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class CProcessorFactory extends AbstractProcessorFactory<CInput, COutputEntry> {
public CProcessorFactory(Str... | package com.wonyoung.codejam.qualificationround;
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 RecycledNumbers {
private Integer testCasesT;
private Recy... |
B20023 | B22127 | 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.Iterator;
import java.util.Scanner;
public class A {
public static void main(String[] args) {
new A().run();
}
private void run() {
Scanner s;
try {
s = new Scanner(new File("A.in"));
int t = s.n... |
A22378 | A20745 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package googlecodejam2012;
import java.io.*;
/**
*
* @author Stephen
*/
public class GoogleCodeJam2012Num2 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) ... |
A22378 | A22513 | 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.File;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.Scanner;
public class DancingWithTheGooglers {
public static void main(String[] args) {
try {
System.setOut(new PrintStream(new FileOutputStream("output.txt")));
Scanner scanner = new Scanner(new File(args[0]));... |
B20424 | B20855 | 0 | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
// static int MAX = 10000;
static int MAX = 2000000;
static Object[] All = new Object[MAX+1];
static int size( int x ) {
if(x>999999) return 7;
if(x>99999) return 6;
if(x>9999) return 5;
if(x>999) retu... | import java.util.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... |
B11696 | B10756 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recycled;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util... | import java.io.*;
import java.util.*;
/**
* @author Ivan Romanov
*/
public class C {
private String solve() throws IOException {
int a = nextInt();
int b = nextInt();
int ans = 0;
for (int i = a; i < b; i++) {
if (recycle.containsKey(i)) {
for (int j :... |
A20261 | A20016 | 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.util.*;
import java.io.*;
public class B {
public static void main (String[] args)throws Exception
{
String inputfilename = args[0];
String outputfilename = args[1];
BufferedReader br = new BufferedReader(new FileReader(inputfilename));
BufferedWriter bw = new BufferedWriter(new FileWrit... |
A21010 | A21299 | 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.*;
public class GCJ2012QualB{
public static void main(String args[]){
Scanner s = new Scanner(System.in);
int t = s.nextInt();
for(int mon=1;mon<=t; mon++){
int nplayer=s.nextInt();
int nsuprise=s.nextInt();
int nscore=s.nextInt();
int ans=0;
... |
A21010 | A20202 | 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.*;
public class gcj2 {
static int T; // tesztesetek száma
static int N[]; // Googlerek számai
static int S[]; // meglepŠtripletek száma
static int p[]; // pék
static int total[][]; // összpontszámok
static int tripletek[][];
static void beolvas (String f) throws IOException {
Buffer... |
B10231 | B12674 | 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.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.util.Arrays;
import java.util.Scanner;
public class RecycledNumbersSmall {
public static void main(String[] args) {
File file = new File("/Users/NoK/Desktop/C-small-attempt0.in");
int... |
A20261 | A22628 | 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 quialification;
import base.Base;
import java.io.PrintStream;
import java.util.Scanner;
/**
* Created with IntelliJ IDEA.
* User: babulya
* Date: 14.04.12
* Time: 19:10
* To change this template use File | Settings | File Templates.
*/
public class B extends Base {
private static int maxNoSurprisi... |
B12762 | B12381 | 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.util.*;
public class RecycledNums
{
static Scanner cin = new Scanner(System.in);
public static void main(String[] args)
{
String out = "";
System.out.println("GO");
int repeat = cin.nextInt();
cin.nextLine();
int ans=0;
for(int i = 0; i < repe... |
B20856 | B22102 | 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;
//... | public class Recycle extends CodeJam{
public Recycle() {
super("C-large");
}
public static void main(String[] args) {
//long t = System.currentTimeMillis();
new Recycle().run();
//System.out.println(System.currentTimeMillis() - t);
}
private int[][] nm = new in... |
A11201 | A10402 | 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.File;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.Scanner;
public class B {
public static void main(String ... args) throws Exception{
Scanner in = new Scanner(new File("B-small-attempt0.in"));
PrintStream out = new PrintStream(new File("B-small-attempt0.out"));
... |
B12115 | B11649 | 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();
... | package com.codejam.two12.RecyledNumbers;
import java.util.HashSet;
import com.jp.common.Puzzle;
public class RecycledNumbers implements Puzzle {
private HashSet<Integer> checkedElementSet = new HashSet<Integer>();
private HashSet<Pair> ListOfPairs = new HashSet<Pair>();
private int startNumber;
private int... |
A10793 | A12609 | 0 | import java.io.*;
import java.math.*;
import java.util.*;
import java.text.*;
public class b {
public static void main(String[] args) {
Scanner sc = new Scanner(new BufferedInputStream(System.in));
int T = sc.nextInt();
for (int casenumber = 1; casenumber <= T; ++casenumber) {
... | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
class dance {
int single[][] = new int[4][3];
int doublex[][] = new int[54][3];
dance() {
single[0][0] = 0;
single[0][1] = 0;
single[0][2] = 0;
... |
B12082 | B11437 | 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 codejam;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.Scanner;
interface ISolver {
public String evaluate();
}
public abstract class Solver implements ISolver {
protected Scanner in;
public void solve() {
in = new Scanner(System.in);
_solve(... |
B12570 | B13093 | 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.FileInputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.HashMap;
public class Recycled {
public static void main(String args[]) {
try {
BufferedReader br=new BufferedReader(new InputStreamReader(new FileInputStream("c:\\gcj\... |
B20566 | B21760 | 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.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class mainclass {
public static void main(String args[]) throws IOException {
int cases;
int a;
int b;
int flag;
int counter;
int[] data;
int temp = 0;
... |
B21049 | B20873 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recycle;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Array... |
A21396 | A20392 | 0 | import java.util.*;
public class Test {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int i = 1; i<=T; i++) {
int n = in.nextInt();
int s = in.nextInt();
int p = in.nextInt();
int result = 0;
for(int j = 0; j<n; j++){
... | import java.util.Scanner;
public class Solution {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int T = in.nextInt();
in.nextLine();
int N, S, p, sure, av, note, result;
for(int zz = 1; zz <= T;zz++){
result=0;
N = in.nextInt();
S = in.nextInt();
p = in.nextInt... |
B12085 | B10143 | 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.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Problem3 {
public static void main(String[] args) throws FileNotFoundException {
String inputFile... |
B12941 | B13046 | 0 | package com.menzus.gcj._2012.qualification.c;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class CProcessorFactory extends AbstractProcessorFactory<CInput, COutputEntry> {
public CProcessorFactory(Str... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
publi... |
B10155 | B11960 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
/**
*
* @author eblanco
*/
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
impo... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class RecycledNumbers {
private static int noOfDigits(int n){
if (n < 10) return 1;
return 1 + noOfDigits(n/10);
}
private static int raisedTo(int n, int m){
if (n==0) return 0;
else if (m==0) return 1;
... |
B10361 | B10977 | 0 | package codejam;
import java.util.*;
import java.io.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("in.txt"));
PrintWriter out = new PrintWriter(new File("out.txt"));
int T = Integer.parseInt(in.readLine());... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Recycled {
/**
* @param args
* @throws IOException
* @throws NumberFormatException
*/
public static void main(String[] args) throws NumberFormatException,
IOException {
/... |
B12074 | B11345 | 0 | package jp.funnything.competition.util;
import java.math.BigInteger;
/**
* Utility for BigInteger
*/
public class BI {
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger add( final BigInteger x , final BigInteger y ) {
return... | package qualification;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class c {
public static void main(String[] args){
if(args.length<1){
System.out.println("Usage: <fnIn>");
}
String fn = args[0];
St... |
A22078 | A22184 | 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 com.google.codejam;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class DancingGooglers {
public static void main(String[] args) throws FileNotFoundException {
new DancingGooglers().run();
}
private stati... |
A20934 | A22110 | 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.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
public class Dancing_with_the_Googlers {
public static void main(String[] args) throws IOException
{
FileInputStream fis;
try {
fis = ... |
B21049 | B22206 | 0 | package it.simone.google.code.jam2012;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumber implements GoogleCodeExercise {
int a = 0;
int b = 0;
Set<Couple> distinctCouple = null;
long maxTime = 0;
private class Couple {
int x = 0;
int y = 0;
public Couple(int x, int y) {
this... | import java.io.*;
import java.util.*;
import java.util.ArrayList;
public class CodeJamProblem implements Runnable {
//Problem C
public boolean InRisultati(ArrayList<String> array, String controllo) {
for(int i =0; i<array.size();i++) {
if(array.get(i)==controllo) {
System.out.println("Risutlato gia conta... |
B20734 | B20311 | 0 | package fixjava;
public class StringUtils {
/** Repeat the given string the requested number of times. */
public static String repeat(String str, int numTimes) {
StringBuilder buf = new StringBuilder(Math.max(0, str.length() * numTimes));
for (int i = 0; i < numTimes; i++)
buf.append(str);
return buf.toStr... | package codejam;
import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Set;
public class C {
public static void main(String[] args) throws Exception {
BufferedReader in = new BufferedReader(new File... |
B21752 | B20583 | 0 | package Main;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
/**
* Created with IntelliJ IDEA.
* User: arran
* Date: 14/04/12
* Time: 3:12 PM
* To change ... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashS... |
B22190 | B21937 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
public class Recycled {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.par... | import java.io.File;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
public class C {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
Scanner in = new Scanner(new File("d:\\cc.large.in"));// new Scanner(ne... |
A10793 | A12305 | 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) {
... | 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-small-attempt0.in");
int ca... |
A20382 | A20392 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... | import java.util.Scanner;
public class Solution {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int T = in.nextInt();
in.nextLine();
int N, S, p, sure, av, note, result;
for(int zz = 1; zz <= T;zz++){
result=0;
N = in.nextInt();
S = in.nextInt();
p = in.nextInt... |
A22378 | A22838 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class CodeJam {
// public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt";
public static final String INP... | package com.unitedcoders.examples.codejam;
import java.io.File;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class DancingWithGooglers {
public static void main(String[] args) throws Exception {
Scanner scanner = new Scanner(new F... |
A12570 | A12817 | 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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* Google code jam.
* Qualification Round 2012.
* Problem B. Dancing With the Googlers
*
* Usage: <app> <input >output
*
* @author sombrabr@gmail.com
*
*/
public class QualB {
public static void main... |
A11277 | A11063 | 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.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class triplets {
public static void main(String[] args) throws IOException {
BufferedReader reader=new BufferedReader(new InputStreamReader(System.in)); //copy test data into... |
B21968 | B20609 | 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 recycled;
import java.io.*;
public class Recycled {
private int N;
private String[] InputStringArray;
private String[] OutputStringArray;
public static void main(String[] args) {
try{
Recycled R = new Recycled();
if (R.GetDataFromInputFile())
if (R.ProcestestData())
R.WriteDatatoOutputF... |
A21396 | A22493 | 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 qualifications2012;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.util.Scanner;
public class GoogleDancers {
public static void main(String[] args) throws FileNotFoundException {
Scanner in = new Scanner(new File("input.txt... |
A20490 | A20406 | 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... | package MyAllgoritmicLib;
public class CodeGray {
public static int grayEncode (int n) {
return n ^ (n >> 1);
}
public static int grayDecode (int g) {
int n = 0;
for (; g > 0; g>>=1)
n ^= g;
return n;
}
}
|
B21790 | B21398 | 0 | import java.io.*;
import java.util.*;
public class C {
void solve() throws IOException {
in("C-large.in"); out("C-large.out");
long tm = System.currentTimeMillis();
boolean[] mask = new boolean[2000000];
int[] r = new int[10];
int t = readInt();
for (int cs = 1; cs... |
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class RecycledNumbers {
private Scanner in;
private PrintWriter out;
public long output;
public int A;
publ... |
B10231 | B11143 | 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.*;
import java.util.*;
public class RecycledNumbers {
private ArrayList<Integer> input = new ArrayList<Integer>();
public static void main(String argz[]) throws IOException{
RecycledNumbers r = new RecycledNumbers();
r.readInput();
r.generateAndCheck();
}
... |
B11318 | B10550 | 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.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Hashtable;
import java.util.Scanner;
import com.sun.org.apache.xpath.internal.operations.Bool;
public class ProbC {
static Hashtable<Integer, Hashtable<Integer, Boolean>> vis;
public static voi... |
A10793 | A11452 | 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) {
... | package de.hg.codejam.tasks.io;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
public abstract class Writer {
public static String generateOutputPath(String inputPath) {
return inputPath.substring(0, inputPath.lastIndexOf('.') + 1) + "out";
}
public static void print(Stri... |
A20382 | A22493 | 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 qualifications2012;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.util.Scanner;
public class GoogleDancers {
public static void main(String[] args) throws FileNotFoundException {
Scanner in = new Scanner(new File("input.txt... |
A22378 | A21418 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class CodeJam {
// public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt";
public static final String INP... | package Qualification;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class DancingWithGooglers {
public static void main(String[] args) throws NumberFormatException,
IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
int... |
B21207 | B21718 | 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.File;
import java.io.PrintWriter;
import java.util.Scanner;
public class EasyNumbers {
public static void main(String[] args) throws Exception{
PrintWriter out =new PrintWriter(new File("../easyNumbers/src/numberrr.out"));
Scanner s =new Scanner(new File("../easyNumbers/src/number.in"));
int ans... |
B20734 | B21762 | 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.util.HashSet;
import java.util.Scanner;
public class qualifier3 {
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int numcases = sc.nextInt();
sc.nextLine();
for(int curcase = 1;curcase <=numcases;curcase++)
{
int min = sc.nextInt();
int max = sc.nextInt();
int ... |
B12762 | B12205 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.File;
import java.io.FileInputStream;
import java.util.Scanner;
/**
*
* @author imgps
*/
public class C {
public static void main(String args[]) throws Exception{
int A,B;
int ctr ... | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.HashSet;
import java.util.... |
A11917 | A13175 | 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.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class DancingWithGooglers {
/**
* @param args
*/
private final static String WRITE_DEST = "... |
A20382 | A22547 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... | import java.util.Scanner;
public class Surp {
/**
* @param args
*/
public static void main(String[] args) {
int T,S,p,N=0;
String L="";
Scanner b = new Scanner(System.in);
T=b.nextInt();
L=b.nextLine();
for(int i=0;i<T;i++){
L=b.nextLine();
String F[]=L.split(" ");
N=0;
S=Integer.parse... |
B21968 | B22026 | 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 main;
import java.util.Vector;
import java.io.*;
public class RecycledNumbers {
static int numberOfElementForEachTest = 2;
static int numberOfLinesPerTest = 0;
public static void main(String[] args) {
Vector<Integer> elements = new Vector<Integer>();
numberOfElementForEachTest = 0;
Reader.setF... |
B21968 | B21361 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
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) {... |
A22642 | A21730 | 0 | import java.util.*;
import java.io.*;
public class DancingWithTheGooglers
{
public DancingWithTheGooglers()
{
Scanner inFile = null;
try
{
inFile = new Scanner(new File("inputB.txt"));
}
catch(Exception e)
{
System.out.println("Problem ope... | import java.util.ArrayList;
import java.util.Scanner;
public class GooglerDancing {
/**
* @param args
*/
public static void main(String[] args) {
new GooglerDancing().run();
}
public void run(){
int numDancers, targetScore, numSurprising, score, numWins;
ArrayList<Dancer> dancers;
Scanner input ... |
A12544 | A12448 | 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 GoogleCodeJam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import... |
B10231 | B11649 | 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... | package com.codejam.two12.RecyledNumbers;
import java.util.HashSet;
import com.jp.common.Puzzle;
public class RecycledNumbers implements Puzzle {
private HashSet<Integer> checkedElementSet = new HashSet<Integer>();
private HashSet<Pair> ListOfPairs = new HashSet<Pair>();
private int startNumber;
private int... |
A20119 | A22666 | 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.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 EN2012QB {
public static void main(String[] args) {
File inputFile = new File("c:/tmp/B-large.in");
... |
A12544 | A10527 | 0 | package problem1;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Arrays;
public class Problem1 {
public static void main(String[] args) throws FileNotFoundException, IOException{
try {
TextIO... |
import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.OutputStream;
import java.io.PrintStream;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author bgamlath
*/
public class Main {
/**
* @pa... |
A22642 | A22385 | 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.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.Scanner;
public class MaxBestResult {
public static void main(String[] args) throws FileNotFoundException {
File input = new File("B-large.in");
Scanner data = new Scanner(input);
PrintStream output = new P... |
A22078 | A20576 | 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 CaseSolvers;
import java.util.ArrayList;
import Controller.IO;
public class AllYourBaseCase extends CaseSolver {
private String originalLine;
private StringBuilder currentLine;
private long numOfSeconds;
public AllYourBaseCase(int order, int numberOfLines, IO io) {
super(order, numberOfLines, io);
}... |
A11201 | A12913 | 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 com.menzus.gcj._2012.qualification.b;
import java.util.Iterator;
import com.menzus.gcj.common.InputBlockParser;
public class BInputBlockParser implements InputBlockParser<BInput> {
@Override
public BInput parseLineIterator(Iterator<String> lineIterator) {
String[] inputLineParts = lineIterator.next(... |
A22191 | A21407 | 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.awt.List;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
public class Dancing {
/**
* @par... |
B12941 | B11780 | 0 | package com.menzus.gcj._2012.qualification.c;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class CProcessorFactory extends AbstractProcessorFactory<CInput, COutputEntry> {
public CProcessorFactory(Str... | import java.util.*;
import java.io.*;
public class googleC {
public static void main(String[] args) throws IOException
{
Scanner scan = new Scanner(new File("inputC.txt"));
FileWriter stream = new FileWriter("outputC.txt");
BufferedWriter out = new BufferedWriter(stream);
int cases = scan.... |
A20261 | A20139 | 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.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.Scanner;
public class Problem2 {
public static void main(String[] args) throws FileNotFoundException {
String inputFile = "B-large.in";
Scan... |
B11696 | B12769 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recycled;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
public abstract class FileWrapper {
protected static final String CASE = "Case #";
protected static final String OUTPUT = "result.out";
protected int caseNum = 0;
protected String output[] = null;
... |
A12460 | A10901 | 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.Scanner;
public class Main2 {
public static void main(String argsp[]) throws FileNotFoundException{
Scanner in = new Scanner(new FileReader("input.in"));
PrintWriter out = new PrintWriter("output.txt");
int T = 0;
String S1 = in.nextLine() ;
T = Integer.parseInt(S1);
... |
A22191 | A20323 | 0 | package com.example;
import java.io.IOException;
import java.util.List;
public class ProblemB {
enum Result {
INSUFFICIENT,
SUFFICIENT,
SUFFICIENT_WHEN_SURPRISING
}
public static void main(String[] a) throws IOException {
List<String> lines = FileUtil.getLines("/B-large.in");
int cases = Int... | import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
public class problemB {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated method s... |
B12074 | B10820 | 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.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 + "";
... |
A22992 | A21524 | 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.FileReader;
import java.io.IOException;
import java.util.*;
public class Dancers {
/**
* @param args
*/
private static Hashtable<Integer, int[]> ns = new Hashtable<Integer, int[]>();
private static Hashtable<Integer, int[]> s = new Hashtable<Integer, int[]>();
p... |
B20291 | B21891 | 0 | import java.io.*;
import java.util.*;
class B
{
public static void main(String[] args)
{
try
{
BufferedReader br = new BufferedReader(new FileReader("B.in"));
PrintWriter pw = new PrintWriter(new FileWriter("B.out"));
int X = Integer.parseInt(br.readLine());
for(int i=0; i<X; i++)
{
String[]... | import java.util.Scanner;
public class C_RecycledNumbers {
static int[] bases = {0, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000};
static int digits(int value) {
int i = 0;
for (; i < bases.length && value >= bases[i]; i++);
return i;
}
static int shift(int value, int len) {
i... |
A12211 | A10765 | 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.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Reader;
public class Processor {
public void process(TestCaseFactory factory, String filenameIn,
String filenameOut) throws IOException, MalformedInputFileExceptio... |
A20119 | A21610 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | import java.util.Scanner;
public class QuestionB extends Question{
private int N;
private int S;
private int p;
private int[] dancers;
public QuestionB(Result result, Counter counter)
{
super(result, counter);
}
@Override
public void readInput(Scanner scanner) {
N = scanner.nextInt();
S = scanner.n... |
A20490 | A20113 | 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... | package source;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class DancingGooglers {
/**
* @param args
*/
public static void main(String[] args) throws IOException{
S... |
B10485 | B11243 | 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... | /*
* 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;
//... |
B10702 | B10211 | 0 | import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Recycle {
private static HashMap<Integer, HashSet<Integer>> map = new HashMap<Integer, HashSet<Integer>>();
private static HashSet<Integer> toSkip = new HashSet<Integer>();
/**
* @param args
*/
public static void main(S... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.Arrays;
public class RecyclingNumbers {
private boolean[] m_numArray;
private int[] chooseArray = {0, 0, 1, 3, 6, 10, 15, 21, 28};
private int m_low;
private int m_high;
Recyclin... |
B21270 | B20280 | 0 | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
public class CopyOfCopyOfMain {
static int ndigits(int n) {
return (int) (Math.log10(n) + 1);
}
static i... | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.HashSet;
public class RecycledPairs {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
HashSet<Integer> seen = new HashSet<In... |
B10149 | B12033 | 0 | import java.io.FileInputStream;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeSet;
// Recycled Numbers
// https://code.google.com/codejam/contest/1460488/dashboard#s=p2
public class C {
private static String process(Scanner in) {
int A = in.nextInt();
int B = in.nextInt();
int res =... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
public class RecycledNumber {
public static void main(String[] args) throws IOException {
BufferedReader br = new Bu... |
B20566 | B21071 | 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 template;
import java.io.*;
import java.util.ArrayList;
import java.util.Random;
public class Utils {
static String logfile = "";
public static BufferedWriter newBufferedWriter(String filename, boolean append) {
BufferedWriter bw = null;
try {
bw = new BufferedWriter(new ... |
B11318 | B11912 | 0 | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
int casos=1, a, b, n, m, cont;
while(t!=0){
a=sc.nextInt();
b=sc.nextInt();
if(a>b){
int aux=a;
a=b;
b=aux;
}
System.out.printf("Case #%d: ",casos... | import java.io.*;
import java.util.*;
public class Main{
public static void main (String[] args) throws java.lang.Exception{
Scanner in = new Scanner(System.in);
int T=in.nextInt();
int res[]=new int[T];
for(int t=0;t<T;t++){
int A=in.nextInt();
int B=in.nextInt();
... |
B11696 | B10766 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recycled;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package RecycledNumbers;
import java.io.File;
import java.io.FileWriter;
import java.io.Writer;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
/**
*
* @author Rishabh
*/
public class R... |
A22191 | A20440 | 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.Scanner;
public class SolutionDancingWithGooglers {
static int[] notes;
static int surprising;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int cases = sc.nextInt();
for(int i = 0; i < cases; i++){
int googlers = sc.nextInt();
surpri... |
B11318 | B12572 | 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 c;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.HashSet;
public class RecycledNumbers {
public static int getDistinctRecycleCount(int min, int max) {
HashSet<String> distinctCollection = new HashSet<String>();
for(int i = min; i <= max; i++) {
... |
A12544 | A12933 | 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 Dancing;
/**
* Created with IntelliJ IDEA.
* User: kevin
* Date: 4/13/12
* Time: 8:00 PM
* To change this template use File | Settings | File Templates.
*/
public class DanceSet {
public DanceSet(int dancers, int suprises, int minscore,int[] scores){
this.dancers=dancers;
this.sunrise... |
B10702 | B11621 | 0 | import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Recycle {
private static HashMap<Integer, HashSet<Integer>> map = new HashMap<Integer, HashSet<Integer>>();
private static HashSet<Integer> toSkip = new HashSet<Integer>();
/**
* @param args
*/
public static void main(S... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
public class RecycledNumbers {
private static boolean isRecycled(long f,long s){
String str1 = String.valueOf(f);
String str2 = String.valueOf(s);
if(str1.length()!=str2.length()){
return f... |
A21010 | A20122 | 0 | package codejam;
import fixjava.Pair;
public class Utils {
public static long minLong(long firstVal, long... otherVals) {
long minVal = firstVal;
for (int i = 0; i < otherVals.length; i++)
minVal = Math.min(firstVal, otherVals[i]);
return minVal;
}
public static int minInt(int firstVal, int... otherVals... | import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Comparator;
import java.util.StringTokenizer;
public class B implements Runnable {
private static final String PROBLEM_ID = "B";
private class TestCaseRunner {
class Triple {
... |
A12544 | A12133 | 0 | package problem1;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Arrays;
public class Problem1 {
public static void main(String[] args) throws FileNotFoundException, IOException{
try {
TextIO... | import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.StringTokenizer;
public class Recycle {
public Recycle()
{
readFile("Files/recycle.in");
}
public void readFile(String file)
{
try{
F... |
B11327 | B11730 | 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]);
}
}
}
| /*
* SpeakingApp.java
*/
package speaking;
import org.jdesktop.application.Application;
import org.jdesktop.application.SingleFrameApplication;
/**
* The main class of the application.
*/
public class SpeakingApp extends SingleFrameApplication {
/**
* At startup create and show the main frame of the ap... |
A12846 | A12459 | 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 qualifier;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Map;
import java.util.Scanner;
public class TB {
private Map<Character, Character> translate = null;
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
PrintWr... |
A11135 | A10918 | 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.IOException;
import java.util.InputMismatchException;
import java.io.OutputStream;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.io.FileInputStream;
import java.io.Writer;
import java.math.BigInteger;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual sol... |
A12113 | A11381 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.Writer;
import java.util.Scanner;
public class IOHelper{
Scanner sc=null;
Writer output=null;
public IOHelper(String input,String ouptPut){
try{
sc=new Scanner(new File(input));
output=new BufferedWriter(new Fil... |
B10231 | B10770 | 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... | package numbers;
import java.util.*;
import java.io.*;
public class Numbers {
public static void main(String[] args) throws Exception {
Scanner br = new Scanner(new FileReader("C-small-attempt0.in"));
BufferedWriter bw = new BufferedWriter(new FileWriter("out.txt"));
int T = br.nextI... |
B12082 | B11836 | 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... | /*
Sam1rm
Google Code Jam
*/
import java.io.*;
import java.util.*;
class ProblemC
{
public static void main (String [] args) throws IOException
{
String filename = args[0];
BufferedReader f = new BufferedReader(new FileReader(filename + ".in"));
PrintWriter out = new PrintWriter(new BufferedWriter(new Fi... |
B12085 | B12600 | 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.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
public class RecycledNumbers {
public static void main(String[] args) {
try {
File dataFile = new File(ar... |
A20119 | A21428 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | package qualification;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
public class ProblemB {
public static int solve(String in){
int n;
int s;
int p;
int need = 0;
int count = 0;
String[] segs = in.split("\\s+");
n = Integer.par... |
A20261 | A20845 | 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.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T=in.nextInt();
for(int t=1; t<=T; t++) {
int max=0;
int N = in.nextInt(), S = in.nextInt();
int p = in.nextInt();
int sMin = (p==0)?0:(3*p-2);
int strictMin... |
B12669 | B10074 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package year_2012.qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.... | import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* Created by IntelliJ IDEA.
* User: Jack Man
* Date: Apr 13, 2012
* Time: 9:12:01 PM
* To change this template use File | Settings | File Templates.
*/
public class RecycledN... |
B12570 | B10442 | 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 codejam;
import java.util.*;
public class RecycledNumbers {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for (int k = 1; k <= T; k++) {
int c = 0;
int A = in.nextInt();
int B = in.nextInt();
for (int cand = A; cand <... |
A11917 | A12841 | 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.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Wilmer
*/
public class main {
int numeroCasos;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.