F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
B20424 | B20723 | 0 | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
// static int MAX = 10000;
static int MAX = 2000000;
static Object[] All = new Object[MAX+1];
static int size( int x ) {
if(x>999999) return 7;
if(x>99999) return 6;
if(x>9999) return 5;
if(x>999) retu... | package recycled;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException {
File file = new File("C-large.in");
FileReader fr = new FileReader(file);
BufferedReader in = new Buffere... |
B12074 | B10836 | 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 codejam;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
public class RecycledNumbers {
private StreamTokenizer in;
private PrintWriter out;
// private Set<Chain> map = new HashSet<... |
B12115 | B11199 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class RecycledNumbers {
... |
B12115 | B12375 | 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 qualif3;
import java.io.File;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Qualif3 {
public static void main(String[] args) throws Exception {
Scanner scan = new Scanner(new File("input"));
int num = Integer.parseInt(scan.nextLine());
for (int i = 1;... |
A11917 | A12754 | 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.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class ProblemB {
public static void main(String[] args) throws FileNotFoundException {
// TODO Auto-generated method stub
Scanner scanner = new Scanner(new File("/Use... |
A22642 | A21922 | 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 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... |
A10996 | A12691 | 0 | import java.util.Scanner;
import java.io.*;
class dance
{
public static void main (String[] args) throws IOException
{
File inputData = new File("B-small-attempt0.in");
File outputData= new File("Boutput.txt");
Scanner scan = new Scanner( inputData );
PrintStream print= new PrintStream(outputData);
... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.PrintStream;
public class Solver {
protected final static String IN_FILE = "in";
protected final static String OUT_FILE = "out";
protected final static String OUT_PREFIX = "Case #$: ";
protected BufferedReader in;
pro... |
A12544 | A11541 | 0 | package problem1;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Arrays;
public class Problem1 {
public static void main(String[] args) throws FileNotFoundException, IOException{
try {
TextIO... | import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;
public class DancingWithGooglers {
public static void main(String[] args) throws FileNotFoundException {
int cases;
Scanner scan = new Scanner(new File("B.small.in"));
cases = scan.nextInt();
... |
A13029 | A10209 | 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.*;
public class gcj2 {
static int T; // tesztesetek száma
static int N[]; // Googlerek számai
static int S[]; // meglepŠtripletek száma
static int p[]; // pék
static int total[][]; // összpontszámok
static int tripletek[][];
static void beolvas (String f) throws IOException {
Buffer... |
A20934 | A22152 | 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 codejam2012;
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.Arrays;
import java.util.Hashtable;
import java.util.Scanner;
public class DancingWithGooglers {
public st... |
B11421 | B13259 | 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 info.stephenn.codejam2012.qualify;
import java.util.Scanner;
public class C {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int cases = sc.nextInt();
for (int caseX=1; caseX <= cases; caseX+=1){
int A = sc.nextInt();
int B = sc.nextInt();
System.out.println("Case... |
B20006 | B21747 | 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 com.google.codejam;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
public class RecycledNumbers {
public static void main(String argsp[]) throws NumberFormatException, IOException{
BufferedReader br = ne... |
A20490 | A22279 | 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.FileNotFoundException;
import java.util.Scanner;
import java.util.StringTokenizer;
public class codeJam2 {
public static void main(String[] args) throws FileNotFoundException {
//System.out.print("input.txt");
Scanner input = new Scanner(new File("input.txt"));
String Do... |
B11421 | B11525 | 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.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;
import java.util.HashSet;
public class Main {
/**
* @param arg... |
B11421 | B11306 | 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... | /**
* 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... |
B12941 | B11926 | 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.*;
class RecycledNumbers {
public static void main(String[] args)
throws Exception {
new RecycledNumbers().start();
}
void start()
throws Exception {
InputStreamReader is =
new InputStreamReader(
... |
A22642 | A21088 | 0 | import java.util.*;
import java.io.*;
public class DancingWithTheGooglers
{
public DancingWithTheGooglers()
{
Scanner inFile = null;
try
{
inFile = new Scanner(new File("inputB.txt"));
}
catch(Exception e)
{
System.out.println("Problem ope... | import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import java.io.FileWriter;
public class DancingWithTheGooglers {
public static void main(String... args) {
try {
File f = new File("B-large.in");
File outFile = new File("output.txt");
FileWriter w = new FileW... |
B10858 | B11485 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| import java.lang.*;
import java.io.*;
import java.util.*;
public class rotate{
public static void main(String args[])throws Exception{
int i,j,k,m;
int n_test_case;
FileInputStream fin = new FileInputStream("C-small-attempt0.in");
DataInputStream in = new DataInputStream(fin);
BufferedReader br = new BufferedReader(... |
A21557 | A21578 | 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) ... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package uk.co.epii.codejam.common;
/**
*
* @author jim
*/
public interface Processor {
public String processLine(String line);
}
|
A10793 | A13001 | 0 | import java.io.*;
import java.math.*;
import java.util.*;
import java.text.*;
public class b {
public static void main(String[] args) {
Scanner sc = new Scanner(new BufferedInputStream(System.in));
int T = sc.nextInt();
for (int casenumber = 1; casenumber <= T; ++casenumber) {
... | package qualification.q2;
/**
* Created by IntelliJ IDEA.
* User: ofer
* Date: 14/04/12
* Time: 18:47
* To change this template use File | Settings | File Templates.
*/
public class Q2Solver {
public int solve(int n,int s,int p, int[] sums){
int res = 0;
int surprisesLeft = s;
... |
A22771 | A22811 | 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.FileWriter;
import java.io.IOException;
public class OutputPrinter {
public OutputPrinter()
{
try {
m_writer = new FileWriter("C:/AHK/output.txt");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
FileWriter m_writer;
int m_case = 1;
public vo... |
A11277 | A10110 | 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 org.alaoui.googledance;
public class Dancer {
private int totalScore;
private Integer maxOrdinaryScore;
private Integer maxSurprisingScore;
public Dancer(int totalScore) {
this.totalScore = totalScore;
computeMaxScores();
}
private void computeMaxScores() {
int mod = totalScore % 3;
int floo... |
A20261 | A20260 | 0 | package com.gcj.parser;
public class MaxPoints {
public static int normal(int value){
int toReturn = 0;
switch (value) {
case 0 : toReturn = 0 ; break;
case 1 : toReturn = 1 ; break;
case 2 : toReturn = 1 ; break;
case 3 : toReturn = 1 ; break;
case 4 : toReturn = 2 ; break;
case 5 : toReturn = 2 ; b... | package com.gcj.parser;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;
public class Parser {
private String inputFileDest;
private FileInputStream fileInputStream;
public Parser(String inputFileDest) {
super();
... |
A11502 | A12568 | 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.IOException;
import java.util.*;
public class AlienLanguage extends JamProblem {
private int wordsC;
private int wordsL;
List<String> words = new ArrayList<String>();
TreeNode startNode;
public static void main(String[] args) throws IOException {
AlienLanguage p = new AlienL... |
B10149 | B12927 | 0 | import java.io.FileInputStream;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeSet;
// Recycled Numbers
// https://code.google.com/codejam/contest/1460488/dashboard#s=p2
public class C {
private static String process(Scanner in) {
int A = in.nextInt();
int B = in.nextInt();
int res =... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam2012;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Scanner;
/**
*
* @author Luis Sergio Curay
*/
public class c {
public c() {
Scann... |
A21010 | A21616 | 0 | package codejam;
import fixjava.Pair;
public class Utils {
public static long minLong(long firstVal, long... otherVals) {
long minVal = firstVal;
for (int i = 0; i < otherVals.length; i++)
minVal = Math.min(firstVal, otherVals[i]);
return minVal;
}
public static int minInt(int firstVal, int... otherVals... | package codejam.network172.com;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class CodeJam {
public static void main(String[] args) {
try {
BufferedReader in = new Buffer... |
B11696 | B10475 | 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.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int[] array = new int[n];
for (int i = 0; i < n; i++) {
int min = scan.nextInt();
int max = scan.nextInt();
int total = 0;
for (int j = ... |
A20490 | A22694 | 0 | /**
*
*/
package hu.herba.codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io... | package google.codejam;
public interface GoogleSolver {
String solve(String str);
}
|
B10485 | B11211 | 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.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
public cl... |
B21270 | B20523 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package RecycledNumbers;
import java.io.File;
import java.io.FileWriter;
import java.io.Writer;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
/**
*
* @author Rishabh
*/
public class R... |
A22378 | A20119 | 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 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,... |
A10996 | A12203 | 0 | import java.util.Scanner;
import java.io.*;
class dance
{
public static void main (String[] args) throws IOException
{
File inputData = new File("B-small-attempt0.in");
File outputData= new File("Boutput.txt");
Scanner scan = new Scanner( inputData );
PrintStream print= new PrintStream(outputData);
... | import java.io.*;
class Programa
{
static boolean alcanza2(int a,int b)
{
int j1=0,j2=0,j3=0;
for (int i=0;i<=30;i++)
{
if (i+(i+2)+(i+2)==a)
{
j1=i;
j2=i+2;
j3=i+2;
}
if (i+i+(i+2)==a)
{
j1=i;
j2=i+2;
j3=i;
}
if (i+(i+1)+(i+2)==a)
... |
A22992 | A20975 | 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 fixjava;
/**
* Convenience class for declaring a method inside a method, so as to avoid code duplication without having to declare a new method
* in the class. This also keeps functions closer to where they are applied. It's butt-ugly but it's about the best you can do in
* Java.
*/
public interface Lamb... |
A13029 | A12383 | 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.*;
import java.math.*;
public class DancingWithTheGooglers {
public static void main (String args[]) throws Exception {
Scanner scan = new Scanner(System.in);
int T = scan.nextInt();
for (int i = 1; i <= T; i++){
int N = scan.nextInt();
int S = scan.nextInt();
... |
B10155 | B10377 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
/**
*
* @author eblanco
*/
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
impo... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class Recyc... |
A11277 | A11015 | 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 fixjava;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
/**
* Pair: typed 2-tuple
*/
public class Pair<L, R> {
private final L left;
private final R right;
p... |
A12273 | A10446 | 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.... | /*
a = y b = n c = f d = i e = c f = w g = l h = b i = k j = u k = o l = m m = x n = s o = e
p = v q = z r = p s = d t = r u = j v = g w = t x = h y = a z = q
*/
import java.util.*;
public class Dancing {
public static void main(Strin... |
B21752 | B21021 | 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 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... |
A21396 | A21576 | 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++){
... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package uk.co.epii.codejam.common;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author jim
*/
public class FileLoader {
public F... |
A22191 | A21965 | 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.*;
/**
* Created with IntelliJ IDEA.
* User: Frederick
* Date: 4/14/12
* Time: 8:36 AM
* To change this template use File | Settings | File Templates.
*/
public class DancingWithTheGooglers {
private static int solve(int number, int surprising, int p, int[] totalPoints) {
int count = ... |
A12544 | A12614 | 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 qualifications2012;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.util.Scanner;
public class GoogleDancers {
public static void main(String[] args) throws FileNotFoundException {
Scanner in = new Scanner(new File("input.txt... |
B11696 | B10097 | 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... | package se.round1.problem3;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import se.round1.util.JamUtil;
public cla... |
A21010 | A21954 | 0 | package codejam;
import fixjava.Pair;
public class Utils {
public static long minLong(long firstVal, long... otherVals) {
long minVal = firstVal;
for (int i = 0; i < otherVals.length; i++)
minVal = Math.min(firstVal, otherVals[i]);
return minVal;
}
public static int minInt(int firstVal, int... otherVals... | import java.io.*;
import java.util.Arrays;
import java.util.NoSuchElementException;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*/
public class Main {
public static void main(String[] args) {
InputStream inputStream;
try {
inputStream = new FileInputStream("module/src/b.in");
} catch... |
B10361 | B11649 | 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 com.codejam.two12.RecyledNumbers;
import java.util.HashSet;
import com.jp.common.Puzzle;
public class RecycledNumbers implements Puzzle {
private HashSet<Integer> checkedElementSet = new HashSet<Integer>();
private HashSet<Pair> ListOfPairs = new HashSet<Pair>();
private int startNumber;
private int... |
A22191 | A22345 | 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.BufferedWriter;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.Arrays;
public class Dancing {
/**
*... |
A20382 | A21576 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package uk.co.epii.codejam.common;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author jim
*/
public class FileLoader {
public F... |
B13196 | B12935 | 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 QualC
{
public static void main(String args[])
{
Scanner kb = new Scanner(System.in);
int ntc = kb.nextInt();
for(int tc=0;tc<ntc;tc++)
{
int out = 0;
int a = kb.nextInt();
int b = kb.nextInt();
for(int n=a;n<b;n++)
{
int temp = n;
int nn =... |
B12085 | B10298 | 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... | package gcj;
import java.io.BufferedReader;
import java.io.FileReader;
public class Gcj {
private static final String path = "/home/me/dev/gcj/";
private BufferedReader br = null;
private String[] tokens;
private int itoken,ntokens;
static public void err(String e) {
System.out.println("\n**\n"+e+" :-)\n");
... |
B10702 | B12102 | 0 | import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Recycle {
private static HashMap<Integer, HashSet<Integer>> map = new HashMap<Integer, HashSet<Integer>>();
private static HashSet<Integer> toSkip = new HashSet<Integer>();
/**
* @param args
*/
public static void main(S... | import java.util.Scanner;
import java.io.*;
public class Recycled {
public static void main(String[] args) throws FileNotFoundException, IOException {
Scanner input = new Scanner(new File(args[0]));
Scanner lin;
int lines = 0;
if (input.hasNextInt()) {
lines = input.nextInt();
input... |
B21207 | B21995 | 0 | /*
* Problem C. Recycled Numbers
*
* Do you ever become frustrated with television because you keep seeing the
* same things, recycled over and over again? Well I personally don't care about
* television, but I do sometimes feel that way about numbers.
*
* Let's say a pair of distinct positive integers (n, m) ... |
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.StringTokenizer;
public class Recycle
{
static String shiftRight( String s )
{
String res = "" + s.charAt(... |
B10231 | B12375 | 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 qualif3;
import java.io.File;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Qualif3 {
public static void main(String[] args) throws Exception {
Scanner scan = new Scanner(new File("input"));
int num = Integer.parseInt(scan.nextLine());
for (int i = 1;... |
B12082 | B11737 | 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.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
class Pair<L,R> {
private final L left;
private final R right;
public Pair(L left, R right) {
this.left = left;
this.right = right;
}
public L getLeft() { return left; ... |
A22078 | A22901 | 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.awt.datatransfer.StringSelection;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
/**
* Created by IntelliJ IDEA.
* User: ÐмиÑÑий
* Date: 14.04.12
* Time: 16:41
* To c... |
A22191 | A20530 | 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.FileReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
static int N,S,p;
static int t[];
static int solve() {
int i,j,k;
int a,b,c;
int opt[][] = new int[N+1][S+1];
boolean canMakeOne, goodScoreCase... |
B20734 | B20547 | 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... | public class Main {
public static void main(String[] args) throws java.io.FileNotFoundException,java.io.IOException{
java.io.BufferedReader bRead=new java.io.BufferedReader(new java.io.FileReader("F:\\C-large.in"));
java.io.BufferedWriter bWrite=new java.io.BufferedWriter(new java.io.FileWriter("F:\\C-large.out"))... |
A22771 | A23079 | 0 | package com.menzus.gcj._2012.qualification.b;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class BProcessorFactory extends AbstractProcessorFactory<BInput, BOutputEntry> {
public BProcessorFactory(Str... | import java.io.File;
import java.util.Scanner;
public class surprising {
public static int solve(String input)
{
String[] inputs = input.split(" ");
int count = Integer.parseInt(inputs[0]);
int surprises = Integer.parseInt(inputs[1]);
int best = Integer.parseInt(inputs[2]);
int[] scores = new... |
A20730 | A20186 | 0 | import java.util.Scanner;
public class B {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int zz = 1; zz <= T;zz++){
int N = in.nextInt();
int S = in.nextInt();
int p = in.nextInt();
int x = 0;
for(int i = 0; i < N;i++){
int score = in.n... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication3;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
/**
*
* @author yondaime
*/
public class Main2 {
/**
* @param args... |
B12115 | B11014 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... | import java.io.*;
import java.util.LinkedList;
import java.util.StringTokenizer;
public class RecycledNumbers
{
public static void main(String[] args)
{
StringTokenizer st;
BufferedReader br = null;
try {
FileWriter fstream = new FileWriter("output.out");
... |
A12273 | A10324 | 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 ex2;
import java.io.*;
import java.util.ArrayList;
/**
*
* @author Jean-Nicolas
*/
public class Ex2 {
private static ArrayList<ArrayList<Integer>> getCombinaisons(int p, int n) {
return getCombinaisons(p, n, new ArrayList<Integer>());
}
private static ArrayList<ArrayList<Integer>> get... |
A20119 | A21162 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | import java.util.Scanner;
public class Dancing {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int caseCount = sc.nextInt();
for (int i = 1; i <= caseCount; i++) {
int N = sc.nextInt();
int numSuprise = sc.nextInt();
int p = sc.nextInt();
int bestN = 0;
for (int j... |
A10793 | A10549 | 0 | import java.io.*;
import java.math.*;
import java.util.*;
import java.text.*;
public class b {
public static void main(String[] args) {
Scanner sc = new Scanner(new BufferedInputStream(System.in));
int T = sc.nextInt();
for (int casenumber = 1; casenumber <= T; ++casenumber) {
... | package gcj2012;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.StringTokenizer;
/**
* Google Code Jam 2012 B - Dancing With the Googlers
*
* @author Ruli Manurung (maruli@cs.ui.ac.id)
*/
public class QB
{
public stati... |
A22360 | A21239 | 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.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 B{
Scanner sc=new Scanner(System.in);
int INF=1<<28;
double EPS=1e-9;
int caze, T;
int n, s, p;
int[] ts;
void r... |
B12762 | B10912 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.File;
import java.io.FileInputStream;
import java.util.Scanner;
/**
*
* @author imgps
*/
public class C {
public static void main(String args[]) throws Exception{
int A,B;
int ctr ... | package Test1;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Test1 {
public static void main(String[] args) {
String temp1 = null;
String temp2 = null;
int n,a,b;
BufferedReader in = new BufferedReader(new InputStreamReader(System.in)) ;
try {
String str... |
A21396 | A20436 | 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.BufferedReader;
import java.io.FileReader;
public class DG {
public static void main (String[] args) throws Exception
{
BufferedReader sr = new BufferedReader(new FileReader("c:\\Projects\\DG.txt"));
int total = Integer.parseInt(sr.readLine());
for (int i=0; i<total; i++)
... |
B11318 | B13238 | 0 | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
int casos=1, a, b, n, m, cont;
while(t!=0){
a=sc.nextInt();
b=sc.nextInt();
if(a>b){
int aux=a;
a=b;
b=aux;
}
System.out.printf("Case #%d: ",casos... | import java.util.LinkedList;
import java.util.Scanner;
public class Recycle {
private static int[] total(int r) {
int i=1, t=10;
while(r/t > 0) {
i++;
t*=10;
}
return new int[] {i,t/10};
}
private static int pow(int c) {
int t=1;
while(c-->0)
t*=10;
return t;
}
private static int recy... |
B11361 | B10156 | 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.*;
public class C {
public static String shift(String a, int d) {
String end = a.substring(d, a.length());
String start = a.substring(0, d);
return end + start;
}
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int t = s.nextInt();
... |
A21010 | A22603 | 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 B {
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
int T = Integer.parseInt(in.nextLine());
for (int test = 0 ; test < T ; test ++)
{
String input = in.nextLine();
String[] bIn = input.split(" ");
int googlersNum =... |
B10231 | B12706 | 0 | import java.io.*;
class code1
{
public static void main(String args[]) throws Exception
{
File ii = new File ("C-small-attempt1.in");
FileInputStream fis = new FileInputStream(ii);
BufferedReader br = new BufferedReader(new InputStreamReader (fis));
int cases = Integer.parseInt(br.readLine());
FileOutput... | import java.util.*;
import java.math.*;
import java.io.*;
public class Main
{
public static void main(String args[]) throws IOException
{
Scanner c=new Scanner(System.in);
int T=c.nextInt();
for(int i=0;i<T;i++)
{
int ans=0;
int A=c.nextInt();
int B=c.nextInt();
for(int num=A;num<=B;num++)
... |
A22191 | A21958 | 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.*;
import java.util.InputMismatchException;
public class qualifierQ2 {
public static void main(String[] args) throws FileNotFoundException {
PrintStream printStream = null;
File file = null;
try {
if (Boolean.getBoolean("toFile")) {
file = new Fil... |
A11135 | A11063 | 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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class triplets {
public static void main(String[] args) throws IOException {
BufferedReader reader=new BufferedReader(new InputStreamReader(System.in)); //copy test data into... |
A20261 | A21138 | 0 | package com.gcj.parser;
public class MaxPoints {
public static int normal(int value){
int toReturn = 0;
switch (value) {
case 0 : toReturn = 0 ; break;
case 1 : toReturn = 1 ; break;
case 2 : toReturn = 1 ; break;
case 3 : toReturn = 1 ; break;
case 4 : toReturn = 2 ; break;
case 5 : toReturn = 2 ; b... | package com.gzroger.codejam2012;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.StringTokenizer;
public class QB {
public static void main(String[] args) {
try {
BufferedReader reader = new BufferedReader(new FileReade... |
B21752 | B20563 | 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.elbr.codejam2012.qualification.C;
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.net.URL;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
public c... |
A20382 | A20436 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... | import java.io.BufferedReader;
import java.io.FileReader;
public class DG {
public static void main (String[] args) throws Exception
{
BufferedReader sr = new BufferedReader(new FileReader("c:\\Projects\\DG.txt"));
int total = Integer.parseInt(sr.readLine());
for (int i=0; i<total; i++)
... |
B10231 | B10936 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
public class qc {
public static void main(String [] args)
{
String fileName = "C-small-attempt0.in";
try{
FileReader fr = new FileReader(fileName);
BufferedReader br = new BufferedReader(fr... |
A12113 | A11318 | 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.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class ProblemB {
private void solve() {
Scanner in = new Scanner(new BufferedInputStream(System.in));
PrintWriter out = new PrintWriter(new Buff... |
B20734 | B20927 | 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.InputStream;
import java.io.PrintStream;
import java.util.Scanner;
public abstract class AbstractCodeJam {
public void solveProblems(InputStream in, PrintStream out) {
Scanner scan = new Scanner(in);
int nb = scan.nextInt();
scan.nextLine();
for (int i = 1; i <= nb; ... |
B12074 | B12058 | 0 | package jp.funnything.competition.util;
import java.math.BigInteger;
/**
* Utility for BigInteger
*/
public class BI {
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger add( final BigInteger x , final BigInteger y ) {
return... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.TreeSet;
public class prob2 {
private static long oneTest(int a, int b){
boolean [] bool=... |
B12570 | B12328 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | package main;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.uti... |
B20566 | B20817 | 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.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... |
A21557 | A21047 | 0 | import java.io.*;
import java.util.*;
public class DancingWithGooglers {
public static class Googlers {
public int T;
public int surp;
public boolean surprising;
public boolean pSurprising;
public boolean antiSurprising;
public boolean pAntiSurprising;
public Googlers(int T, int surp) ... | package DancingWithTheGooglers;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.Collections;
import java.util.Scanner;
import java.util.ArrayList;
public class DancingWithTheGooglers {
public static void main(String[]... |
B10155 | B10462 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
/**
*
* @author eblanco
*/
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
impo... |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.TreeSet;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author ikhwan
*/
public class C
{
public static ... |
A20934 | A20563 | 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()... | ///// put all imports here /////////
import java.io.*;
import java.util.*; // for system.out n stuff
import static java.lang.Math.*;
///////////////////////////////////////////
public class Dancing {
public static void main(String[] args) throws FileNotFoundException{
// handy scanne... |
A12846 | A10445 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam.common;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Lance Chen
*/
public class CodeHelper {
private static String FILE_ROOT = "D:/workspace/googlecodejam/meta";
publi... | import java.io.*;
import java.util.*;
public class dancers
{
public static void main(String[] args)
{
ArrayList<HashSet<triple>> list = new ArrayList<HashSet<triple>>();
for (int i = 0; i <= 30; i++)
{
HashSet<triple> temp = new HashSet<triple>();
list.add(temp);
}
for (int i = 0; i <= 10; i++)
fo... |
A11201 | A13154 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | import java.io.BufferedReader;
import java.io.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... |
A22360 | A22591 | 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.dagova.dancingWithTheGooglers;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class DancingWithTheGooglers
{
/**
* @param args
*/
public static void main(String[] args)
{
DancingWithTheGooglersSolver solver;
BufferedReader bufferedReader = ne... |
B10858 | B12766 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| import java.io.*;
import java.util.HashSet;
import java.util.Scanner;
public class RecycledNumbers {
static String outputFile, inputFile;
public static void main(String[] args) throws IOException {
if (args.length != 2)
return;
inputFile = args[0];
outputFile = args[1];
// Create FileReader Object
... |
B11421 | B10696 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Recycled {
public static void main(String[] args) throws Exception{
String inputFile = "C-small-attempt0.in... | import java.util.*;
import java.io.*;
import java.lang.*;
class RecycledNumbers {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = Integer.parseInt(sc.nextLine());
boolean[] taken = new boolean[2000001];
for (int i=0; i<T; i++) {
int count = 0;
Str... |
A20490 | A20305 | 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.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class dancing {
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
static StringTokenizer st = new StringTokenizer("");
public static String next() throws Exception {
while (t... |
B11421 | B12020 | 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.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(new FileReader("C-small-attempt0.in"));
PrintWriter out = new PrintWriter(new FileWriter("RecycledNumbers-Small.out"));
RecycledNumbers solver = ne... |
A12460 | A10683 | 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.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Main {
/**
* @param args
* @throws FileNotFoundException
*/
public static void main(String[] args) throws FileNotFoundException {
// TODO Auto-generated method stub
File fi = new File("D:\\B-small-attemp... |
B12669 | B11479 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package year_2012.qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.... | import java.util.*;
public class C {
public static void main(String args[]){
Scanner scanner = new Scanner(System.in);
int testCount = scanner.nextInt();
HashSet<String> hashResult = new HashSet<String>();
for (int test = 1; test <= testCount; test++){
int min = scanner... |
B10702 | B11309 | 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... | /**
* Copyright 2012 Christopher Schmitz. All Rights Reserved.
*/
package com.isotopeent.codejam.lib.converters;
import com.isotopeent.codejam.lib.InputConverter;
public class DynamicMultiLineConverter implements InputConverter<Object[]> {
private static final int MAX_PARAM_COUNT = 10;
private IntArrayLine par... |
B10485 | B11088 | 0 |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class Recycle
{
public static void main(String[] args)
{
/* Set<Integer> perms = getPermutations(123456);
for(Integer i: p... | package fixjava;
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[] ... |
A12460 | A11460 | 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.Scanner;
public class problemB {
private static final StringBuilder output = new StringBuilder();
private static int i = 1;
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int tests = s.nextInt();
s.nextLine();
for (int i = 0; i < tests; i++) {
addLine(Str... |
A22642 | A20945 | 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 org.moriraaca.codejam.dancingwithgooglers;
import org.moriraaca.codejam.TestCase;
public class DancingWithTheGooglersTestCase implements TestCase {
public int S;
public int p;
public int[] scores;
}
|
A21396 | A22587 | 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 qualifiers;
import java.io.*;
import java.util.*;
import java.util.concurrent.*;
public class QualifierB {
class Task implements Runnable {
private int num;
private String line;
public Task(int num, String line) {
this.num = num;
this.line = line;
}
@Override
public void run() {
String... |
A21557 | A22683 | 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.IOException;
import java.io.InputStreamReader;
/**
* Google code jam.
* Qualification Round 2012.
* Problem B. Dancing With the Googlers
*
* Usage: <app> <input >output
*
* @author sombrabr@gmail.com
*
*/
public class QualB {
public static void main... |
A21396 | A22632 | 0 | import java.util.*;
public class Test {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int i = 1; i<=T; i++) {
int n = in.nextInt();
int s = in.nextInt();
int p = in.nextInt();
int result = 0;
for(int j = 0; j<n; j++){
... | import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.Scanner;
public class B {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
// bug eliminator
Scanner in = new Scanner(new Fi... |
B21227 | B20607 | 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.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class C {
public static void main(String[] args) throws Exception{
long tIni=System.currentTimeMillis();
Scanner s=new Scanner(new File("./data/C.txt"));
PrintWriter pw=new PrintWriter(new File("./data/C_... |
B12115 | B10636 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... |
import java.io.BufferedReader;
import java.io.InputStreamReader;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author andy
*/
public class RecycledNumbers {
/**
* @param args the command line arguments
*/
public static void main(St... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.