F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
B10231 | B11950 | 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.*;
public class Recycler {
public static void main(String[] args) {
Recycler rec = new Recycler();
String line = "";
BufferedReader br;
BufferedWriter output;
FileWriter fstream;
int x;
int y;
try {
br = new BufferedReader(new FileReader("C-small-attempt0.in"));
li... |
B10485 | B12669 | 0 |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class Recycle
{
public static void main(String[] args)
{
/* Set<Integer> perms = getPermutations(123456);
for(Integer i: p... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package 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.... |
B10702 | B11853 | 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... |
public class Recycled {
static String test = "4\n1 9\n10 40\n100 500\n1111 2222";
static String val = "50\n187 934\n138 960\n117 921\n1 2\n171 919\n152 967\n903 903\n137 953\n144 984\n182 988\n144 955\n169 993\n186 920\n143 918\n154 923\n154 959\n577 592\n146 944\n149 981\n128 979\n176 910\n251 674\n136 967\n169 976... |
A12846 | A10033 | 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 com.code;
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.io.Writer;
public class ReadWriteInputFile
{
public BufferedReader readInputFi... |
B11327 | B12631 | 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.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class RecycledNumbers {
public static final String INPUT = "C-small-attempt0.in";
public static final String OUTPUT = "output";
public static void main(String args[]) throws IOException{
Scanner s = UtilGoogle.readFile(... |
B20291 | B21423 | 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 code.google.codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
/**
* @author sunilkumarp
*
*/
public abst... |
A11201 | A11569 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | package dancingwiththegooglers;
import java.io.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.io.Writer;
import java.util.ArrayList;
import java.util.List;
pub... |
B21790 | B20840 | 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.util.HashSet;
import java.util.Scanner;
import java.util.regex.Pattern;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author alvin
*/
public class RecycledNumbers {
public static void main(String[] args) {
Scanner sc = new... |
B10245 | B12303 | 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 com.mohit.codejam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class RecycledNumbers {
public static void main(String[] args) {
try {
int noOfTests = 0;
... |
B20566 | B20437 | 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.File;
import java.io.PrintWriter;
import java.util.NoSuchElementException;
import java.util.Scanner;
import java.util.Set;
import java.util.HashSet;
public final class RecycledNumbersAnalyzer {
private static boolean isRecycledPair (final int n, final int m) {
if (n < 10)
return false;
final ... |
A20934 | A21608 | 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.google.codejam._2012;
import java.io.File;
import java.util.Scanner;
public class DancingWithGooglers
{
int[][] maxScores;
private void setup()
{
maxScores = new int[31][2];
for(int i = 0; i <= 30; i++)
maxScores[i][1] = -1;
for(int score = 0; sco... |
A11917 | A12918 | 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 lt.kasrud.gcj.ex2;
import lt.kasrud.gcj.common.io.Reader;
import lt.kasrud.gcj.common.io.Writer;
import java.io.IOException;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
List<String> iData = Reader.readFile("B-small-attempt0.in");
Writer.writeF... |
B11421 | B13031 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Recycled {
public static void main(String[] args) throws Exception{
String inputFile = "C-small-attempt0.in... | package qualification.common;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
/**
* Created by IntelliJ IDEA.
* User: ofer
* Date: 14/04/12
* Time: 17:31
* To change this template use File | Settings | File Templates.
*/
public class OutputWriter {
public static void ... |
A12570 | A11357 | 0 | package util.graph;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
public class DynDjikstra {
public static State FindShortest(Node start, Node target) {
PriorityQueue<Node> openSet = new PriorityQueue<>();
Set<Node> closedSet = new HashSet<>();
openSet.add... | import java.io.*;
import java.util.*;
public class Dancing {
class Case{
int surprises;
int bestscore;
int[] scores;
int counter;
public Case(int[] input){
this.surprises = input[1];
this.bestscore = input[2];
scores = new int[input[0]];
System.arraycopy(input, 3, this.scores, 0, scores.lengt... |
A11502 | A12685 | 0 | package template;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
public class TestCase {
private boolean isSolved;
private Object solution;
private Map<String, Integer> intProperties;
private Map<String, ArrayList<Integer>> intArrayProperties;
private Map<String, Arra... | import java.util.Scanner;
public class B_Dancing {
static boolean enoughNonSurprising(int p, int score) {
return score >= 3*p-2;
}
static boolean enoughSurprising(int p, int score) {
return score >= 3*p-4;
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextIn... |
B10149 | B10627 | 0 | import java.io.FileInputStream;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeSet;
// Recycled Numbers
// https://code.google.com/codejam/contest/1460488/dashboard#s=p2
public class C {
private static String process(Scanner in) {
int A = in.nextInt();
int B = in.nextInt();
int res =... | package Controller;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class IO {
private String fileName;
private BufferedReader reader;
public IO(String fileName) {
this.fileName = fileName;
createReader();
}
public String re... |
B21227 | B20633 | 0 | import java.util.HashSet;
import java.util.Scanner;
public class C {
static HashSet p = new HashSet();
static int low;
static int high;
int count = 0;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int no = sc.nextInt();
for (int i = 1; i <= no; i++) {
p.clear();
lo... | import java.io.*;
import java.util.Scanner;
public class Main3 {
public static void main(String args[]) throws FileNotFoundException
{
//String test = "123400";
//System.out.println(test.substring(2,4));
Scanner in = new Scanner(new FileReader("input.in"));
PrintWriter out = new PrintWriter("output.txt");
i... |
B11361 | B11010 | 0 | import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
public class C{
Scanner sc=new Scanner(System.in);
int INF=1<<28;
double EPS=1e-9;
int caze, T;
int A, B;
void run(){
T=sc.n... | import java.util.*;
import java.io.*;
public class C {
public static void main(String[] args) {
try
{
Scanner input = new Scanner(new FileReader("C.in"));
PrintWriter output = new PrintWriter(new FileWriter("C.out"));
try
{
int i = Integer.parseInt(input.nextLine());
for(int j=0; j<i; j++)
... |
B12669 | B11061 | 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 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... |
A21557 | A22014 | 0 | import java.io.*;
import java.util.*;
public class DancingWithGooglers {
public static class Googlers {
public int T;
public int surp;
public boolean surprising;
public boolean pSurprising;
public boolean antiSurprising;
public boolean pAntiSurprising;
public Googlers(int T, int surp) ... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Vector;
public class question2CodeJam {
public int N = 0;
public int S = 0;
public int P = 0;
Vector<Integer> Scores = new Vector<In... |
B21752 | B20161 | 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 com.google.codejam.recyclednumbers;
import java.io.*;
import java.util.*;
public class RecycledNumbers {
private static String filename = "large";
public static void main(String[] args) throws Exception {
RandomAccessFile input = new RandomAccessFile(filename + "_in.txt", "r");
RandomAccessFile outpu... |
B20566 | B21215 | 0 | import java.util.Scanner;
import java.io.*;
import java.lang.Math;
public class C{
public static int recycle(String str){
String[] numbers = str.split(" ");
int min = Integer.parseInt(numbers[0]);
int max = Integer.parseInt(numbers[1]);
int ret = 0;
for(int i = min; i < max; i++){
String num = i + "";
... | import java.util.*;
public class C {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int zz = 1; zz <= T;zz++){
int A = in.nextInt();
int B = in.nextInt();
int result = 0;
for(int i=A;i<=B;i++) {
ArrayList<Integer> pairs = new ArrayList<Inte... |
A22360 | A20938 | 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.*;
import java.util.*;
public class dancing {
static String next() {
if (st == null || !st.hasMoreTokens())
nextLine();
return st.nextToken();
}
static int nextInt() {
return Integer.parseInt(next());
}
static void nextLine() {
try {
st = new StringTokenizer(f.readLine());
} catch... |
B12669 | B11731 | 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.... | /*
* 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... |
B11361 | B12418 | 0 | import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
public class C{
Scanner sc=new Scanner(System.in);
int INF=1<<28;
double EPS=1e-9;
int caze, T;
int A, B;
void run(){
T=sc.n... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
public class RecycledNumbers {
/**
* @param args
*/
public... |
A11277 | A12833 | 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 static java.lang.Double.parseDouble;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.System.exit;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
... |
A12570 | A12355 | 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.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class B {
public static void main(String args[]) {
try {
String fileName = "C:\\Users... |
A22360 | A22272 | 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 the2012;
import java.io.*;
import java.util.Scanner;
public class DancingWithTheGooglers {
public static void main(String[] args) throws Exception {
Scanner scanner = new Scanner(new BufferedInputStream(new FileInputStream("/Users/taobo2/Downloads/B-large.in.txt")));
Writer output = new ... |
A12273 | A10658 | 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 utils;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
public class Dancing {
public static void main(String[] args) {
lecture("/Users/valentinbonneaud/Downloads/B-small-attempt0.in");
/... |
A20119 | A21292 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class DancingWithGooglers {
public String findMaxGooglers(String line) {
String[] tokens = line.split(" ");
int numGoogler... |
B12115 | B12785 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... | package qualification;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Recycled {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int numCases = s.nextInt();
for (int i = 1; i <= numCases; i++) {
int a = s.nextInt();
int b = s... |
B10485 | B10266 | 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 C;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
public class RecycledNumbers {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
/* Input File */
BufferedReader reader = ne... |
B13196 | B10981 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Q3M {
public static void main(String[] args) throws Exception {
compute();
}
private ... | import java.util.Scanner;
public class Recycle {
/**
* @param args
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int cases = Integer.parseInt(sc.nextLine());
for(int i = 0; i < cases; i++) {
Scanner line = new Scanner(sc.nextLine());
int A = line.nextInt();
... |
A10996 | A10991 | 0 | import java.util.Scanner;
import java.io.*;
class dance
{
public static void main (String[] args) throws IOException
{
File inputData = new File("B-small-attempt0.in");
File outputData= new File("Boutput.txt");
Scanner scan = new Scanner( inputData );
PrintStream print= new PrintStream(outputData);
... | package codejam2012;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Scanner;
/**
* Created by IntelliJ IDEA.
* User: Jimmy
* Date: 4/14/12
* Time: 10:17 PM
*/
public class DancingWithTheGooglers implements Runnable {
Scanner ... |
A12460 | A10630 | 0 | /**
*
*/
package pandit.codejam;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Scanner;
/**
* @author Manu Ram Pandit
*
*/
public class DancingWithGoogle... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.util.Tre... |
A11277 | A11182 | 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.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
public class DancingGooglers {
/**
* @param args
*/
pu... |
A22642 | A22330 | 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... | package com.google;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class DancingGooglers {
private static boolean testing = false;
private static int surprisingScores;
private static int getPossibleCount(int score, int findingThreshold) {
int a;
int b;
int c;
... |
A22992 | A20505 | 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.*;
import java.math.BigInteger;
import java.util.InputMismatchException;
/**
* @author Malvino Juwono (malvino.juwono@gmail.com)
*
*/
public class ProblemB implements Runnable {
private InputReader in;
private PrintWriter out;
public static void main(String[] args) {
new Thread(new ProblemB())... |
A12460 | A12373 | 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 taskb;
import java.io.FileNotFoundException;
import java.util.*;
import java.io.File;
import java.io.PrintWriter;
public class TaskB {
private void solve(Scanner in, PrintWriter out, int caseNum){
int res = 0;
int N = in.nextInt();
int S = in.nextInt();
int p = in.... |
A21010 | A22625 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package googlecodejam;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
/**
*
*... |
B10245 | B10686 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import j... |
A12570 | A11144 | 0 | package util.graph;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
public class DynDjikstra {
public static State FindShortest(Node start, Node target) {
PriorityQueue<Node> openSet = new PriorityQueue<>();
Set<Node> closedSet = new HashSet<>();
openSet.add... | import java.io.*;
import java.util.*;
public class B implements Runnable
{
//private String IFILE = "input.txt";
private String IFILE = "B-small-attempt0.in";
private Scanner in;
private PrintWriter out;
public void Run() throws IOException
{
in = new Scanner(new File(IFILE));
out = new PrintWriter("out... |
B12570 | B11899 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recycle.number;
import dancing.gogglers.Googlers;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IO... |
A22642 | A21040 | 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... | package codejam;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
public class Second {
public static void main(String[] args) throws FileNotFoundException {
String path = ClassLoader.getSystemClassLoader().getResource("codejam/").getPath();... |
A22642 | A21851 | 0 | import java.util.*;
import java.io.*;
public class DancingWithTheGooglers
{
public DancingWithTheGooglers()
{
Scanner inFile = null;
try
{
inFile = new Scanner(new File("inputB.txt"));
}
catch(Exception e)
{
System.out.println("Problem ope... | import java.util.ArrayList;
import java.util.List;
import Utils.FileHelper;
public class Gcj2012b {
private void solve(String inputPath, String filepath) {
FileHelper fHelper = new FileHelper(inputPath);
String[] inputStr= new String[fHelper.getTotalSize()];
List<String> rstList = new ArrayList<... |
A22078 | A22347 | 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 R0;
import java.util.HashMap;
import java.util.Scanner;
/**
*
* @author Rohit
*/
public class QB {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int Tcases = s.nextInt();
s.nextLine();
... |
A20119 | A22210 | 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 gcj.main;
import java.io.BufferedReader;
import java.io.BufferedWriter;
public interface Case {
public void init(int caseNum, BufferedReader br) throws Exception;
public void solve() throws Exception;
public void generateOutput(BufferedWriter bw, boolean needBR) throws Exception;
}
|
A12273 | A12464 | 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.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Chung Lee
*/
public class DanceGoog... |
A12544 | A11544 | 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 br.com.codejam.qualification;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class DancingWithGooglers {
public static void main(String[] args) throws IOException {
String file = "B-small-attempt3";
Scanner sc... |
A20934 | A21192 | 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.IOException;
import java.util.Scanner;
public class code12 {
public static int nosurprise(int n){
int p= (n/3);
if(n%3==0){return p;}else{return (p+1);}}
public static int surprise(int n){
int p=(n/3);
if(n%3==2){return (p+2);}else{
if(n%3==1){return (p+1);}
el... |
B12082 | B11316 | 0 | package jp.funnything.competition.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.apache.commons.io.IOUtils;
public class QuestionReader {
pr... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintStream;
public class prob3 {
/**
* @param args
*/
static BufferedReader openRead(String fileName){
BufferedReader in = null;
try {
... |
B10231 | B10443 | 0 | import java.io.*;
class code1
{
public static void main(String args[]) throws Exception
{
File ii = new File ("C-small-attempt1.in");
FileInputStream fis = new FileInputStream(ii);
BufferedReader br = new BufferedReader(new InputStreamReader (fis));
int cases = Integer.parseInt(br.readLine());
FileOutput... | package qualification.taskA;
import java.util.Map;
public class Task {
private Map<Character, Character> dictionary ;
public Task(Map<Character, Character> dictionary ) {
this.dictionary = dictionary;
}
public String execute(String original) {
StringBuilder result = new StringBuilder();
for(int i = 0; i ... |
A11201 | A12163 | 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.*;
public class B
{
BufferedReader read;
BufferedWriter write;
public static void main(String args[])
{
try {
new B().init("B-small-attempt0");
// new B().init1();
} catch (Exception ex) {
// Logger.getLogger(Sample.class.getName()).log... |
B10485 | B11328 | 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 recycledNumbers;
import java.util.ArrayList;
public class Algorithms {
public static OutputData getOutput(InputData inputdata) {
// TODO Auto-generated method stub
int [] Results = new int[inputdata.getTest_Number()];
for(int i=0;i<Results.length;i++){
Results[i] = getSingleResult(inputdata.getA... |
B20006 | B21935 | 0 | import java.io.*;
import java.math.BigInteger;
import java.util.*;
import org.jfree.data.function.PowerFunction2D;
public class r2a
{
Map numMap = new HashMap();
int output = 0;
/**
* @param args
*/
public static void main(String[] args)
{
r2a mk = new r2a();
try {
... | package quialification;
import base.Base;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
/**
* Created with IntelliJ IDEA.
* User: babulya
* Date: 14.04.12
* Time: 19:45
* To change this template use File | Settings | File Templates... |
A11277 | A10018 | 0 | package googlers;
import java.util.Scanner;
import java.util.PriorityQueue;
import java.util.Comparator;
public class Googlers {
public static void main(String[] args) {
int n,s,p,count=0,t;
Scanner sin=new Scanner(System.in);
t=Integer.parseInt(sin.nextLine());
int result[]=new int[t];
int ... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
public class R1P2 {
/**
* @param args
*/
public static void main(String[] args) throws Exception{
BufferedReader in = new BufferedReader(new FileReader("B-small-attempt0.in"));
BufferedWrite... |
B20566 | B21855 | 0 | import java.util.Scanner;
import java.io.*;
import java.lang.Math;
public class C{
public static int recycle(String str){
String[] numbers = str.split(" ");
int min = Integer.parseInt(numbers[0]);
int max = Integer.parseInt(numbers[1]);
int ret = 0;
for(int i = min; i < max; i++){
String num = i + "";
... | package gcj2012;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class RecycledNumbers {
private static final class IntPair {
Integer a, b;
IntPair(Integer a,Integer b) {
t... |
A13029 | A12528 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcjqual;
import java.io.*;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author greg
*/
public class GCJQual2 {
/**
* @param args the command... |
A22078 | A21736 | 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_2012;
import java.io.PrintWriter;
import java.util.Scanner;
public class PB {
static Scanner sc = new Scanner(System.in);
static PrintWriter pw = new PrintWriter(System.out);
public static void main(String[] args) {
int t = sc.nextInt();
for (int i = 1; i <= t; i++) {
int n = sc.nextI... |
B11696 | B10754 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recycled;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashSet;
import java.util.Set;
public class G3 {
public static void main(String[] args) throws Exception {
BufferedReader in = new BufferedReader(new FileReader("d:\\C-small... |
B12074 | B11468 | 0 | package jp.funnything.competition.util;
import java.math.BigInteger;
/**
* Utility for BigInteger
*/
public class BI {
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger add( final BigInteger x , final BigInteger y ) {
return... | package common;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.LinkedList;
import java.util.Queue;
public class FileTranslatorBasis {
private int numOfCase;
private File file;
Queue<String> dataList = new LinkedList<String>();
publ... |
A22378 | A21456 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class CodeJam {
// public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt";
public static final String INP... | import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.Scanner;
public class Googlers {
public static void main(String[] args) throws FileNotFoundException {
Scanner in = new Scanner(new FileReader(new File("B-large.in")));
PrintWrit... |
A21010 | A20102 | 0 | package codejam;
import fixjava.Pair;
public class Utils {
public static long minLong(long firstVal, long... otherVals) {
long minVal = firstVal;
for (int i = 0; i < otherVals.length; i++)
minVal = Math.min(firstVal, otherVals[i]);
return minVal;
}
public static int minInt(int firstVal, int... otherVals... | import java.util.*;
public class Problem2 {
public Problem2(){
Scanner scan = new Scanner(System.in);
int inputs = scan.nextInt();
for(int i=1; i<=inputs; i++){
int googlers = scan.nextInt();
int sur = scan.nextInt();
int bResult = scan.nextInt();
int num = 0;
int[] results = new int[googlers];
... |
B12115 | B11095 | 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 CodeJamC {
/**
* @param args
*/
public static void main(String[] args) {
int A,B,tc;
Scanner sc= new Scanner(System.in);
tc=sc.nextInt();
for(int TC=1; TC<=tc; TC++){
A=sc.nextInt();
B=sc.nextInt();
int suma=0;
Integer Ai= new Integer(A);
String sA=Ai.toString()... |
A12570 | A12342 | 0 | package util.graph;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
public class DynDjikstra {
public static State FindShortest(Node start, Node target) {
PriorityQueue<Node> openSet = new PriorityQueue<>();
Set<Node> closedSet = new HashSet<>();
openSet.add... | package teardrop.jam2012.qr.dancing;
import org.testng.annotations.Test;
import java.io.Reader;
import java.io.StringReader;
import java.io.StringWriter;
import java.io.Writer;
public class SetSolverTest {
private static final String testInput =
"4\n" +
"3 1 5 15 13 11\n" +
"3 0 8 23 22 21\n" +
... |
B10149 | B10301 | 0 | import java.io.FileInputStream;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeSet;
// Recycled Numbers
// https://code.google.com/codejam/contest/1460488/dashboard#s=p2
public class C {
private static String process(Scanner in) {
int A = in.nextInt();
int B = in.nextInt();
int res =... | import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class CodeJam {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
try {
int testCaseCount = scanner.nextInt();
for (int i = 0; i < testCaseCount; i++) {
int A = scanner.nextInt();
int B... |
A12113 | A12294 | 0 | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class B {
static int[][] memo;
static int[] nums;
static int p;
public static void main(String[] args)throws IOException
{
Scanner br=new Scanner(new File("B-small-attempt0.in"... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) {
try {
Bu... |
A13029 | A12047 | 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.*;
import java.util.*;
public class B
{
public static void main(String[] args) throws Exception
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int numCases = Integer.parseInt(br.readLine());
for(int i = 0; i < numCases; i++) {
solveCase(i+1, br.readLine());
... |
A12460 | A11174 | 0 | /**
*
*/
package pandit.codejam;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Scanner;
/**
* @author Manu Ram Pandit
*
*/
public class DancingWithGoogle... | import java.util.*;
public class ProblemB {
public static void main(String[] args) {
System.out.println("Enter input for case:");
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
sc.nextLine();
int[] nt = new int[T];
int[] st = new int[T];
int[] pt = new int[T];
int[][] ni = new int[T]... |
B12085 | B10436 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import jav... |
A11277 | A11596 | 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 quals;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
BufferedReader reader =... |
B20856 | B20357 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Happy;
import java.io.*;
import java.math.*;
import java.lang.*;
import java.util.*;
import java.util.Arrays.*;
import java.io.BufferedReader;
//import java.io.IOException;
//import java.io.InputStreamReader;
//... | import java.io.File;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
public class QuestionC {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
File fileread = new File("C-large.in.txt");
File ... |
B20734 | B20813 | 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.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
public class C {
public static void main(String[] args... |
A22191 | A21719 | 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... |
public class DancingGooglers {
static String test = "4\n3 1 5 15 13 11\n3 0 8 23 22 21\n2 1 1 8 0\n6 2 8 29 20 8 18 18 21";
static String val = "100\n6 2 8 29 20 8 18 18 21\n68 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\... |
A11135 | A12779 | 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 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 {
... |
B10231 | B12883 | 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.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.LinkedList;
import java.util.Scanner;
class MyPair
{
public int one = 0;
public int two = 0;
};
public class ProblemC
{
public static boolean has(int one, int two, LinkedList<MyPair> list)
{
for (int i =... |
A22992 | A22594 | 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 com.google.dancing;
import java.util.Scanner;
import com.google.util.FileUtil;
/*
*
*
*/
public class Dancing {
public static void main(String[] args) {
String orgFilePath = "E:\\Google_Jam\\Dancing\\B-large.in";
Scanner scanner = FileUtil.openFile(orgFilePath);
StringBuilder sb = new StringBuilde... |
B20856 | B20902 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Happy;
import java.io.*;
import java.math.*;
import java.lang.*;
import java.util.*;
import java.util.Arrays.*;
import java.io.BufferedReader;
//import java.io.IOException;
//import java.io.InputStreamReader;
//... | /**
* Copyright 2012 Christopher Schmitz. All Rights Reserved.
*/
package com.isotopeent.codejam.lib.converters;
import com.isotopeent.codejam.lib.InputConverter;
import com.isotopeent.codejam.lib.Utils;
public class IntArrayLine implements InputConverter<int[]> {
private int length;
private int[] input;
priva... |
A11201 | A12680 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | package com.piscessera.google.codejam.q02;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Writer;
public class Q2 {
private int t; // ... |
B12570 | B11162 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | import java.util.*;
public class JuanjeProblemaC
{
public static void main(String[] args){
Scanner entrada = new Scanner(System.in);
int tam = entrada.nextInt();
for(int problema = 1; problema <= tam;problema++)
{
int A = entrada.nextInt();
int B = entrada.nextInt();
int resultado = 0;
for(int in... |
A11917 | A10265 | 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.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class ProblemB {
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(System.in);
String output = "./result.txt";
BufferedWriter writer ... |
B10245 | B11001 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
public class Hw3 {
public static int calNum(int n1, int n2){
int num = 0;
int i =0;
for( i=n1; i<=n2; i++){
Str... |
B12085 | B10165 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | import java.io.*;
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 ... |
B21227 | B20472 | 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.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class recycle {
public static void main(String args[]) throws IOException {
Scanner s = new Scanner(new File("D:\\workspace\\GC12\\src\\input2.txt"));
File... |
B10149 | B13117 | 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.util.ArrayList;
/**
* Problem C
*
* @author thomas
*/
public class RecycledNumbers {
public static void main(String[] args) {
String linea;
try {
FileReader fis = new FileReader("C-small-attempt0.in");
... |
A22191 | A22631 | 0 | package com.example;
import java.io.IOException;
import java.util.List;
public class ProblemB {
enum Result {
INSUFFICIENT,
SUFFICIENT,
SUFFICIENT_WHEN_SURPRISING
}
public static void main(String[] a) throws IOException {
List<String> lines = FileUtil.getLines("/B-large.in");
int cases = Int... | package codejam.y2012.r0;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
/**
* @author Ilya Lantuh
*/
public class Task2 {
static Scanner input;
static BufferedWriter ou... |
A21557 | A22220 | 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) ... | /**
* Program : Test for google code jam
* Author : jenogg
* Since : 2012.04.14
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
public class Subject0102 {
/** Mapping map */
private Map<String, String> mapper;
... |
B10858 | B10420 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| package gcj_2012;
/**
* Time: 6:31:53 PM, Apr 13, 2012
* @author Maya is the best :-)
*/
import java.util.Scanner;
import java.io.PrintWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
public class C {
static Scanner in;
static String path = "src/gcj_... |
B10149 | B12051 | 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.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
class Recycle extends Question{
public Recycle(String in, String out) {
super(in, out);
}
public void solve(){
ArrayLis... |
B10149 | B12506 | 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.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
public class ProblemC {
public static void main(String[] args) throws FileNotFoundException {
String test = "4\n" + "1 9\n" + "10 40\n" + "100 500\n" + "1111 2222\n";
Scanner sc = new Scanner(new Fi... |
B20291 | B21052 | 0 | import java.io.*;
import java.util.*;
class B
{
public static void main(String[] args)
{
try
{
BufferedReader br = new BufferedReader(new FileReader("B.in"));
PrintWriter pw = new PrintWriter(new FileWriter("B.out"));
int X = Integer.parseInt(br.readLine());
for(int i=0; i<X; i++)
{
String[]... | import java.util.Scanner;
import java.util.TreeMap;
public class RecycledNumbers {
public static void main(String[]args){
Scanner sc = new Scanner(System.in);
//Read in the T int -- Test Cases
int T = Integer.parseInt(sc.nextLine());
for (int t = 1; t <= T; t++) {
int num = 0;
//START OF CODE
int a ... |
B21968 | B20458 | 0 | import java.util.*;
import java.io.*;
public class recycled_numbers {
public static void main(String[]a) throws Exception{
Scanner f = new Scanner(new File(a[0]));
int result=0;
int A,B;
String n,m;
HashSet<String> s=new HashSet<String>();
int T=f.nextInt(); //T total case count
for (int t=1; t<=T... | package net.anzix.learn.codejam.qr12;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
public class RecycledNumbers {
private Input... |
B20566 | B22047 | 0 | import java.util.Scanner;
import java.io.*;
import java.lang.Math;
public class C{
public static int recycle(String str){
String[] numbers = str.split(" ");
int min = Integer.parseInt(numbers[0]);
int max = Integer.parseInt(numbers[1]);
int ret = 0;
for(int i = min; i < max; i++){
String num = i + "";
... | package google.contest.C;
import google.loader.Challenge;
import google.problems.AbstractChallenge;
import java.util.HashSet;
import java.util.Set;
public class CChallenge extends AbstractChallenge implements Challenge {
private int B;
private int A;
private int num;
Set<String>pairs ;
public CChallenge(int nu... |
B12115 | B10117 | 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 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... |
A10996 | A11905 | 0 | import java.util.Scanner;
import java.io.*;
class dance
{
public static void main (String[] args) throws IOException
{
File inputData = new File("B-small-attempt0.in");
File outputData= new File("Boutput.txt");
Scanner scan = new Scanner( inputData );
PrintStream print= new PrintStream(outputData);
... | package 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)
{
... |
A21557 | A20532 | 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) ... | public class B
{
public static void main(String []args)
{
int j,c,i,T, N, S, P,maior,menor,soma;
java.util.Scanner sc = new java.util.Scanner(System.in);
T = sc.nextInt();
for (i = 0; i < T; i++)
{
c = 0;
N = sc.nextInt();
S = sc.nextInt();
... |
B12941 | B13170 | 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.Scanner;
import java.util.Arrays;
public class RecycleNums {
public static void main(String[] args) throws FileNotFoundException {
File input = new File(args[0]);
Scanner scan = new Scanner(input);
PrintStream output = new PrintStream(new File("C-small.out"));
i... |
B11318 | B11964 | 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.FileOutputStream;
import java.io.IOException;
import java.util.HashSet;
import java.util.Scanner;
public class Recycled {
public static void main(String[] args) throws IOException {
int T;
Scanner sc = new Scanner(System.in);
FileOutputStream out = new FileOutputStream("out.txt");
T = sc.nextI... |
A11135 | A10430 | 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 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; // åñëè êòî-òî áóäåò èñïîëüçîâàòü ýòè
// çíà÷åíèÿ
... |
B21752 | B21761 | 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.util.*;
public class Recycle {
public static int deg(int x) {
int i = 0;
while(x > 0) {x = x / 10; i++;}
return i;
}
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for(int t = 1; t <= T; t++) {
int A = sc.nextInt(), B ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.