F1
stringlengths
6
6
F2
stringlengths
6
6
label
stringclasses
2 values
text_1
stringlengths
149
20.2k
text_2
stringlengths
48
42.7k
A11502
A11911
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...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package dancinggooglers; import java.io.*; /** * * @author Ruben */ public class DancingGooglers { /** * @param args the command line arguments */ public static void main(String[] args) { ...
B20734
B20094
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 Main { public static void main(String[] args){ int t; Scanner s = new Scanner(System.in); t=s.nextInt(); for(int k=1;k<=t;k++){ int a,b; a=s.nextInt(); b=s.nextInt(); int al=a/10,d=1; while(al>0){ d++; al/=10; } int ...
A10568
A12461
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.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.PrintStream; import java.util.HashMap; import java.util.Scanner; public class P2 { static Scanner sc; /** * @param args */ public static void main(String[] args) { // TODO Auto-generated meth...
B20291
B20185
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 com.codejam.practice; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.util.HashSet; import java.util.Set; import java.util.StringTokenizer; public class Recycled { public static void main(String[] args) { /...
B12085
B13005
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...
/* * recycle nums */ package google.code.jam; import java.io.File; import java.io.PrintWriter; import java.util.Scanner; /** * * @author Jake */ public class GoogleCodeJam { private static int Min; private static int Max; private static PrintWriter out= null; private static File input; pri...
B10149
B13152
0
import java.io.FileInputStream; import java.util.HashMap; import java.util.Scanner; import java.util.TreeSet; // Recycled Numbers // https://code.google.com/codejam/contest/1460488/dashboard#s=p2 public class C { private static String process(Scanner in) { int A = in.nextInt(); int B = in.nextInt(); int res =...
import java.io.*; import java.math.BigInteger; import java.util.*; public class GC { String s = null; String[] sp = null; public void run() throws Exception{ BufferedReader br = new BufferedReader(new FileReader("C-small-attempt0.in")); BufferedWriter bw = new BufferedWriter(new FileWriter("OUTPUT....
A22771
A21347
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.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintWriter; import java.util.Arrays; import java.util.Scanner; /** * * @author Chadi */ class TestCase { int googlers; int surprises; int minScore; int[] scores; public TestC...
A11277
A10855
0
package googlers; import java.util.Scanner; import java.util.PriorityQueue; import java.util.Comparator; public class Googlers { public static void main(String[] args) { int n,s,p,count=0,t; Scanner sin=new Scanner(System.in); t=Integer.parseInt(sin.nextLine()); int result[]=new int[t]; int ...
package Aufgabe2; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.util.Scanner; public class Main { private Scanner scanner; private PrintWriter writer; public M...
A12113
A12687
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 qualifying; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileReader; import java.io.FileWriter; public class B { public static String solve(int N, int S, int p, int[] t) { int cnt = 0; for(int i=0; i<t.length; i++) { if(t[i]>=2*Math.max(p-1,0)+p) cnt++; if(t[i...
A20119
A22903
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 Q2; public class DancingSolver extends Solver { public static void main(String[] args) throws Exception{ Main m; m = new Main("B-small-attempt0"); // m = new Main("test"); m.run(new DancingSolver(), false); } @Override public String solve() throws Exception { Integer[] spl = splitLine(readLin...
A20490
A23035
0
/** * */ package hu.herba.codejam; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io...
import java.util.Scanner; public class DancingGooglers { public static void main( String args[] ) { new DancingGooglers(); } public DancingGooglers() { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); for( int j=0; j<T; j++ ) { System.out.println( "Case #"+ (j+1) + ": " + doCase(sc) ); }...
B11318
B11077
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 fixjava; import java.util.Collection; import java.util.Comparator; /** * Typed 3-tuple */ public class Tuple4<A, B, C, D> { private final A field0; private final B field1; private final C field2; private final D field3; public A getField0() { return field0; } public B getField1() { return fiel...
B12669
B10156
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.util.*; public class C { public static String shift(String a, int d) { String end = a.substring(d, a.length()); String start = a.substring(0, d); return end + start; } public static void main(String[] args) { Scanner s = new Scanner(System.in); int t = s.nextInt(); ...
B11696
B10087
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.*; import java.math.*; public class C { public static void main(String[] args) throws FileNotFoundException { Scanner input = new Scanner(new File("input.txt")); PrintWriter output = new PrintWriter("output.txt"); int T = input.nextInt(); for (int z = 1; z <= T; z++) { //...
B20856
B20419
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; //...
/* * 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.Collection; import java.util.HashMap; imp...
B10245
B13201
0
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package recyclednumbers; import java.util.HashSet; /** * * @author vandit */ public class RecycleNumbers { private HashSet<String> numbers = new HashSet<String>(); private HashSet<String> initialTempNumbers...
package tr0llhoehle.cakemix.utility.googleCodeJam; /** * Describes all Types currently supported. * * @author Cakemix * */ public enum SupportedTypes { INT, DOUBLE, BOOLEAN, STRING, LIST_INT, LIST_DOUBLE, LIST_BOOLEAN, LIST_STRING }
B10858
B11188
0
package be.mokarea.gcj.common; public abstract class TestCaseReader<T extends TestCase> { public abstract T nextCase() throws Exception; public abstract int getMaxCaseNumber(); }
import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class Recycling { public static void main(String[] args) throws FileNotFoundException { File file = new File("C-small-attempt0.in"); Scanner in = new Scanner(file); int cases = in.nextInt(); for (int i = 0; i < ...
A12544
A11241
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...
/** * 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 ...
A22191
A20587
0
package com.example; import java.io.IOException; import java.util.List; public class ProblemB { enum Result { INSUFFICIENT, SUFFICIENT, SUFFICIENT_WHEN_SURPRISING } public static void main(String[] a) throws IOException { List<String> lines = FileUtil.getLines("/B-large.in"); int cases = Int...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class ProblemB { public static int solve(String line) { String[] s = line.split(" "); int len = Integer.valueOf(s[0]); int S = Integer.valueOf(s[1]); int th = Integer.valueOf(s[2]); int[] a = new int[len]; ...
A22378
A21933
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 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...
A20730
A20295
0
import java.util.Scanner; public class B { public static void main(String[] args) { Scanner in = new Scanner(System.in); int T = in.nextInt(); for(int zz = 1; zz <= T;zz++){ int N = in.nextInt(); int S = in.nextInt(); int p = in.nextInt(); int x = 0; for(int i = 0; i < N;i++){ int score = in.n...
package sebastianco; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; import java.io.FileWriter; public class DancingWithGooglers { public static void main(String[] args) throws Exception { BufferedReader reader = null; BufferedWriter writer = null;...
A12846
A12485
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 inam.qual; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Scanner; public class B { public void go() { Scanner in = new Scanner(System.in); int cc = in.nextInt(); for (int c = 1; c <= cc; c++) { int val = 0; ...
B20291
B20085
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.*; public class Recycle { private static Scanner s = new Scanner(System.in); public static void main(String[] args) { int T = s.nextInt(); List<Integer> ms = new LinkedList<Integer>(); for (int t = 0; t < T; t++) { int A = s.nextInt(); int B = s.nextInt(); int digits = String.valu...
B11318
B10227
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 qualification; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; import java.awt.EventQueue; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.BufferedReader; import java....
B21752
B21535
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.*; import java.util.Scanner; public class functions { int solve(String A, String B){ int result = 0; int n = A.length(); int a = Integer.parseInt(A); int b = Integer.parseInt(B); int i = 0, j = 0, k = 0, index = 0; String temp_a = A; String temp2 = ""; int[] array = new int[8]; for...
B21968
B21877
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. */ package gcj12_qc; import java.io.FileOutputStream; import java.util.HashSet; import java.util.Scanner; /** * * @author youssefgamil */ public class Gcj12_qC { /** * @param args the command line arguments ...
A21396
A20339
0
import java.util.*; public class Test { public static void main(String[] args){ Scanner in = new Scanner(System.in); int T = in.nextInt(); for(int i = 1; i<=T; i++) { int n = in.nextInt(); int s = in.nextInt(); int p = in.nextInt(); int result = 0; for(int j = 0; j<n; j++){ ...
import java.io.*; import java.util.Scanner; public class B { static final String IN_FILE = "B-large.in.in"; public static void main(String[] args) throws Exception { BufferedReader in = new BufferedReader(new FileReader(IN_FILE)); Writer out = new BufferedWriter(new FileWriter(IN_FILE+".out...
A20382
A21577
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...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.common; import java.io.IOException; /** * * @author jim */ public class AbstractMain { public static void main(String[] args, AbstractProcessor p) { FileLoader fileLoa...
B20424
B22137
0
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { // static int MAX = 10000; static int MAX = 2000000; static Object[] All = new Object[MAX+1]; static int size( int x ) { if(x>999999) return 7; if(x>99999) return 6; if(x>9999) return 5; if(x>999) retu...
import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigInteger; import java.util.Arrays; import java.util.HashSet; ...
B21049
B22195
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 org.weiwei.recyclenumber; import java.util.Date; import java.util.HashSet; import java.util.Set; /** * Created with IntelliJ IDEA. * User: ding * Date: 12-4-14 * Time: 下午1:03 * To change this template use File | Settings | File Templates. */ public class RecyleBin { int lower; int higher; ...
B12074
B11925
0
package jp.funnything.competition.util; import java.math.BigInteger; /** * Utility for BigInteger */ public class BI { public static BigInteger ZERO = BigInteger.ZERO; public static BigInteger ONE = BigInteger.ONE; public static BigInteger add( final BigInteger x , final BigInteger y ) { return...
import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.PrintWriter; import java.util.Scanner; public class Recycled implements Runnable { static final int MAX = 2000000; public void run(){ try { Scanner in = new Scanner(new File("C-small-attempt0.in"))...
B21752
B20649
0
package Main; import com.sun.deploy.util.ArrayUtil; import org.apache.commons.lang3.ArrayUtils; import java.io.*; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; /** * Created with IntelliJ IDEA. * User: arran * Date: 14/04/12 * Time: 3:12 PM * To change ...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package pkg2012codejam; import java.io.*; import java.util.ArrayList; /** * * @author Nimos */ public class QuestionC { public static void main(String args[]) { try { File input = new File("...
A12113
A12470
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.*; import javax.swing.*; import java.util.*; import java.awt.event.*; import java.awt.*; import java.math.*; import java.text.*; public class Gjam{ static int _pow(int num, int power) { int product=1; for(int i=0;i<power;i++) product *= num; return product; } public static void main...
A22992
A22314
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 codejam.dancingwiththegooglers; public class DancingScores { private int[] scoreSums; private int numberSuprisingScores; private int threshold; public DancingScores(String inputLine) { String[] split = inputLine.split(" "); int length = Integer.parseInt(split[0]); scoreSums = new int[length]; num...
B20734
B21621
0
package fixjava; public class StringUtils { /** Repeat the given string the requested number of times. */ public static String repeat(String str, int numTimes) { StringBuilder buf = new StringBuilder(Math.max(0, str.length() * numTimes)); for (int i = 0; i < numTimes; i++) buf.append(str); return buf.toStr...
import java.io.File; import java.io.FileNotFoundException; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Scanner; import java.util.Set; public class RecycledNumbers { public static void main(String[] args) { S...
B10702
B11687
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.File; import java.io.FileReader; import java.io.FileWriter; import java.util.ArrayList; public class C { public static void main(String args[]){ try{ BufferedReader br = new BufferedReader(new FileReader(args[0])); String strTm...
A12544
A13007
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.*; import java.io.*; public class DancingWithTheGooglers{ public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); Formatter formatter = new Formatter(System.out); int T = Integer.parseInt(br.readLine()); ...
A20261
A21605
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.*; class Dancing { public static void main(String[] args) { int[] dancers = new int[100]; int N; int surprising; int target; int i; int result; int optimal; int n; int T; int t; Scanner myInput = new Scanner(System.in); T = myInput.nextInt(); for (t=1; t<=T; t++) { re...
A22078
A22097
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 qualification; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.util.Scanner; public class B { String solve(Scanner in) throws IOException { int N = in.nextInt(), S = in.nextInt(), p = in.nextInt(), count = 0,...
B10485
B12699
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 gcj12; import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class C { void solve() { Scanner scan = new Scanner(System.in); int tCase = scan.nextInt(); for (int i = 1; i <= tCase; i++) { int res = 0; int a = scan.nextInt(); ...
A12846
A12298
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.File; import java.io.FileInputStream; import java.io.FileWriter; import java.io.InputStreamReader; import java.lang.Math; import java.util.Arrays; public class DancingWithTheGooglers { public static int testSi...
B11318
B11705
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.util.*; public class C { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner in = new Scanner(System.in); int T = in.nextInt(); int i,j,len,p,temp,total; HashSet<Integer>[] map = new HashSet[2000000]; for (i=1;i<2000000;i++) { map[i]...
B12570
B12147
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.*; import java.util.*; import java.math.*; public class C { public static void main(String[] args) throws IOException { BufferedInputStream bis = new BufferedInputStream(new FileInputStream("C-small-attempt0.in")); BufferedReader br = new BufferedReader(new InputStreamReader(bis)); PrintWriter ou...
B12074
B12171
0
package jp.funnything.competition.util; import java.math.BigInteger; /** * Utility for BigInteger */ public class BI { public static BigInteger ZERO = BigInteger.ZERO; public static BigInteger ONE = BigInteger.ONE; public static BigInteger add( final BigInteger x , final BigInteger y ) { return...
import java.io.*; import java.util.*; public class Main { static private String formatPair(int toMove, String num1) { String back = num1.substring(num1.length() - toMove); String front = num1.substring(0,num1.length() - toMove); return (back + front); } static private int getDistinctPairs(int v1,int v2) { ...
A12113
A10016
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.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...
B10245
B11078
0
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package recyclednumbers; import java.util.HashSet; /** * * @author vandit */ public class RecycleNumbers { private HashSet<String> numbers = new HashSet<String>(); private HashSet<String> initialTempNumbers...
package fixjava; import java.awt.Adjustable; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.RenderingHints; import java.awt.event.AdjustmentEvent; import java.awt.event.AdjustmentListener; import java.awt.event.ComponentAdapter; ...
A20934
A21538
0
import java.util.*; public class B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); B th = new B(); for (int i = 0; i < T; i++) { int n = sc.nextInt(); int s = sc.nextInt(); int p = sc.nextInt()...
package com.cuteants.problems.codejam.y2012.qualification; import java.io.*; import java.util.InputMismatchException; public class DancingWithTheGooglers { public static void main(String[] args) throws Exception { InputReader sc = new StreamInputReader(new FileInputStream("C:\\Users\\aurel\\Downloads\\B-...
A22642
A22850
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.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 QualificationB { public static void main(String[] args) { File file = new File("D:/CodeJam/B-large....
A11135
A12270
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.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.Scanner; public class Solution { static final boolean DBG = false; // x x x s= 3x // x x x+1 s= 3x +1 // x x x-1 s= 3x -1 // x x+1 x+1 s= 3x +2 // x x-1 x-1 s= 3x-2 public static void main(String[] args) { ...
B11421
B10070
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.*; public class CodeJamQual3b { /** * @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"); //Input file name changed to...
A11201
A11703
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....
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package test2; /** * * @author Student */ public class Score { private int i; private int j; private int k; private boolean surp; public Score(int i, int j, int k,boolean surp) { this.i ...
B10155
B13190
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.*; import java.io.*; import java.math.BigDecimal; import java.math.BigInteger; public class Main { private void solve() throws Exception { int test = in.nextInt(); for(int t=1; t <= test; ++t) { solveTest(t); out.println(); } } private void solveTest(in...
B10702
B11165
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.*; import java.lang.*; import java.io.*; class recycle { public static void main(String args[]) { try { PrintWriter pw=new PrintWriter("out.txt"); //creating file reader instance and reading first line BufferedReader br=new BufferedReader(new FileReader(args[0])); String...
B10155
B13062
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 com.google.codejam.recycle; import java.util.List; /** * Created by IntelliJ IDEA. * User: sushant * Date: 14 Apr, 2012 * Time: 11:13:34 AM * To change this template use File | Settings | File Templates. */ public class RecycledNumbers { /** * Main method from where application start execution....
B10702
B13257
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.File; import java.util.HashSet; import java.util.Scanner; public class recyle { public static int solve(String s) { String[] input = s.split(" "); String a = input[0]; String b = input[1]; if (a.length() != b.length()) return 0; if (Integer.parseInt(b) <= 10) return 0; int r...
A11277
A10633
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 ...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package codejam; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.Scanner; /** * * @author sarwar */ public class problemB { static...
A10699
A12531
0
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; public class Dancing { /** * @param args * @throws IOException */ public static void main(String[] args) ...
package jam2; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.DataInputStream; import java.io.FileInputStream; import java.io.FileWriter; import java.io.InputStreamReader; import java.util.ArrayList; public class Test2 { public static void main(String argv[]){ Test2 tb = new Test2(); ...
B11318
B10091
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. */ package Recycle; import java.io.BufferedReader; import java.io.FileReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.HashMap; import java.util.StringTokenizer; /** * * @author hemal */...
A22078
A20203
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 googlecodejam2012_qualification; /** * @author neil */ import java.io.*; import java.util.*; public class NewMain3 { /** * @param args the command line arguments */ public static void main(String[] args) throws IOException { //BufferedReader in = new BufferedReader(new ...
A22992
A20024
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.util.ArrayList; import java.util.HashSet; public class DancingWithTheGooglers { private static String inputFile = "C:\\PERSONAL-WORKSPACE\\GCJ-2012\\src\\input-output\\Input.txt"; private static String outputFile = "C:\\PERSONAL-WORKSPACE\\GCJ-2012\\src\\input-output\\Output.txt"; public static void main(...
A22360
A22945
0
import java.io.BufferedWriter; import java.io.File; import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; import java.io.PrintStream; import java.util.ArrayList; import java.util.Scanner; public class Dancing_With_the_Googlers { /** * The first line of the input gives the ...
package y2012.quals; import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.util.Scanner; public class B { public static void main(String[] args) throws FileNotFoundException { Scanner in = new Scanner(new File("B.in")); PrintWriter out = new PrintWriter(new File("B.ou...
A10568
A11654
0
import java.io.BufferedReader; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.util.StringTokenizer; public class DancingWithTheGooglers { public static void main(String[] args) throws IOException { BufferedReader f = new BufferedReader (new...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package uk.co.epii.codejam.common; import java.util.ArrayList; /** * * @author jim */ public class Input { private final String[] header; private final String[] data; public Input(ArrayList<String>...
A13029
A11489
0
import java.util.List; public class Case implements Runnable { private int id; private String output; private int n; private int s; private int p; private List<Integer> g; public Case(int id) { this.id = id; } public Case(int id, int n, int s, int p, List<Integer> g) { super(); this.id = id; this...
package 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...
A12211
A12742
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.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; public class ProblemB { static Map<Integer, Score[]> scores; public static void main(String[] args){ scores = new HashMap<Integer, Score[]>(); scores.put(0, new S...
B12762
B11539
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 template; import java.io.BufferedReader; import java.io.BufferedWriter; import java.util.ArrayList; public class TestCaseIO { public static ArrayList<TestCase> loadFromFile(String infile) { //inc checks on #lines, length of splits, etc. BufferedReader br = Utils.newBufferedReader(infile);...
B20291
B21718
0
import java.io.*; import java.util.*; class B { public static void main(String[] args) { try { BufferedReader br = new BufferedReader(new FileReader("B.in")); PrintWriter pw = new PrintWriter(new FileWriter("B.out")); int X = Integer.parseInt(br.readLine()); for(int i=0; i<X; i++) { String[]...
import java.io.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...
A10793
A11949
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 codejam2012qual; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; import java.io.PrintStream; import java.io.PrintWriter; import java.util.Arrays; import util.InputReader; public class DancingGooglers implements Runnable { priv...
A11277
A12122
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.DataInputStream; import java.io.FileInputStream; import java.io.FileWriter; import java.io.InputStreamReader; public class Main { /** * @param args */ public static void main(String[] args) { try{ // Open the file that is the ...
B10155
B11702
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.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.List; import java.util.Scanner; public class RecycledNumbers { /** * Input 4 1 9 10 40 100 500 1111 22...
A20934
A20043
0
import java.util.*; public class B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); B th = new B(); for (int i = 0; i < T; i++) { int n = sc.nextInt(); int s = sc.nextInt(); int p = sc.nextInt()...
package Qual2012; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; public class Qual2012B { public static void main(String args[]){ // String filePath = "X:\\GCJ\\2012B-small-attempt0.in"; String filePath = ...
A22771
A20977
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 fixjava; import java.util.ArrayList; import java.util.concurrent.Callable; /** Parallel quicksort (inefficient initially, doubles the number of threads at each pivot) */ public class ParallelQuicksort<T extends Comparable<T>> implements Callable<Void> { private ArrayList<T> list; private ParallelWorkQueueD...
A22378
A20384
0
import java.io.BufferedReader; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; public class CodeJam { // public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt"; public static final String INP...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; public class DancingWithThegooglers { private static Map<Integer, Po...
A22642
A21735
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.IOException; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOException { Scanner scanner = new Scanner(new File("c:\\eclipse\\2\\B-large.in")); int numTc = scanner.nextInt(); for (int index = 0; index < numTc; index++) { int n ...
A12113
A10279
0
import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.util.Arrays; import java.util.Scanner; public class B { static int[][] memo; static int[] nums; static int p; public static void main(String[] args)throws IOException { Scanner br=new Scanner(new File("B-small-attempt0.in"...
import java.io.File; import java.util.Arrays; import java.util.Scanner; public class DancingWiththeGooglers { public static void main(String[] args) throws Exception { File inp = new File("B-small-attempt0.in"); Scanner sc = new Scanner(inp); int T = sc.nextInt(); int result, ...
A20261
A20817
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.*; import java.util.*; class B{} public class DanceG { static Scanner scan; static PrintWriter writer; static HashMap<Integer, List<Integer>> map; public static void readProcessOutput() throws Exception{ String outputStr = ""; String result = ""; int index = 1; int testCases = Inte...
B10702
B10257
0
import java.util.HashMap; import java.util.HashSet; import java.util.Scanner; public class Recycle { private static HashMap<Integer, HashSet<Integer>> map = new HashMap<Integer, HashSet<Integer>>(); private static HashSet<Integer> toSkip = new HashSet<Integer>(); /** * @param args */ public static void main(S...
package com.numbers.recycle.main; import com.numbers.recycle.orchestrator.NumberRecycler; public class NumberRecyclerMain { /** * @param args */ private NumberRecycler reverser = new NumberRecycler(); public static void main(String[] args) { new NumberRecyclerMain().recycle(); } private void recycle(...
A10699
A10564
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.PrintWriter; import java.util.Scanner; public class DancingWithGooglers { public static void main(String[] argv) throws Exception { // Scanner s = new Scanner(System.in); Scanner s = new Scanner(new FileInputStream("DancingWithGoogl...
A22771
A22882
0
package com.menzus.gcj._2012.qualification.b; import com.menzus.gcj.common.InputBlockParser; import com.menzus.gcj.common.OutputProducer; import com.menzus.gcj.common.impl.AbstractProcessorFactory; public class BProcessorFactory extends AbstractProcessorFactory<BInput, BOutputEntry> { public BProcessorFactory(Str...
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.util.StringTokenizer; public class Dancing { private static int[] data; public static void main(String[] args) throws IOException ...
B10858
B11564
0
package be.mokarea.gcj.common; public abstract class TestCaseReader<T extends TestCase> { public abstract T nextCase() throws Exception; public abstract int getMaxCaseNumber(); }
package codejam.is; /** * Created with IntelliJ IDEA. * User: ofer * Date: 4/13/12 * Time: 8:49 PM * To change this template use File | Settings | File Templates. */ public abstract class TestAbstract implements Test { private final static String newline = System.getProperty("line.separator"); @Overrid...
A12273
A10077
0
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * Dancing * Jason Bradley Nel * 16287398 */ import java.io.*; public class Dancing { public static void main(String[] args) { In input = new In("input.txt"); int T = Integer.parseInt(input....
import java.util.Scanner; /** * Abdulaziz * 4/13/12 * Problem * <p/> * You're watching a show where Googlers (employees of Google) dance, and then each dancer is given a triplet of scores by three judges. Each triplet of scores consists of three integer scores from 0 to 10 inclusive. The judges have very similar ...
A11502
A10684
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...
package codejam; import java.io.*; public class DancingWithTheGooglers { private BufferedReader br; private BufferedWriter wr; public DancingWithTheGooglers(String filein,String fileout){ try{ br = new BufferedReader(new InputStreamReader(new FileInputStream...
B21968
B20547
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...
public class Main { public static void main(String[] args) throws java.io.FileNotFoundException,java.io.IOException{ java.io.BufferedReader bRead=new java.io.BufferedReader(new java.io.FileReader("F:\\C-large.in")); java.io.BufferedWriter bWrite=new java.io.BufferedWriter(new java.io.FileWriter("F:\\C-large.out"))...
B20291
B20272
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[]...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package codejam2012; import java.io.BufferedReader; import java.io.DataInputStream; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; impo...
B11318
B11501
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 problem.c; import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class ProblemC { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); OutputBuilder out = new OutputBuilder(); Set<Pair> pairs; int numCases; String A; String B; String[] l...
B13196
B10457
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 Parser; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; public class MyReader { public String[] taskArray; public int currentString; public MyReader(String fileName) { // TODO Auto-ge...
A12113
A10530
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"...
/* 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. Each triplet of scores consists of three integer scores from 0 to 10 inclusive. The judges have very similar standards, so it's surprising if a triplet of scores contains two...
B10702
B12420
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.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.util.HashMap; public class Main { private static String fileDirectory = "files/"; /** * @param args */ public static void main(String[] args) { ...
B20734
B21179
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...
/* * 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...
A11277
A12096
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.*; import java.util.*; public class Pilot { public static void main(String[] args) { Pilot my = new Pilot(); Calendar cal1 = Calendar.getInstance(); my.doAll(); Calendar cal2 = Calendar.getInstance(); // System.out.println("\nseconds : " + (cal2.getTimeInMillis() - // cal1.getTimeInMillis...
B10485
B11916
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.FileInputStream; import java.io.InputStreamReader; import java.util.HashSet; import java.util.Set; public class RecycleNumber { /** * @param args */ public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamRe...
B21968
B20898
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.*; public class C { public static void main(String args[]) { Scanner scan = new Scanner(System.in); int T = scan.nextInt(); for(int ca=1;ca <= T;ca++) { int A = scan.nextInt(); int B = scan.nextInt(); int rtn = 0; String str = "1"; while(str.length() < (A+"").length()) str +...
A21557
A22323
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 org.mlai.google.codejam; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.DataInputStream; import java.io.FileInputStream; import java.io.FileWriter; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; public class DancingWi...
A12846
A12266
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.FileReader; import java.io.FileWriter; import java.util.StringTokenizer; public class GoogleDancers{ public static void main(String[] args) throws Exception{ FileReader fr = new FileReader("C:\\Projects\\Learning\\src\\B-small-attempt1.in"); BufferedReader br = new B...
A12846
A12500
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 qualification.p2; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; import java.io.FileWriter; public class DancingWithTheGooglers { private static void calculate( String testCase, BufferedWriter bw, int n ) throws Exception { String[] tcData = t...
B11318
B12627
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.IOException; import java.util.List; public class StoreCredit extends JamProblem { public static void main(String[] args) throws IOException { StoreCredit problem= new StoreCredit(); problem.go(); } @Override String solveCase(JamCase jamCase) { StoreCreditCase cas...
A21010
A21274
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.*; class Dancer{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int testcase, numdancer, surprise, limit, counter, score; testcase = sc.nextInt(); for(int i=1;i<=testcase;i++){ counter = 0; System.out.print("Case #"+i+": "); numdancer =...
A10793
A11746
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 googlers; /** * * @author amr */ import java.io.*; public class Main { public static void main(String[] args) throws Exception { FileWriter foutstream = new FileWriter("result.out"); FileReader finstream = new FileReader("B-small-attempt5.in"); PrintWriter out = new Prin...
B10149
B10570
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 =...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package practicejam; import java.io.*; /** * * @author GreenTie */ public class PracticeJam { // public int[] compute(int[][] input){ // int[] result=new int[input.length]; // for(int i=0;i<input.l...
A20934
A21419
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.FileReader; import java.io.IOException; import java.util.StringTokenizer; public class Dancing { public static void main(String[] args) throws IOException { BufferedReader f = new BufferedReader(new FileReader("dancing.in")); //PrintWriter out = new PrintWriter(n...
A12570
A10931
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.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.InputStreamReader; import java.io.PrintWriter; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author nzey...