F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
A20119 | A22638 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | package Qualification_Round_2012;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class B {
public static void main(String[] args) throws FileNotFoundException, IOExcep... |
B11696 | B11451 | 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.util.*;
import java.lang.Math;
public class RecycledNumbers {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int numCases, currentCase, A, B, n, m, answer, currentNum;
ArrayList<Integer> recycles;
numCases = scan.nextInt();
currentCase = 0;... |
B10245 | B10016 | 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.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
public class R1P3 {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
BufferedReader in = new BufferedReader(new FileReader("C-small-attempt0.in"));
BufferedWrite... |
A22771 | A22967 | 0 | package com.menzus.gcj._2012.qualification.b;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class BProcessorFactory extends AbstractProcessorFactory<BInput, BOutputEntry> {
public BProcessorFactory(Str... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
public class Dance {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseIn... |
B10149 | B10865 | 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 student;
import java.io.*;
import java.util.*;
public class test {
public static int getShift(String t, int pos)
{
int len = t.length()/2;
return Integer.parseInt(t.substring(pos,pos+len));
}
public static void main(String[] args) throws FileNotFoundException
{
Scanner fin = new Scanner(new ... |
A21396 | A20413 | 0 | import java.util.*;
public class Test {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int i = 1; i<=T; i++) {
int n = in.nextInt();
int s = in.nextInt();
int p = in.nextInt();
int result = 0;
for(int j = 0; j<n; j++){
... | package MyAllgoritmicLib;
public class NOD {
public static int gcd (int a, int b)
{
if (b == 0)
return a;
else
return gcd (b, a % b);
}
public static long gcd (long a, long b)
{
if (b == 0)
return a;
else
return gcd (b, a % b);
}
public static double gcd (double a, double b)
{
if (b =... |
A11135 | A12066 | 0 | /**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/3/12
* Time: 11:00 AM
* To change this template use File | Settings | File Templates.
*/
import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;
import java.io.*;
import java.util.*;
import java.uti... | import java.io.*;
import java.util.*;
public class DancingGooglers {
public static void main(String args[]) {
try {
String strFileName = args[0];
BufferedReader bfReader = new BufferedReader(new FileReader(strFileName));
long nTestCases = Integer.parseInt(bfReader.readLine());
for(int testCaseCounte... |
B10899 | B11151 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
public class ReadFile {
public static void main(... | import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
/**
*
*/
/**
* @author Anvesh
*
*/
public class C {
/**
* @param args
*/
public static void main(String[] args) {
try {
Scanner sc = new Scanner(System.in);
int caseNo = sc.nextInt();
... |
B11318 | B11914 | 0 | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
int casos=1, a, b, n, m, cont;
while(t!=0){
a=sc.nextInt();
b=sc.nextInt();
if(a>b){
int aux=a;
a=b;
b=aux;
}
System.out.printf("Case #%d: ",casos... | package qualificationround;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class ProblemCRecycledNumbers {
@Sup... |
B10149 | B12680 | 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.*;
public class recycled_numbers {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int T = scanner.nextInt();
int[] answers = new int[T];
for (int c = 0; c < T; c++) {
int A = scanner.nextInt();
int B = scanner.nextInt();
int numdigits;
... |
A11502 | A10396 | 0 | package template;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
public class TestCase {
private boolean isSolved;
private Object solution;
private Map<String, Integer> intProperties;
private Map<String, ArrayList<Integer>> intArrayProperties;
private Map<String, Arra... | package gcj_2012;
/**
* Time: 5:10:03 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 B {
static Scanner in;
static String path = "src/gcj_... |
A12273 | A10443 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Dancing
* Jason Bradley Nel
* 16287398
*/
import java.io.*;
public class Dancing {
public static void main(String[] args) {
In input = new In("input.txt");
int T = Integer.parseInt(input.... | import java.util.Scanner;
import java.io.*;
public class Prob2 {
public static void main(String[] args) throws IOException{
Scanner in = new Scanner(new File("D:/B-small-attempt0.in"));
PrintStream out = new PrintStream(new File("D:/outputProb2.txt"));
int lineAmount = Integer.parseInt(in.nextLine()... |
B12115 | B11707 | 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.*;
class Recycle
{
public static int[] combi = {0,0,1,3,6,10,16,21};
public static boolean[] bool;
public static int howMany(int x, int least, int greatest)
{
int rotate = x;
int pair = 1;
int i;
int j;
int dummy;
ArrayList<Integer> digit = new ArrayList<Integer>();
bool[rotate]=... |
A12570 | A11184 | 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 DataModel extends Thread {
private int googlersNo;
private int suprScore;
private int minScore;
private int[] googScore;
private int caseNo;
private int output;
private boolean stateCalc;
public DataModel(String input, int caseNo) {
this.caseNo = caseNo;
String[] temp = input.sp... |
A22078 | A20814 | 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.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.Scanner;
public class Main {
public static void main (String[] args) throws IOException {
Writer writer = new FileWriter("/home/a/dev/codejam-2012/B-submit.tx... |
B21790 | B20168 | 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 me.stapel.kai.google.codejam2012.quali;
import java.io.BufferedOutputStream;
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.OutputStreamWriter;
import java.util.Sort... |
A12113 | A12976 | 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.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintStream;
public class B {
public static void main(String[] args) throws NumberFormatException, IOException {
File file = new File(args[0]);
BufferedReader reader = new BufferedReader(new ... |
A20382 | A20413 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... | package MyAllgoritmicLib;
public class NOD {
public static int gcd (int a, int b)
{
if (b == 0)
return a;
else
return gcd (b, a % b);
}
public static long gcd (long a, long b)
{
if (b == 0)
return a;
else
return gcd (b, a % b);
}
public static double gcd (double a, double b)
{
if (b =... |
A13029 | A10862 | 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 score;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class Score1 {
public static void main(String[] args)throws IOException {
File file = new File("B-small-attempt0.in");
BufferedWri... |
B11361 | B11091 | 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 codejam;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.PrintWriter... |
A12570 | A10502 | 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 dom.zar.jam.qualifications;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class DancingWithTheGooglers {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int inputLines = in.nextInt();
for (int i = 0; i < inputLines;) {
int googlers... |
B10245 | B10345 | 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.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
public class C {
public final String INPUT_FILE_NAME = "c_in";
pub... |
A10996 | A11721 | 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);
... | public class CodeJamLineParser {
private final String[] tokens;
private int position;
public CodeJamLineParser(String line) {
tokens = line.split("\\s");
position = 0;
}
public boolean hasNextField() {
return hasNextFields(1);
}
public int remainingFields() {
return tokens.length - position;
}
... |
B11421 | B13264 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Recycled {
public static void main(String[] args) throws Exception{
String inputFile = "C-small-attempt0.in... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
public class Recycled {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
BufferedReader br = new BufferedReader(new InputStreamReader(System... |
B10899 | B10868 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
public class ReadFile {
public static void main(... |
import java.io.*;
import java.util.*;
class C{}
public class Recycle {
static Scanner scan;
static PrintWriter writer;
public static void readProcessOutput() throws Exception{
String outputStr = ""; String result = "";
int index = 1;
int testCases = Integer.parseInt(scan.nextLine());
//-------
... |
A22191 | A20577 | 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 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... |
B12570 | B12980 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | import java.io.BufferedReader;
import java.io.IOException;
import java.util.ArrayList;
public class TestCaseReader {
public ArrayList<String> read(BufferedReader r) throws NumberFormatException, IOException
{
ArrayList<String> s = new ArrayList<String>();
int n = Integer.parseInt(r.readLine());
for (int i =... |
B20734 | B20943 | 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.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class ProblemC {
public static void main(String[] args) {
try (BufferedReader reader = ne... |
B12085 | B10822 | 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.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.S... |
A22992 | A21619 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author dannocz
*/
public class InputReader {
public static Input r... | import java.util.*;
public class Main {
public static void main(String args[]) {
(new Main()).solve();
}
void solve() {
Scanner cin = new Scanner(System.in);
int T = cin.nextInt();
for(int C=1; C<=T; ++C) {
int N = cin.nextInt();
int S = cin.nextInt();
int P = cin.nextInt()... |
A20490 | A22635 | 0 | /**
*
*/
package hu.herba.codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io... | import java.io.File;
import java.io.PrintWriter;
import java.util.Locale;
import java.util.Scanner;
public class B {
final static String PREFIX = "C:\\codejam\\B";
// final static String FILE_NAME = PREFIX + "-test";
// final static String FILE_NAME = PREFIX + "-small-attempt0";
final static String FILE_NAME = PR... |
B10245 | B11177 | 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.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashSet;
public class RecycleNumber {
public static void solution(String fileName) throws IOException {
FileReader fileReader = new FileReader(new File(fileName));
BufferedReader bufferedRe... |
B20023 | B21106 | 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 google.codejam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.Set;
import java.util.TreeSet;
public class Problem3 {
public Problem3() {
super();
}
public static void main(String[] args) {
try {... |
B21752 | B20909 | 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 ... | /**
* Copyright 2012 Christopher Schmitz. All Rights Reserved.
*/
package com.isotopeent.codejam.lib;
public interface InputConverter<T> {
boolean readLine(String data);
T generateObject();
}
|
B21049 | B21831 | 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 qualification;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Scanner;
public class C {
public static void main(String[] Args) throws IOException {
Scanner sc = new Scanner... |
A10793 | A11102 | 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.util.*;
public class ProblemB {
/*
* Takes an input file and output file as inputs.
*/
public static void main(String file[]) throws IOException{
BufferedReader in;
BufferedWriter out;
int numCases, numGooglers, numSurp, p, score;
Integer result;
... |
B12762 | B12742 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.File;
import java.io.FileInputStream;
import java.util.Scanner;
/**
*
* @author imgps
*/
public class C {
public static void main(String args[]) throws Exception{
int A,B;
int ctr ... | import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
import java.util.TreeSet;
public class CJ_2012_Q_C {
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(new File("cj_files/in"));
FileWriter w = new FileWriter(new File("cj_fi... |
A11277 | A12240 | 0 | package googlers;
import java.util.Scanner;
import java.util.PriorityQueue;
import java.util.Comparator;
public class Googlers {
public static void main(String[] args) {
int n,s,p,count=0,t;
Scanner sin=new Scanner(System.in);
t=Integer.parseInt(sin.nextLine());
int result[]=new int[t];
int ... | import java.io.*;
import java.util.*;
class ProblemB
{
public static void main(String[] args)
{
try{
// Open the file that is the first
// command line parameter
FileInputStream fstream = new FileInputStream("input.txt");
BufferedWriter out = new BufferedWriter(new FileWriter("output.txt"));
// G... |
B11421 | B11367 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package qualc;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
/**
*
* @author marcin
*/
public class QualC {
/**
* @param args the command line arguments
*/
public stati... |
B11421 | B10289 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Recycled {
public static void main(String[] args) throws Exception{
String inputFile = "C-small-attempt0.in... | import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
public class C {
static int[] tens = { 1, 10, 100, 1000, 10000, 100000, 1000000 };
static HashSet<Integer> set = new HashSet<Intege... |
A13029 | A11690 | 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.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();
... |
B20856 | B21711 | 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.IOException;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
public class Recycled {
static int n = 1;
static void solve(int A, int B) {
int len = ("" + A).length();
int min = 1;
for (int a = 1; a < len; a++)
min *= 10;
int res = 0;
int[] seen = new int[len];
... |
B11318 | B12459 | 0 | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
int casos=1, a, b, n, m, cont;
while(t!=0){
a=sc.nextInt();
b=sc.nextInt();
if(a>b){
int aux=a;
a=b;
b=aux;
}
System.out.printf("Case #%d: ",casos... | package cg.y2012.Q3;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
public class Q3 {
/**
* @param args
*/
public static void main(String[] args) {
BufferedWrit... |
B12074 | B11487 | 0 | package jp.funnything.competition.util;
import java.math.BigInteger;
/**
* Utility for BigInteger
*/
public class BI {
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger add( final BigInteger x , final BigInteger y ) {
return... | import java.io.File;
import java.util.HashSet;
import java.util.Scanner;
public class recyle {
public static int solve(String s) {
String[] input = s.split(" ");
String a = input[0];
String b = input[1];
if (a.length() != b.length()) return 0;
if (Integer.parseInt(b) <= 10) return 0;
int r... |
A11917 | A12381 | 0 | package com.silverduner.codejam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
public class Dancing {
public static void main(String[] args) throws Exception {
File input = new File("B-small-attempt... | import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.*;
public class SurpScores {
public int count(int[] scores, int p, int surprises) {
int countSurp = 0;
int countNonSurp = 0;
int minSurpScore = p + (p-2) + (p-2);
int minNon... |
A21396 | A22583 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class B {
public static void main(String[]args)throws Exception {
File f = new File(args[0]);
File out = new File(f.getParentFile(), f.getName()+".out");
Buff... |
B10485 | B10053 | 0 |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class Recycle
{
public static void main(String[] args)
{
/* Set<Integer> perms = getPermutations(123456);
for(Integer i: p... |
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Recycle2 {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
Scanner in = new Sc... |
A12460 | A11052 | 0 | /**
*
*/
package pandit.codejam;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Scanner;
/**
* @author Manu Ram Pandit
*
*/
public class DancingWithGoogle... | import java.io.*;
import java.util.*;
public class B {
BufferedReader ins;
PrintStream outs;
static String INPUT = "B-small-attempt0.in";
static String OUTPUT;
static {
OUTPUT = "B.out";
}
public B(BufferedReader ins, PrintStream outs) {
this.ins = ins;
this.outs ... |
A22191 | A21947 | 0 | package com.example;
import java.io.IOException;
import java.util.List;
public class ProblemB {
enum Result {
INSUFFICIENT,
SUFFICIENT,
SUFFICIENT_WHEN_SURPRISING
}
public static void main(String[] a) throws IOException {
List<String> lines = FileUtil.getLines("/B-large.in");
int cases = Int... | import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
public class Main {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
if(args.length != 1) {
return;
}
FileInputStream inputStream = new ... |
B11318 | B12456 | 0 | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
int casos=1, a, b, n, m, cont;
while(t!=0){
a=sc.nextInt();
b=sc.nextInt();
if(a>b){
int aux=a;
a=b;
b=aux;
}
System.out.printf("Case #%d: ",casos... | import java.io.*;
import java.util.StringTokenizer;
public class klick
{
public static void main(String []args)
{
try{
FileInputStream fstream = new FileInputStream("input.in");
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedRe... |
A10568 | A10346 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader (new... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Arrays;
import java.util.StringTokenizer;
public class B {
/**
* @param args
* @throws IOException
*/
public st... |
B20734 | B21868 | 0 | package fixjava;
public class StringUtils {
/** Repeat the given string the requested number of times. */
public static String repeat(String str, int numTimes) {
StringBuilder buf = new StringBuilder(Math.max(0, str.length() * numTimes));
for (int i = 0; i < numTimes; i++)
buf.append(str);
return buf.toStr... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.util.*;
import java.math.*;
/**
*
* @author .
*/
public class C {
public static class Num {
int number;
String num;
ArrayList<Integer> recycled;
Num(int number) {
... |
B10899 | B10215 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
public class ReadFile {
public static void main(... | import java.io.*;
public class gcj3 {
static int T;
static int AB[][];
static void beolvas (String f) throws IOException {
BufferedReader be = new BufferedReader(new FileReader(f));
String sor = be.readLine();
T = Integer.parseInt(sor);
AB = new int[T][2];
for (int i = 0; i < T; i++) {
sor = be.readL... |
B13196 | B10108 | 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.*;
public class Main
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
Integer numCases = Integer.parseInt(in.nextLine());
for (int k = 0; k < numCases; k++)
{
Integer num1 = Integer.parseInt(in.next());
int num2 = Integer.parseInt(in... |
B21752 | B22209 | 0 | package Main;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
/**
* Created with IntelliJ IDEA.
* User: arran
* Date: 14/04/12
* Time: 3:12 PM
* To change ... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.u... |
B12082 | B10179 | 0 | package jp.funnything.competition.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.apache.commons.io.IOUtils;
public class QuestionReader {
pr... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gjam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
/**
*
* @author iNahoo
*/
public cla... |
A12113 | A11774 | 0 | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class B {
static int[][] memo;
static int[] nums;
static int p;
public static void main(String[] args)throws IOException
{
Scanner br=new Scanner(new File("B-small-attempt0.in"... | import java.util.*;
public class b {
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
int t = input.nextInt();
for(int T = 1; T <= t; T++)
{
System.out.print("Case #" + T + ": ");
int n = input.nextInt();
int s = input.nextInt();
int p = input.nextInt();
int[] data = new in... |
B21790 | B20226 | 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 bsevero.codejam.qualification;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumbers {
private static Set<String> FOUND_PAIRS = new HashSet<String>();
public static int recycle(String minStr, String maxStr) {
FOUND_PAIRS = new HashSet<String>();
int min = Integer.valueOf(minStr... |
A11201 | A11606 | 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.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
... |
A20490 | A20055 | 0 | /**
*
*/
package hu.herba.codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package google.code.jam.dancing.with.the.googlers;
import java.util.ArrayList;
/**
*
* @author Lucas
*/
public class BestResultFinder {
public ArrayList<Integer> findBestResult(ArrayList<ArrayList> list) {
... |
B10231 | B11707 | 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.*;
class Recycle
{
public static int[] combi = {0,0,1,3,6,10,16,21};
public static boolean[] bool;
public static int howMany(int x, int least, int greatest)
{
int rotate = x;
int pair = 1;
int i;
int j;
int dummy;
ArrayList<Integer> digit = new ArrayList<Integer>();
bool[rotate]=... |
B20856 | B21838 | 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.FileNotFoundException;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Scanner;
import java.util.TreeSet;
public class RecycleNumber {
private static TreeSet<String> result = new TreeSet<String>();
private static Hashtable<Integer, Integer> resultingStrin... |
A22378 | A22791 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class CodeJam {
// public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt";
public static final String INP... | package google.loader;
public interface Challenge {
String getResult();
}
|
A22360 | A20836 | 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 DanceScore
{
int score;
boolean surprise = false;
boolean madeIt = false;
public DanceScore(int score)
{
this.score = score;
}
private void p(String p)
{
//System.out.println(p);
}
public void process(int bestResult)
{
int goal = bestResult-2;
... |
A11502 | A11492 | 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.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
public class CodeJam_B {
public static void main(String[] args){
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
try{
String cou... |
A22992 | A21035 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author dannocz
*/
public class InputReader {
public static Input r... |
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.StringTokenizer;
public class Dance {
private String strLine;
priva... |
B10361 | B11088 | 0 | package codejam;
import java.util.*;
import java.io.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("in.txt"));
PrintWriter out = new PrintWriter(new File("out.txt"));
int T = Integer.parseInt(in.readLine());... | package fixjava;
import java.util.ArrayList;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import fixjava.ParallelWorkQueue.CallableFactory;
public class ParallelWorkQueueTest {
/**
* @param args
*/
public static void main(String[] ... |
A12570 | A10157 | 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 Triplet {
private int fFirst;
private int fSecond;
private int fThird;
public Triplet( int aFirst, int aSecond, int aThird ) {
fFirst = aFirst;
fSecond = aSecond;
fThird = aThird;
}
public boolean isSurprising() {
if( Math.abs( fFirst - fSecond ) >= 2 ) {
re... |
B12085 | B12510 | 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.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.SortedSet;
import java.util.TreeSet;
public final class Recy... |
A20934 | A22957 | 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 googleCodeJam;
import static java.lang.System.out;
import java.io.BufferedReader;
import java.io.FileReader;
public class DancingWithTheGooglers {
private static final int MAXN = 128;
private static int inc0(int num, int p) {
if (num == 0) {
return (p == 0) ? 1 : 0;
}
int t = num / 3... |
B21752 | B21174 | 0 | package Main;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
/**
* Created with IntelliJ IDEA.
* User: arran
* Date: 14/04/12
* Time: 3:12 PM
* To change ... | import java.io.File;
import java.io.FileNotFoundException;
import java.util.Formatter;
import java.util.HashSet;
import java.util.Scanner;
public class RecycledNumbers {
private static String solve(int A, int B) {
int count = 0;
final HashSet<Integer> seen = new HashSet<Integer>(10);
for (int n = A; n < B; n++... |
B20023 | B22065 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
public class GoogleC {
public String szamol(String input){
String result="";
String... | import java.io.* ;
import java.text.DecimalFormat;
import java.util.*;
import static java.lang.Math.* ;
import static java.util.Arrays.* ;
public class C {
public static void main(String[] args) throws FileNotFoundException {
in = new Scanner(new InputStreamReader(new FileInputStream("c_in.txt")));
out = new... |
A20490 | A22162 | 0 | /**
*
*/
package hu.herba.codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io... | import java.util.*;
import java.io.*;
import java.text.*;
import java.math.*;
public class DancingWithTheGooglers {
public static BufferedReader BR;
public static String readLine() {
try {
return BR.readLine();
} catch(Exception E) {
System.err.println(E.toString());
... |
B11421 | B11694 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Recycled {
public static void main(String[] args) throws Exception{
String inputFile = "C-small-attempt0.in... | import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
Scanner inputFile = new Scanner(new InputStreamReader(System.in));
String inputLine = null;
String[] numberArray;
int testCaseCount = 0;
int startNum... |
B11696 | B11695 | 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.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
/** Main function is "solve" **/
public class CodeJamProblem3 {
static HashMap<String, St... |
B21270 | B21586 | 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... | /*************************************************************************
* Compilation: javac In.java
* Execution: java In
*
* Reads in data of various types from: stdin, file, URL.
*
* % java In
*
* Remarks
* -------
* - isEmpty() returns true if there is no more input or
* it is all whi... |
A22360 | A20603 | 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 com.snap.training;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
public class DancingGooglers {
public static ArrayList<String> readFromFile()
{
ArrayList<String> inputList = new... |
B11318 | B12687 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
public class Problema3 {
static int caso=0;
static int valor=0;
static String output="";
static String thisline="";
static String file... |
B21049 | B20590 | 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 be.mokarea.gcj.common;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.io.Writer;
public abstract class GoogleCodeJamBase<T extends TestCase> {
protected abstract Transformation<T> createTransformation(TestCaseReader<T> testCaseReader, PrintWriter outputWriter) throws Exception;
protecte... |
A20934 | A21194 | 0 | import java.util.*;
public class B {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
B th = new B();
for (int i = 0; i < T; i++) {
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt()... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintStream;
public class round1 {
/**
* @param args
*/
static BufferedReader openRead(String fileName){
BufferedReader in = null;
try {
... |
A22771 | A21673 | 0 | package com.menzus.gcj._2012.qualification.b;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class BProcessorFactory extends AbstractProcessorFactory<BInput, BOutputEntry> {
public BProcessorFactory(Str... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Ex2 {
public static void mai... |
B10702 | B10139 | 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.*;
import java.util.*;
public class ProblemC {
public static void main(String[]args) {
Scanner f = new Scanner(System.in);
int T = f.nextInt();
for(int set=0;set<T;set++) {
int A = f.nextInt();
int B = f.nextInt();
int b = B;
int leadingMult = 1;
while(b >= 10) {
... |
B10899 | B12630 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
public class ReadFile {
public static void main(... |
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class UtilGoogle {
public static Scanner readFile(String path) throws FileNotFoundException{
File in = new File(path);
Scanner s = new S... |
A11201 | A13189 | 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.*;
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(... |
B20006 | B20184 | 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 {
... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
//package codejam.practice;
/**
*
* @author Saikat Roy
*/
import java.io.*;
public class Main2 {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
public void input() throws IOExce... |
A10699 | A11203 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Dancing {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) ... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package competition;
/**
*
* @author Sriram
*/
import java.util.Scanner;
import java.io.FileInputStream;
import java.io.PrintStream;
public class DancingWithGooglers_GCJ_2012 {
public static void main(Stri... |
B12669 | B10278 | 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 gcj_qr2012_a;
import java.io.File;
import java.io.FileNotFoundException;
/**
*
* @author Fidel
*/
public class qr_problemB {
public static void main(String args[]) throws FileNotFoundException{
File f = new File("input.txt");
java.util.Scanner sc = new java.util.Scanner(f);
int ... |
A20261 | A21895 | 0 | package com.gcj.parser;
public class MaxPoints {
public static int normal(int value){
int toReturn = 0;
switch (value) {
case 0 : toReturn = 0 ; break;
case 1 : toReturn = 1 ; break;
case 2 : toReturn = 1 ; break;
case 3 : toReturn = 1 ; break;
case 4 : toReturn = 2 ; break;
case 5 : toReturn = 2 ; b... | import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
public class Prob2 {
public static void main(String[] args) throws NumberFormatException, IOException {
String filePath = "C://Users//Apoorv//Downloads//B-la... |
A22078 | A20768 | 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.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.*;
public class B implements Runnable{
public s... |
A22378 | A20125 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class CodeJam {
// public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt";
public static final String INP... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package googlecodejam;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
/**
*
* @author Muhammad Zahran
*/
public class Goo... |
A20934 | A20873 | 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()... |
/**
* Name: Shivam99
* email: shivthedestroyer99@gmail.com
*/
import java.io.*;
public class ProblemB
{
public static void main(String[] args) throws IOException{
FileReader fr=new FileReader(args[0]);
BufferedReader br=new BufferedReader(fr);
String str=br.readLine();
int t=In... |
B21207 | B20512 | 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.HashSet;
import java.util.Scanner;
public class recycled {
public static void main(String[] args){
int t;
Scanner s = new Scanner(System.in);
t=s.nextInt();
for(int k=1;k<=t;k++){
int a,b;
a=s.nextInt();
b=s.nextInt();
int al=a/10,d=1;
while(al>0){
d++;
al/=10;
}
... |
A12846 | A11962 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam.common;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Lance Chen
*/
public class CodeHelper {
private static String FILE_ROOT = "D:/workspace/googlecodejam/meta";
publi... | import java.lang.*;
import java.util.*;
import java.io.*;
public class B
{
public static void main(String[] args) throws Exception
{
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
int T = Integer.parseInt(bf.readLine());
for (int i = 0; i < T; ++i) {
int N = 0, S = 0, p = 0;
St... |
A11201 | A10216 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj.base;
import java.util.regex.Pattern;
/**
*
* @author jalves
*/
public class ProbB {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
n... |
A11502 | A11178 | 0 | package template;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
public class TestCase {
private boolean isSolved;
private Object solution;
private Map<String, Integer> intProperties;
private Map<String, ArrayList<Integer>> intArrayProperties;
private Map<String, Arra... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package leider.ken;
import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
/**
*
* @author ken
*/
public class Danc... |
A11135 | A12318 | 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.atama.google.jam.dancing;
public class ScoreCalculator {
private final Show show;
public ScoreCalculator(int numSurprises, int scoreThreshold,
int[] totalScores) {
Context.INSTANCE.setNumSurprises(numSurprises);
Context.INSTANCE.setThreshold(scoreThreshold);
show = new Show(totalScores);
... |
B12669 | B11190 | 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 com.google;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
public class Recycle {
public static class Pair {
lon... |
A20934 | A22133 | 0 | import java.util.*;
public class B {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
B th = new B();
for (int i = 0; i < T; i++) {
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt()... | import java.util.Scanner;
public class Test {
public static void main(String[] args) {
int cases, num, sur, p;
int[] googlers;
Scanner sin = new Scanner(System.in);
int[] ans;
cases = sin.nextInt();
ans = new int[cases];
for (int i = 0; i < cases; i++) {
int count = 0;
int couSur = 0;
int cent... |
B10361 | B12381 | 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.util.*;
public class RecycledNums
{
static Scanner cin = new Scanner(System.in);
public static void main(String[] args)
{
String out = "";
System.out.println("GO");
int repeat = cin.nextInt();
cin.nextLine();
int ans=0;
for(int i = 0; i < repe... |
A22992 | A20928 | 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;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
public class ProblemaB {
static String caminho = "/home/mateus/";
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(new File(caminho + "entrada.txt"));
FileWrit... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.