F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
B21790 | B21690 | 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.File;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Scanner;
import java.util.Set;
import com.google.common.collect.Sets;
public class C {
public static void main(String [] args) throws IOException {
String inputFile = "src/C-large.in";
Scanner in = new Scanner(new Fi... |
B13196 | B11746 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Q3M {
public static void main(String[] args) throws Exception {
compute();
}
private ... | import java.io.*;
import java.util.*;
public class Recycle
{
static int total;
static Set<Integer> set;
public static void main(String[] codejam) throws Exception
{
BufferedReader br = new BufferedReader (new FileReader ("recycle.in"));
PrintStream ps = new PrintStream... |
A12544 | A13098 | 0 | package problem1;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Arrays;
public class Problem1 {
public static void main(String[] args) throws FileNotFoundException, IOException{
try {
TextIO... | import java.io.*;
import java.util.*;
public class Qual22B
{
public static void main(String[] args) throws IOException
{
BufferedReader ips=new BufferedReader(new FileReader("B-small-attempt2.in"));
PrintWriter ops=new PrintWriter(new FileWriter("dwgop.in"));
int T=Integer.parseInt(ips.readLine());
for(int i=... |
A22992 | A20700 | 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.FileNotFoundException;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.Scanner;
public class googler {
public static void main(String args[]) throws FileNotFoundException
{
Scanner in=new Scanner(new FileReader("input.in"));
PrintWriter pw=new PrintWriter("ans.txt");... |
B12115 | B12836 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumbers {
String filename;
BufferedReader br;
PrintWriter pw;
public RecycledNumbers(String... |
A22360 | A21130 | 0 | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Scanner;
public class Dancing_With_the_Googlers {
/**
* The first line of the input gives the ... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) {
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
int count = 0;
try {
count = Integer.parseInt(input.readLine());
} catch (... |
A12113 | A12101 | 0 | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class B {
static int[][] memo;
static int[] nums;
static int p;
public static void main(String[] args)throws IOException
{
Scanner br=new Scanner(new File("B-small-attempt0.in"... | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class dancing {
public static void main(String[] args) {
dancing dance = new dancing();
dance.readFile("test.txt");
}
... |
B10155 | B10413 | 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.codjam.utils;
import java.util.ArrayList;
public class FileDataAndSettings {
private Integer nCases;
private ArrayList<ArrayList> inputCase;
private String tokenSep;
public FileDataAndSettings()
{
inputCase = new ArrayList<ArrayList>(0);
}
public void... |
B11696 | B12487 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class A {
static int findRecycledNumbers(int a, int b) {
int count = 0;
boolean[] arr = new boolean[b+1];
for (int i = a; i <= b; i++) {
String num = Integer.toStr... |
A11135 | A11787 | 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.text.*;
import java.io.*;
import java.util.*;
import java.lang.Math;
public class B
{
public static void main(String[] args) throws Exception
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int T = Integer.parseInt(br.readLine());
for(int t = 1; t <= T; t++) {
... |
A11502 | A12194 | 0 | package template;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
public class TestCase {
private boolean isSolved;
private Object solution;
private Map<String, Integer> intProperties;
private Map<String, ArrayList<Integer>> intArrayProperties;
private Map<String, Arra... | import java.util.*;
public class QB {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt(); in.nextLine();
for(int cas=0; cas<T; cas++) {
int n = in.nextInt();
int s = in.nextInt();
int p = in.nextInt();
int ans = 0;
for(int i=0; i<n; i++) {
int s... |
A12544 | A13148 | 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 codejam;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class ProblemB {
/**
* @param args
*/
public static void main(String[] args) throws Exception{
// TODO Auto-generated method stub
Scanner sc = new Scanner(new File("ProblemB.tx... |
B21207 | B21830 | 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.util.*;
import static java.lang.Math.*;
public class C {
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int cases = 1; cases <= T;cases++){
int A = in.nextInt();
int B = in.nextInt();
int ans = 0;
for(int i = A ; i < B+1; ... |
A11201 | A10683 | 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.FileNotFoundException;
import java.util.Scanner;
public class Main {
/**
* @param args
* @throws FileNotFoundException
*/
public static void main(String[] args) throws FileNotFoundException {
// TODO Auto-generated method stub
File fi = new File("D:\\B-small-attemp... |
A11201 | A11460 | 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.util.Scanner;
public class problemB {
private static final StringBuilder output = new StringBuilder();
private static int i = 1;
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int tests = s.nextInt();
s.nextLine();
for (int i = 0; i < tests; i++) {
addLine(Str... |
A11917 | A10002 | 0 | package com.silverduner.codejam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
public class Dancing {
public static void main(String[] args) throws Exception {
File input = new File("B-small-attempt... | package qualification;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.Scanner;
import java.util.Vector;
public class ProblemB {
static Scanner scan = new Scanner(System.in);
public static void main(String[] args) {
int cases = scan.nextInt();
for ( int i = 1; i <=... |
B10485 | B11961 | 0 |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class Recycle
{
public static void main(String[] args)
{
/* Set<Integer> perms = getPermutations(123456);
for(Integer i: p... | import java.io.*;
import java.util.*;
/**
* */
public class Main {
/**
* */
public class TestCase{
public Integer a, b;
public Integer[] rNumbers;
public Integer iResult=0;
public Set<String> setPairs=Collections.synchronizedSet( new HashSet<String>());
/**
* @param a
* @param b
* */
... |
B21227 | B22089 | 0 | import java.util.HashSet;
import java.util.Scanner;
public class C {
static HashSet p = new HashSet();
static int low;
static int high;
int count = 0;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int no = sc.nextInt();
for (int i = 1; i <= no; i++) {
p.clear();
lo... | package codejam;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;
public class Numbers {
public static void main (String[] args) throws IOException {
Scanner sc = new Scanner(new FileReader("number... |
A12273 | A11905 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Dancing
* Jason Bradley Nel
* 16287398
*/
import java.io.*;
public class Dancing {
public static void main(String[] args) {
In input = new In("input.txt");
int T = Integer.parseInt(input.... | package com.udit.codeJam;
import java.io.*;
public class Gogglers
{
static DataInputStream in = new DataInputStream(new
BufferedInputStream(System.in));
static BufferedReader din = new BufferedReader( new InputStreamReader(in));
public static void main(String[] args)
{
... |
A22078 | A22664 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
public class GooglersDancer {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated metho... | import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.PrintWriter;
public class Googlers {
public static void main(String[] args) throws Exception {
BufferedReader input = new BufferedReader(new FileReader("B-large.in"));
PrintWriter output = new PrintWriter(new... |
A12544 | A13183 | 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.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) );
}... |
B21227 | B20574 | 0 | import java.util.HashSet;
import java.util.Scanner;
public class C {
static HashSet p = new HashSet();
static int low;
static int high;
int count = 0;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int no = sc.nextInt();
for (int i = 1; i <= no; i++) {
p.clear();
lo... | import java.util.*;
import java.math.*;
import java.io.*;
import static java.lang.System.*;
import static java.lang.Math.*;
import static java.lang.Integer.*;
import static java.lang.Double.*;
import static java.lang.Long.*;
public class QC {
static String[] parts(BufferedReader br) throws Exception {
Stri... |
B12085 | B11181 | 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... | /**
* 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... |
B12074 | B10542 | 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.*;
public class C
{
public static int front;
public static int rotate(int in)
{
return (in / 10) + front*(in % 10);
}
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int c = 1; c <= T; c++){
int ans = 0;
... |
A12460 | A10603 | 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... | package base;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import assignments.AssignmentB;
public class Solver {
public static void main(Strin... |
A11917 | A11520 | 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 static java.lang.Math.*;
import static java.math.BigInteger.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
import java.math.*;
import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class DancingWiththeGooglers {
public static void main (String [] args) ... |
B10231 | B11158 | 0 | import java.io.*;
class code1
{
public static void main(String args[]) throws Exception
{
File ii = new File ("C-small-attempt1.in");
FileInputStream fis = new FileInputStream(ii);
BufferedReader br = new BufferedReader(new InputStreamReader (fis));
int cases = Integer.parseInt(br.readLine());
FileOutput... | import java.util.*;
import java.io.*;
public class Test {
public void doMain() throws Exception{
Scanner input = new Scanner(new FileReader("./iothings/C-small-attempt0.in"));
PrintWriter pw = new PrintWriter(new FileWriter("./iothings/output.txt"));
int n = input.nextInt();
for(int i = 0 ; i < n... |
A12460 | A12779 | 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... | package cj2;
import dancingwiththegooglers.ScoreAnalyzer;
import edu.uwec.cs.genacje.codejam.speakingintongues.GooglereseTranslator;
import edu.uwec.cs.genacje.codejam.utilities.objects.IoMgr;
import edu.uwec.cs.genacje.codejam.utilities.objects.StringFormatter;
/**
*
* @author James Genac
*/
public class Main {
... |
B20566 | B21792 | 0 | import java.util.Scanner;
import java.io.*;
import java.lang.Math;
public class C{
public static int recycle(String str){
String[] numbers = str.split(" ");
int min = Integer.parseInt(numbers[0]);
int max = Integer.parseInt(numbers[1]);
int ret = 0;
for(int i = min; i < max; i++){
String num = i + "";
... | import java.io.*;
import java.util.*;
public class C extends CodeJammer {
public void process() throws IOException {
long[] input = reader.readLongArray();
long a = input[0];
long b = input[1];
int digits = 0;
long a1 = a;
while (a1>0) {
a1 /= 10;
digits++;
}
long total = 0;
for (long x... |
B13196 | B12274 | 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 year2012.qualification.c;
import java.io.File;
import java.io.PrintWriter;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) throws Exception{
//GCJå
±é
String filename = "src/year2012/qualification/c/C-small-attempt0";
PrintWriter out = new PrintWriter(n... |
B12570 | B10070 | 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.*;
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... |
A22378 | A22258 | 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.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.FileInputStream;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.InputStream;
/**
* Built using ... |
B13196 | B10129 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Q3M {
public static void main(String[] args) throws Exception {
compute();
}
private ... | package codejam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class RecycledNumbers {
/**
* @param args
*/
public boolean isRecycled(char[] f, char[] s) {
// f... |
A12544 | A11286 | 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.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class DanceScore {
String[] result = new String[9000];
int testCases = 0;
public static void main(String[] args)throws Exception{
DanceScore bp = new DanceSc... |
A11502 | A11528 | 0 | package template;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
public class TestCase {
private boolean isSolved;
private Object solution;
private Map<String, Integer> intProperties;
private Map<String, ArrayList<Integer>> intArrayProperties;
private Map<String, Arra... | import java.io.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 Solve1 {
public static void main(String[] args) {
FileReader fr;
FileWriter fw;
try {
Fil... |
A22360 | A21102 | 0 | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Scanner;
public class Dancing_With_the_Googlers {
/**
* The first line of the input gives the ... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.util.ArrayList;
import java.util.Collections;
public class Dancing {
public static void main(String[] args) throws Exception {
Dancing object = new Dancing()... |
B10149 | B10131 | 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.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class main2 {
/**
* @param args
* @throws IOException
* @throws NumberFormatException
*/
public static void main(String[] args) throws Numb... |
A22078 | A21220 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class b {
public static void main(String[] args){
if(args.length<1){
System.out.println("Usage: <fnIn>");
}
String fn = args[0];
St... |
A12460 | A10430 | 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... | package MyAllgoritmicLib;
public class SimpleNumbers {
public static boolean[] masInt;
public static void initSimpleInt(int n) { // âõîäíûå äàííûå
masInt = new boolean[n + 1];
for(int i=0; i<=n;i++){
masInt[i] = true;
}
masInt[0] = masInt[1] = false; // åñëè êòî-òî áóäåò èñïîëüçîâàòü ýòè
// çíà÷åíèÿ
... |
B21270 | B20779 | 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... | package recycle;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashSet;
public class Recycle
{
public static void main(String[] args) throws Exception
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int count = Integer.parseInt(br.readLine());
... |
B12085 | B10681 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.Vector;
/**
*
* @author Kholoud
*/
public cl... |
B10858 | B10829 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| package round1;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
public class ProblemC {
public static void main(String[]... |
B21049 | B20727 | 0 | package it.simone.google.code.jam2012;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumber implements GoogleCodeExercise {
int a = 0;
int b = 0;
Set<Couple> distinctCouple = null;
long maxTime = 0;
private class Couple {
int x = 0;
int y = 0;
public Couple(int x, int y) {
this... | package fixjava;
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... |
B21227 | B20652 | 0 | import java.util.HashSet;
import java.util.Scanner;
public class C {
static HashSet p = new HashSet();
static int low;
static int high;
int count = 0;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int no = sc.nextInt();
for (int i = 1; i <= no; i++) {
p.clear();
lo... | import java.io.*;
import java.math.BigInteger;
import java.util.HashMap;
import java.util.InputMismatchException;
/**
* Created by César Passoni
*/
public class TaskC implements Runnable
{
private InputReader in;
private PrintWriter out;
public static void main(String[] args) {
new Thread(new T... |
A11277 | A12751 | 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 qualification;
import java.util.ArrayList;
import java.util.List;
import loader.InputReader;
import loader.OutPutWriter;
public class GoogleDance {
static String inputName = "B-small-attempt0.in";
/**
* @param args
*/
public static void main(String[] args) {
start();
}
public static void star... |
B10245 | B10010 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | package google.codejam.com;
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.io.PrintWriter;
import java.util.HashSet;
import java.util.StringTokenizer;
public class Solutio... |
A21010 | A21253 | 0 | package codejam;
import fixjava.Pair;
public class Utils {
public static long minLong(long firstVal, long... otherVals) {
long minVal = firstVal;
for (int i = 0; i < otherVals.length; i++)
minVal = Math.min(firstVal, otherVals[i]);
return minVal;
}
public static int minInt(int firstVal, int... otherVals... | package com;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class DancingWithTheGooglers {
public static... |
A13029 | A11430 | 0 | import java.util.List;
public class Case implements Runnable {
private int id;
private String output;
private int n;
private int s;
private int p;
private List<Integer> g;
public Case(int id) {
this.id = id;
}
public Case(int id, int n, int s, int p, List<Integer> g) {
super();
this.id = id;
this... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
public class ProblemaB {
private final static String RUTA="C:/Users/Rafael/Documents/Estudio/OtherStuff/Googl... |
A21010 | A20294 | 0 | package codejam;
import fixjava.Pair;
public class Utils {
public static long minLong(long firstVal, long... otherVals) {
long minVal = firstVal;
for (int i = 0; i < otherVals.length; i++)
minVal = Math.min(firstVal, otherVals[i]);
return minVal;
}
public static int minInt(int firstVal, int... otherVals... | package qualification;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Dancing {
public static void main(String[] s){
doIt();
}
... |
A10996 | A13101 | 0 | import java.util.Scanner;
import java.io.*;
class dance
{
public static void main (String[] args) throws IOException
{
File inputData = new File("B-small-attempt0.in");
File outputData= new File("Boutput.txt");
Scanner scan = new Scanner( inputData );
PrintStream print= new PrintStream(outputData);
... | import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;
public class Q2DancingWithGooglers {
public static void main(String[] args) throws IOException {
Sc... |
A20934 | A21617 | 0 | import java.util.*;
public class B {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
B th = new B();
for (int i = 0; i < T; i++) {
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt()... | import java.util.*;
/**
*
* @author Izhari Ishak Aksa
*/
public class ProblemB {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 1; t <= T; t++) {
int n = sc.nextInt();
int s = sc.nextInt();
... |
A20261 | A21949 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package googlecodejamqualifier;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
*
* @author Dean
*/
public class DancingWithGooglers {
public static void main(Str... |
B12074 | B12069 | 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... | /*
* Google Code Jam 2012 - Qualification Round (14.04.2012)
* Thomas "ThmX" Denoréaz - thomas.denoreaz@gmail.com
*/
package codejam._2012.qualif;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashSet;
public class C {
static... |
A11135 | A12840 | 0 | /**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/3/12
* Time: 11:00 AM
* To change this template use File | Settings | File Templates.
*/
import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;
import java.io.*;
import java.util.*;
import java.uti... | package br.com.luan;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class B {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));... |
B12941 | B10476 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class ProblemC {
ProblemC() throws IOException {
Scanner reader = new Scanner(new File("input.txt"));
BufferedWriter writer = new BufferedWriter(new FileWriter("output.tx... |
B10155 | B11061 | 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 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... |
B10702 | B12889 | 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.File;
import java.io.FileReader;
import java.util.HashSet;
import java.util.Set;
/**
*
*/
/**
* @author Kamlesh Saran Dev
*
*/
public class RecycledPair {
int a;
int b;
/**
* @param i
* @param j
*/
public RecycledPair(int a, int b) {
this.a = a;
thi... |
B11327 | B10165 | 0 | package recycledNumbers;
public class OutputData {
private int[] Steps;
public int[] getSteps() {
return Steps;
}
public OutputData(int [] Steps){
this.Steps = Steps;
for(int i=0;i<this.Steps.length;i++){
System.out.println("Test "+(i+1)+": "+Steps[i]);
}
}
}
| import java.io.*;
import java.util.*;
public class RecycledNumbers
{
public static void main(String args[]) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int T = Integer.parseInt(br.readLine());
int[][] ab = new int[T][2];
StringTokenizer st = null;
for (int ... |
A10793 | A11606 | 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.PrintWriter;
import java.io.FileWriter;
import java.io.BufferedReader;
import java.io.FileReader;
/**
* Base class to provide a framework for Google Code Jam type of problems and avoid redundant tasks
* @author nitin
*/
public class BaseSolution {
/**
* Used to write log for debugging
... |
A13029 | A10288 | 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 gcj;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
/**
* @param args
*/
private static int[] values = null;
private static int[] g... |
B12669 | B13030 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package year_2012.qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.... | package qualification.q3;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
* Created by IntelliJ IDEA.
* User: ofer
* Date: 14/04/12
* Time: 20:31
* To change this template use File | Settings | File Templates.
*/
public class Q3Solver {
private Set<S... |
A13029 | A10940 | 0 | import java.util.List;
public class Case implements Runnable {
private int id;
private String output;
private int n;
private int s;
private int p;
private List<Integer> g;
public Case(int id) {
this.id = id;
}
public Case(int id, int n, int s, int p, List<Integer> g) {
super();
this.id = id;
this... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class codejamp2 {
public static char[] map;
public static void main(String[] args) throws IOException{
readFile();
}
publi... |
B21270 | B20363 | 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... | package gcj2012qr;
import java.io.*;
import java.util.*;
import java.util.concurrent.*;
import com.google.*;
/**
* @author Roman Kosenko <madkite@gmail.com>
*/
public class RecycledNumbers extends SingleThreadSolution<Object> {
public static void main(String[] args) throws Exception {
solve(new SolutionFactory<... |
A21010 | A21972 | 0 | package codejam;
import fixjava.Pair;
public class Utils {
public static long minLong(long firstVal, long... otherVals) {
long minVal = firstVal;
for (int i = 0; i < otherVals.length; i++)
minVal = Math.min(firstVal, otherVals[i]);
return minVal;
}
public static int minInt(int firstVal, int... otherVals... | package com.renoux.gael.codejam.utils;
public class TechnicalException extends RuntimeException {
private static final long serialVersionUID = 1L;
public TechnicalException() {
super();
}
public TechnicalException(String message, Throwable cause) {
super(message, cause);
}
... |
B10361 | B11940 | 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.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Ari
*/
public class ProblemC... |
B12941 | B10947 | 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.*;
import java.util.*;
public class rn
{
static Integer rotate(Integer n)
{ String str=n.toString();
char[] a=str.toCharArray();
Character tmp=a[a.length-1];
for(int i=a.length-1;i>0;i--)
{ a[i]=a[i-1];
}
a[0]=tmp;
int i=0;
String temp="";
while(i<a.length)
{ temp+=a[i];
i++;
... |
B10155 | B11314 | 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... | /**
* Copyright 2012 Christopher Schmitz. All Rights Reserved.
*/
package com.isotopeent.codejam.lib;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
public class SolutionWriter extends PrintWriter {
private static final String FORMAT = "Case #%1$s: %2$s%n";
private String... |
A12570 | A11738 | 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... |
public class Scores {
private int N; // Number of Googlers
private int S; // Number of surprising triplets of scores
private int p; // Score at least
private int[] t; // total point of Googlers
public Scores(String str) {
String[] tmpArr = str.split(" ");
N = Integer.parseInt(tmpArr[0]);
S = Integer.p... |
B11327 | B12648 | 0 | package recycledNumbers;
public class OutputData {
private int[] Steps;
public int[] getSteps() {
return Steps;
}
public OutputData(int [] Steps){
this.Steps = Steps;
for(int i=0;i<this.Steps.length;i++){
System.out.println("Test "+(i+1)+": "+Steps[i]);
}
}
}
| import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.List;
import java.util.ArrayList;
public class Rec{
static int rotate(int n, int l){
int pot = (int)Math.pow(10,l-1);
int ld = (int)Math.floor(n/pot);
int cd = n-ld*pot;
i... |
B20734 | B21449 | 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.IOException;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.FileInputStream;
import java.util.NoSuchElementException;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*/
public class Main {
public ... |
B10155 | B11731 | 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... | /*
* SpeakingView.java
*/
package speaking;
import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;
import java.awt.event.ActionEvent;
import j... |
B20023 | B21547 | 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... | package com.lily.acm.googleCodeJam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashSet;
public class RecycledNumbers
{
public static int getRecyleCount(int n,int ... |
B22190 | B20372 | 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.*;
import java.lang.*;
import java.util.*;
class GCJ {
public static void main(String[] args) {
try {
PrintWriter out = new PrintWriter(new FileWriter("1.txt"));
BufferedReader in = new BufferedReader(new FileReader("1.in"));
in.readLine();
int counter = 1;
while (in.read... |
B10485 | B11055 | 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 fixjava;
/**
* Convenience class for declaring a method inside a method, so as to avoid code duplication without having to declare a new method
* in the class. This also keeps functions closer to where they are applied. It's butt-ugly but it's about the best you can do in
* Java.
*/
public interface Lamb... |
B11421 | B10485 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Recycled {
public static void main(String[] args) throws Exception{
String inputFile = "C-small-attempt0.in... |
import java.util.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... |
B12115 | B10375 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... | import java.util.*;
import java.io.*;
import java.math.*;
import java.awt.*;
import static java.lang.Math.*;
import static java.lang.Integer.parseInt;
import static java.lang.Double.parseDouble;
import static java.lang.Long.parseLong;
import static java.lang.System.*;
import static java.util.Arrays.*;
import static jav... |
A11917 | A13209 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package googlecodejam;
/**
*
* @author Bhanu
*/
import java.util.*;
public class DancingGooglers {
public static void main(String arg[]) throws Exception
{
int s1[] = {0,1,2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,... |
B12669 | B10915 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package year_2012.qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.... | package qualification;
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 C {
/**
* @param args
*/
static int number (int num){
int i=0;
while (num!=0){
num/=10;
i+... |
B10231 | B11108 | 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.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class RecycledNumbers {
/**
* @param args
*/
static int a = -1;
static int b = -1;
static int T = -1;
... |
B12115 | B10488 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... | import java.util.*;
public class C {
static int solve(int a, int b) {
int result = 0;
for(int i = a; i <= b; ++i) {
result += suffle(a, b, i);
}
return result/2;
}
static int suffle(int a, int b, int c) {
int base = 1;
int clen = (c+"").length();
Set<Integer> r = new HashSet<Integer>();
whil... |
B10858 | B12337 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| import java.util.*;
public class Recycled {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
int lines = sc.nextInt();
for (int i=0; i<lines; i++) {
int min = sc.nextInt();
int max = sc.nextInt();
int count = 0;
for (int n=min; n<=max; n++) {
int d = countDigi... |
A21396 | A22623 | 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.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Dancing
{
public static void main(String[] args) throws FileNotFoundException
{
Scanner sc = new Scanner(new File("inputs/dancing.in"));
int cases = sc.nextInt();
for (int... |
B10858 | B10428 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.HashSet;
pub... |
B20291 | B20617 | 0 | import java.io.*;
import java.util.*;
class B
{
public static void main(String[] args)
{
try
{
BufferedReader br = new BufferedReader(new FileReader("B.in"));
PrintWriter pw = new PrintWriter(new FileWriter("B.out"));
int X = Integer.parseInt(br.readLine());
for(int i=0; i<X; i++)
{
String[]... | import java.util.HashSet;
import java.util.Scanner;
public class RecycledNumbers {
public static int[] POWER_OF_10 = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000};
public static int rotate(int n, int offset) {
return (n % POWER_OF_10[offset]) * POWER_OF_10[(int) Math.log10(n) + 1 - offset] + (n / POWER_... |
A12273 | A10922 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Dancing
* Jason Bradley Nel
* 16287398
*/
import java.io.*;
public class Dancing {
public static void main(String[] args) {
In input = new In("input.txt");
int T = Integer.parseInt(input.... | package codejam.qualification;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import codejam.Task;
public class B extends Task {
private int t;
private String[][] testCases;
private String[] resultset;
public B(String[] args) {
super(args);
}
public static void main(String[] a... |
B12669 | B11031 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package year_2012.qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.... | package org.moriraaca.codejam;
import java.io.File;
import java.io.InputStream;
import java.io.PrintStream;
public abstract class AbstractSolver<TC extends TestCase> {
protected final String RESOURCE_FOLDER = "src/main/resources/";
/* Config */
protected final String defaultInputFileName;
protected final Output... |
A13029 | A10238 | 0 | import java.util.List;
public class Case implements Runnable {
private int id;
private String output;
private int n;
private int s;
private int p;
private List<Integer> g;
public Case(int id) {
this.id = id;
}
public Case(int id, int n, int s, int p, List<Integer> g) {
super();
this.id = id;
this... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class dancing {
public static void main(String[] args)
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int T;
String input;
try... |
B11361 | B11577 | 0 | import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
public class C{
Scanner sc=new Scanner(System.in);
int INF=1<<28;
double EPS=1e-9;
int caze, T;
int A, B;
void run(){
T=sc.n... | package recyclednumbers;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Scanner;
public class RN {
public static void main(String[] args) throws Exception
{
new RN().run();
}
void run() throws Exception
{
Scanner sc = new Scanner(new FileReader("C-sma... |
A10793 | A13189 | 0 | import java.io.*;
import java.math.*;
import java.util.*;
import java.text.*;
public class b {
public static void main(String[] args) {
Scanner sc = new Scanner(new BufferedInputStream(System.in));
int T = sc.nextInt();
for (int casenumber = 1; casenumber <= T; ++casenumber) {
... |
import java.io.*;
import java.text.*;
import java.math.*;
import java.util.*;
public class J12QB implements Runnable {
Scanner in;
PrintWriter out;
static String taskname = ".\\src\\B-small-attempt0";
int test, testn, i, j, k;
int N,S,p;
public static void main(String[] args) {
new Thread(new J12QB()).start(... |
B21207 | B20791 | 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) ... | package Qual;
import java.io.*;
import java.math.*;
import java.util.*;
public class C {
static void start() throws IOException {
new C().run1();
}
private final String dir = "D:\\contest\\gcj\\2012\\" + getClass().getPackage().toString().split(" ")[1] + "\\" + getClass().getSimpleName();
// private final Stri... |
B10149 | B12683 | 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.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.StringTokenizer;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
RecycledNumbers r = new RecycledNumbers();
r.run("C-small.in", "C-small.out... |
B21790 | B20595 | 0 | import java.io.*;
import java.util.*;
public class C {
void solve() throws IOException {
in("C-large.in"); out("C-large.out");
long tm = System.currentTimeMillis();
boolean[] mask = new boolean[2000000];
int[] r = new int[10];
int t = readInt();
for (int cs = 1; cs... | package be.mokarea.gcj.recyclednumbers;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
import be.mokarea.gcj.common.TestCaseReader;
public class RecycledNumbersTestCaseReader extends
TestCaseReader<RecycledNumbersTestCase> {
private final... |
A12544 | A10668 | 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.IOException;
import java.util.StringTokenizer;
public class Judging {
private int cases;
public Judging() throws IOException {
cases = Integer.valueOf(getLine());
run();
}
public String getLine() throws IOException {
String s = "";
char c;
while ((c = (char) System.in.read()) != '\n') {... |
A11201 | A12742 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | import java.io.BufferedReader;
import java.io.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... |
A20934 | A20776 | 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.FileReader;
import java.io.BufferedReader;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class DancingGooglers {
/**
* @param args
*/
public static void main(String[] args) {
try{
//read file
FileReader filein = new FileReader(args[0]);
BufferedReader in = ne... |
A22992 | A22203 | 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 br.com.atama.google.jam;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import br.com.atama.google.jam.dancing.ScoreCalculator;
public class Solver {
public static void main(String[] args) throws IOException {
FileReader reader = new FileReader("src/input-small.txt"... |
B10702 | B12985 | 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 qualification_2012;
import java.io.File;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
public class C {
public void run() {
try {
Scanner in = new Scanner(new File("C.in"));
PrintWriter out = new PrintWriter(new File("C.txt"));
int T = in.nextInt();
for ... |
A12460 | A10240 | 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... | /**
ID: jerryma1
LANG: JAVA
PROG: B
*/
import java.io.*;
import java.util.*;
public class B {
static BufferedReader cin, in;
static StringTokenizer tk;
static PrintWriter out;
static int [] d = {0, 1, 4, 7, 10, 13, 16, 19, 22, 25, 28};
static int [] m = {100, 100, 2, 5, 8, 11, 14, 17, 20, 23, 26};
sta... |
A20382 | A22623 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... | import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Dancing
{
public static void main(String[] args) throws FileNotFoundException
{
Scanner sc = new Scanner(new File("inputs/dancing.in"));
int cases = sc.nextInt();
for (int... |
B21752 | B20368 | 0 | package Main;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
/**
* Created with IntelliJ IDEA.
* User: arran
* Date: 14/04/12
* Time: 3:12 PM
* To change ... | package Practice;
import java.util.ArrayList;
import java.util.Scanner;
public class B {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int t = 1;
int a, b;
ArrayList<Integer>[] v = new ArrayList[2000010];
for (int i = 0; i < v.length; i++)
v[i] = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.