F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
B12570 | B10405 | 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 C;
import java.io.*;
import java.util.*;
public class C {
static int[] pow = {10, 100, 1000, 10000, 100000, 1000000};
public static void main(String[] args) throws Exception {
BufferedReader in = new BufferedReader(new FileReader("C.in"));
PrintWriter out = new PrintWriter(new BufferedWriter(new Fil... |
B10245 | B11500 | 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.util.*;
import java.io.*;
public class Recycle
{
public static void main(String[] args)
{
try
{
Scanner scan = new Scanner(new File("Recycle.in"));
int x = Integer.parseInt(scan.nextLine());
for(int y=0;y<x;y++)
{
... |
A11277 | A12991 | 0 | package googlers;
import java.util.Scanner;
import java.util.PriorityQueue;
import java.util.Comparator;
public class Googlers {
public static void main(String[] args) {
int n,s,p,count=0,t;
Scanner sin=new Scanner(System.in);
t=Integer.parseInt(sin.nextLine());
int result[]=new int[t];
int ... | import java.io.*;
import java.util.*;
public class DancingWithGooglers {
void solve() throws Exception {
int n = nextInt();
int s = nextInt();
int p = nextInt();
int[] t = new int[n];
for (int i = 0; i < n; i++) {
t[i] = nextInt();
}
if (p == 0) {
out.println(n);
return;
}
int cutOff1 = ... |
B20006 | B20242 | 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 {
... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class RecycledNumbers {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
int t... |
B11421 | B10059 | 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.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class RecycledNumbers {
private final String inputFile = "D:\... |
B10155 | B12544 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
/**
*
* @author eblanco
*/
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
impo... | package contest.googlejam;
import java.io.File;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import contest.ContestProblem;
import contest.Input;
// http://code.google.com/codejam/africa_... |
B12085 | B11626 | 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.util.Scanner;
public class Test {
public static void main(String []args){
int numT=0;
Scanner kb=new Scanner(System.in);
numT = kb.nextInt();
int a[] = new int[numT];
int b[]=new int[numT];
for (int i = 0; i < numT; i++) {
a[i] = kb.nextInt();
b[i]=kb.nextInt();
}... |
A20261 | A20528 | 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.FileInputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
public class Dance {
static int getMaxGooglers(int N,int S, int p, int[] t) {
int count=0;
int surpriseCount=0;
int avg=p*3;
for(int i=0;i<N;i++) {
if(t[i]>=p) {
if(t[i]>=av... |
A22360 | A20784 | 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.*;
/**
*
* @author ankush
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args)throws IOException {
//System.out.println(Math.floor(Math.log10(11)));
BufferedReader br=new BufferedReader(new InputStreamReader(Sy... |
B20006 | B21693 | 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 {
... | import java.io.*;
import java.util.*;
public class test3
{
public static void main(String[] args) throws Exception
{
new test3().run();
}
PrintWriter out = null;
long getCount(int d, int max)
{
String s = Integer.toString(d);
int n = s.length();
HashSet<Integer> hs = new HashSet<Integer>();
for (in... |
B21227 | B21444 | 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.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 ... |
B20023 | B22184 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
public class GoogleC {
public String szamol(String input){
String result="";
String... | package com.qualification;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
public class Two {
public static void main(String[] args) throws FileNotFoundException, IOException {
FileReader fr = new FileReader("/Users/minerva/Desktop/input.txt");
FileWriter fw = new FileWriter("... |
B12085 | B12854 | 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.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String args[])throws IOException{
Scanner scan = new Scanner(new File(System.getProperty("user.dir")+"/input.in"));
FileWriter file = new FileWriter("output.... |
A11502 | A10308 | 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 googlecodejam;
import java.util.ArrayList;
/**
*
* @author Matej
*/
public class ProblemB {
int googlers;
int surprises;
int targetScore;
ArrayList<Integer> scores = new ArrayList<>();
public ProblemB(int g, int s, int t, ArrayList<Integer> l) {
googlers = g;
surprises... |
A20934 | A20396 | 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.*;
import java.util.*;
class GoogleDance
{
public static void main(String[] args)
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
Scanner sc=new Scanner(new InputStreamReader(System.in));
int t=sc.nextInt();
String ans[]=new String[t];
for(int i=0;i<t;i++)
{
in... |
A22378 | A21359 | 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... | // Author: Alejandro Sotelo Arevalo
package qualification;
import java.io.*;
import java.util.*;
public class B_DancingWithTheGooglers {
//--------------------------------------------------------------------------------
private static String ID="B";
private static String NAME="large";
private static boolean S... |
A22191 | A22013 | 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.*;
import java.math.*;
public class B {
public static void main(String[] args) throws IOException {
BufferedInputStream bis = new BufferedInputStream(new FileInputStream("B-large.in"));
BufferedReader br = new BufferedReader(new InputStreamReader(bis));
PrintWriter out = new P... |
A10996 | A11378 | 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.util.*;
public class B {
public static void main(String[] args) {
B b = new B();
b.solve();
}
public void solve() {
Scanner in = new Scanner(System.in);
int t = in.nextInt();
for(int ii = 1; ii <= t; ++ii) {
int num = in.nextInt();
int surprising = in.nextInt();
int points = in.next... |
B10485 | B11893 | 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 main;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
p... |
A12460 | A12448 | 0 | /**
*
*/
package pandit.codejam;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Scanner;
/**
* @author Manu Ram Pandit
*
*/
public class DancingWithGoogle... | package GoogleCodeJam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import... |
B20734 | B20063 | 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.*;
import java.lang.*;
class RotateNumber {
public static long RotateNumber(long number, long A, long B)
{
long start = number;
long sum = 0;
int numdigits = (int) Math.log10((double)number); // would return numdigits - 1
int multiplier = (int) Math.pow(10.0, (double)numdigits);
while(tr... |
B12669 | B11331 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package year_2012.qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.... | package Qualification_2012;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
public class RecycledNumbers {
static BufferedReader in;
static int A, B;
static boolean[][] v;
static HashSet<String> hash;
private static int ... |
A12846 | A12667 | 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.Arrays;
import java.util.Locale;
/**
* @author Yuri Denison
* @date 14.04.12
*/
public class GoogleCodeJamTaskB {
private static void solve() throws IOException {
final int t = rInt();
for (int i = 1; i <= t; i++) {
final int n = rInt();
final int s = rInt();... |
B20023 | B20914 | 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.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
public class recycling {
public static void main (String args[]){
if (args.length != 1){
System.out.println ("Gimme the right arguments!");
return;
}
File f = new File(ar... |
B12669 | B10721 | 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.... | public class recycled {
public static void main(String args[]) {
java.util.Scanner s = new java.util.Scanner(System.in);
int T = s.nextInt();
for (int n = 1; n <= T; n++)
System.out.println("Case #" + n + ": " + f(s.nextInt(), s.nextInt()));
}
public static int f(int a, int b) {
String A = "" + a... |
B12669 | B13167 | 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.io.*;
import java.util.*;
import java.lang.*;
class Pair {
public int x;
public int y;
public Pair(int x, int y) {
this.x = x;
this.y = y;
}
public static boolean equals(Pair a, Pair b) {
return (((a.x == b.x) && (a.y == b.y)) || ((a.x == b.y) && (a.y == b.x)));
}
}
public class Recycle {
... |
B21968 | B21439 | 0 | import java.util.*;
import java.io.*;
public class recycled_numbers {
public static void main(String[]a) throws Exception{
Scanner f = new Scanner(new File(a[0]));
int result=0;
int A,B;
String n,m;
HashSet<String> s=new HashSet<String>();
int T=f.nextInt(); //T total case count
for (int t=1; t<=T... | package jp.funnything.competition.util;
import java.io.File;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.apache.commons.io.FileUtils;
public class CompetitionIO {
private final QuestionReader _reader;
private final AnswerWriter _writer;
/**
* Default constructor. Use latest... |
A22360 | A22337 | 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 ... |
//Author KNIGHT0X300
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
int t=s.nextInt();
for(int i=0;i<t;i++)
{ int tot=0;
int N=s.nextInt();
int S=s.nextInt();
i... |
A12273 | A10735 | 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 test;
import java.io.*;
public class Test {
static public void magic(String tmp, int Result [],int index ){
int N=0,S=0,P=0,size;
char Carr []= new char[300];
size=tmp.length();
tmp.getChars(0, size, Carr, 0);
int i=0,j=0,spc=0;
String bom;
while (spc<3){
if(Carr[j]!=' '){
j++;
... |
A13029 | A11398 | 0 | import java.util.List;
public class Case implements Runnable {
private int id;
private String output;
private int n;
private int s;
private int p;
private List<Integer> g;
public Case(int id) {
this.id = id;
}
public Case(int id, int n, int s, int p, List<Integer> g) {
super();
this.id = id;
this... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
public class DancingWithTheGooglers {
public static void main(String... |
A11277 | A10213 | 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.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.HashMap;
import java.util.Scanner;
//javac B.java && java B x.in x.out
public class B {
public static void main(String[] args) throws FileNotFoundException {
InputStream in ... |
B10149 | B11797 | 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 static java.lang.Double.parseDouble;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.System.exit;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader... |
A20261 | A21821 | 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.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 IOException {
// Scanner in = new Scanner(new File("in/B/test.in"));
// Scanner in = new Scanner(new File("in/B/smal... |
B21270 | B20412 | 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... | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Scanner;
public class C {
public static void main(String[] args) throws Exception{
Scanner sc = new Scanner(new File("C.in"));
long tt =... |
A13029 | A10196 | 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 com.kingter;
import java.io.FileReader;
import java.io.LineNumberReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class GoogleDancer {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
//read
List<I... |
B20856 | B20426 | 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.*;
import java.util.*;
public class Prob3
{
public static void main (String[] args) throws IOException
{
BufferedReader in = new BufferedReader (new FileReader ("C-large.in"));
PrintWriter out = new PrintWriter (new FileWriter ("OUT3.txt"));
int T = Integer.parseInt (in.readLine ().trim ()), c... |
A10699 | A12994 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Dancing {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) ... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class QualificationB {
public static void main(String[] args) {
File file = new File("D:/CodeJam/B-small-... |
A11201 | A10183 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | package codejam;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
public class fileHandler {
FileInputStream input;
FileOutputStream output;
BufferedReader buf;
public... |
A22078 | A21190 | 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... | /**
* Copyright 2012 Christopher Schmitz. All Rights Reserved.
*/
package com.isotopeent.codejam.lib;
public interface InputConverter<T> {
boolean readLine(String data);
T generateObject();
}
|
A10793 | A12499 | 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.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... |
A10568 | A11343 | 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.*;
public class Task2 {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new FileReader(new File("t.txt")));
BufferedWriter writer = new BufferedWriter(new FileWriter(new File("out.txt")));
int num = Integer.parseInt(reade... |
B12085 | B13212 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam2012;
/**
*
* @author Abdelrahman
*/
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Ha... |
B12669 | B11504 | 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 it.simone.google.code.jam2012;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class GoogleCodeJamManager {
public static void main(String[] args) {
// GoogleCodeExe... |
B12082 | B12642 | 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.util.*;
class Main {
static Scanner in = new Scanner(System.in);
static Set<String> set = new HashSet<String>();
public static void serie(int n, int m){
for(int i=n;i<=m;i++){
String a = i+"";
int len = a.length()-1;
for(int k=len;k>=1;k--){
String res = a.substring(k, len+1) + a.substr... |
B11361 | B12546 | 0 | import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
public class C{
Scanner sc=new Scanner(System.in);
int INF=1<<28;
double EPS=1e-9;
int caze, T;
int A, B;
void run(){
T=sc.n... | import java.io.File;
import java.lang.StringBuilder;
import java.util.Scanner;
import java.io.FileWriter;
public class RN {
public static void main(String[] args) throws Exception{
File input = new File("C-small-attempt1.in");
File output = new File("output.out");
FileWriter fw = new FileWriter(output);
Sca... |
B21752 | B20432 | 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 assignments;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import base.Assignment;
public class AssignmentC implements Assignment {
private int min;
private int max;
@Override
public String solve() {
int total = 0;
int length = (int) Math.log10(min) + 1;
for (int i ... |
A12460 | A12933 | 0 | /**
*
*/
package pandit.codejam;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Scanner;
/**
* @author Manu Ram Pandit
*
*/
public class DancingWithGoogle... | package Dancing;
/**
* Created with IntelliJ IDEA.
* User: kevin
* Date: 4/13/12
* Time: 8:00 PM
* To change this template use File | Settings | File Templates.
*/
public class DanceSet {
public DanceSet(int dancers, int suprises, int minscore,int[] scores){
this.dancers=dancers;
this.sunrise... |
B13196 | B12879 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Q3M {
public static void main(String[] args) throws Exception {
compute();
}
private ... | package codejam2012.qr;
import codejam.common.CodeHelper;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Chen Ling
*/
public class ProblemC {
private static String SMALL_IN_FILE_NAME = "/codejam2012/qr/C-small.in";
private static String LARGE_IN_FILE_NAME = "/codejam2012/qr/C-large.in"... |
A10568 | A10669 | 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;
public class DancingGoogle {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOExc... |
B11318 | B12004 | 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 recycledNumbers;
public class Limits {
private int lower;
private int upper;
public Limits(int l, int u) {
this.lower = l;
this.upper = u;
}
public int getLow() {
return lower;
}
public int getUpp() {
return upper;
}
}
|
A20490 | A21621 | 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 test2;
import java.util.LinkedList;
/**
*
* @author Student
*/
public class Best {
public static LinkedList<Score> scores(int som) {
LinkedList<Score> res = new LinkedList<Score>();
int ... |
B20291 | B21811 | 0 | import java.io.*;
import java.util.*;
class B
{
public static void main(String[] args)
{
try
{
BufferedReader br = new BufferedReader(new FileReader("B.in"));
PrintWriter pw = new PrintWriter(new FileWriter("B.out"));
int X = Integer.parseInt(br.readLine());
for(int i=0; i<X; i++)
{
String[]... | import com.sun.org.apache.xerces.internal.impl.xs.opti.DefaultXMLDocumentHandler;
import util.graph.DynDjikstra;
import util.graph.Edge;
import util.graph.Node;
import util.graph.State;
import javax.xml.crypto.dsig.CanonicalizationMethod;
import java.io.IOException;
import java.math.BigInteger;
import java.util.List;
... |
A22360 | A22140 | 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 year2012.qualification.b;
import java.io.File;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;
public class DancingWithTheGooglers {
public static void main(String[] args) throws Exception{
/... |
A20934 | A21601 | 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.*;
import java.util.*;
import static java.lang.System.*;
public class B {
public static void main (String [] args) throws IOException {new B().run();}
public void run() throws IOException{
Scanner file = new Scanner(new File("B-large.in"));
PrintWriter out = new PrintWriter(new BufferedWriter(new ... |
A11135 | A10536 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package one.codejam.b;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Arrays;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;
public class Dancing... |
A22360 | A20644 | 0 | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Scanner;
public class Dancing_With_the_Googlers {
/**
* The first line of the input gives the ... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class DancingGoogle {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOExc... |
A12273 | A10227 | 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.net.*;
import java.io.*;
import java.lang.*;
public class DancingWiththeGooglers {
public static int highestStable(int x){
if(x == 0)
return 0;
else if(x % 3 == 0)
return x/3;
else
return x/3 + 1;
}
public static int highestUnstable(int x){
int temp = 0;
... |
A11135 | A12811 | 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 ru.guredd.codejam;
import java.util.StringTokenizer;
public class Qualification2012B {
public void solve() {
int count = Integer.valueOf(Main.inputData.get(0));
for (int i = 0; i < count; i++) {
int result = 0;
String data = Main.inputData.get(i + 1);
... |
B10149 | B13134 | 0 | import java.io.FileInputStream;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeSet;
// Recycled Numbers
// https://code.google.com/codejam/contest/1460488/dashboard#s=p2
public class C {
private static String process(Scanner in) {
int A = in.nextInt();
int B = in.nextInt();
int res =... | import java.io.BufferedReader;
import java.util.*;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
public class program {
public static void main(String args[])
{
File inFile = new File("C-small-attempt0.in");
try {
Scanner scanner = new Scanner(inFile);
int tmp = 0;
int i = ... |
B22190 | B20287 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
public class Recycled {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.par... | package com.anuragkapur.jam2012.qr.C;
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;
im... |
A10699 | A12151 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Dancing {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) ... | import java.io.*;
public class Prof2ProB {
public static void main(String args[]) {
try {
BufferedReader breader = new BufferedReader(new FileReader("F:\\test.txt"));
int noo;
noo= Integer.parseInt(breader.readLine());
int casen=0;
int noofgglrs;... |
B10702 | B10110 | 0 | import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Recycle {
private static HashMap<Integer, HashSet<Integer>> map = new HashMap<Integer, HashSet<Integer>>();
private static HashSet<Integer> toSkip = new HashSet<Integer>();
/**
* @param args
*/
public static void main(S... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
public class Third {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new FileReader(new File(
"/Users/narok119/Desktop/C-small-attempt0.in")));
String txt = reader.readLine();
... |
B12085 | B10974 | 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.IOException;
import java.io.PrintWriter;
public class RecycledNumbers {
public static void main(String[] args) {
RecycledNumbers bt = new RecycledNumbers();
bt.solveProblem();
}
public void solveProblem() {
String[] testCases = ReadFile.readFile("C:/Users/Pablo/Documents/codejam/RN.in");
... |
A11277 | A12568 | 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.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... |
B12074 | B12594 | 0 | package jp.funnything.competition.util;
import java.math.BigInteger;
/**
* Utility for BigInteger
*/
public class BI {
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger add( final BigInteger x , final BigInteger y ) {
return... | import java.io.*;
import java.util.*;
public class C_Qual {
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for (int tt = 1; tt <= T; tt++) {
int a=in.nextInt(),b=in.nextInt();
int res=0;
for(int i=a;i<=b;i++){
String num = i+"... |
A11277 | A12444 | 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 code.jam;
import java.io.*;
import java.util.*;
public class CodeJam {
public static void main(String[] args) throws FileNotFoundException, IOException {
String name = "B-small-attempt2";
Scanner in = new Scanner( new BufferedReader( new FileReader(name + ".in") ) );... |
B21227 | B21920 | 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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import j... |
B11421 | B10577 | 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 com.gao.t3;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.HashSet;
public class Main {
public static void main(Str... |
B12669 | B11939 | 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.codejam.util;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
public class CodeJamOutputFile extends File {
/**
*
*/
private static final long serialVersionUID = -6971460798309687528L;
private FileWriter writer;
private Boolean caseZero = false;
public CodeJ... |
A20490 | A21588 | 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.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
public class B {
public static void main(String args[]){
try{
BufferedReader br = new BufferedReader(new FileReader(args[0]));
String strTmp = br.readLine();
Buffe... |
B12074 | B11228 | 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 codezam.util;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;
public class LCM {
static HashMap<Long, Integer> factor;
static BigInteger[][] dp;
... |
B10858 | B11494 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| package de.hg.codejam.tasks.numbers.service;
import java.util.HashSet;
import java.util.Set;
public class Calculator {
private final Set<Integer> overallShifts = new HashSet<>();
public int calculate(int[] pair) {
int result = 0;
int lowerBorder = pair[0];
int upperBorder = pair[1];
for (int i = lowerBo... |
A12113 | A13176 | 0 | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class B {
static int[][] memo;
static int[] nums;
static int p;
public static void main(String[] args)throws IOException
{
Scanner br=new Scanner(new File("B-small-attempt0.in"... | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
class DancingWithTheGooglers {
public static void main(String[] args) throws FileNotFoundException {
File input = new File("/home/michael/sandbox/codejam2012/dwtg-small.in.txt");
File output = new F... |
B21752 | B20313 | 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.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import jav... |
A12460 | A11960 | 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.*;
import java.lang.*;
public class Googlers {
private BufferedReader br;
private int numCases;
public Googlers(String input){
try{
FileInputStream fstream = new FileInputStream(input);
DataInputStream in = new DataInputStream(fstream);
br = new BufferedReader(new ... |
A20934 | A22902 | 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 Q2;
import java.io.BufferedReader;
import java.io.IOException;
abstract public class Solver {
protected BufferedReader input;
protected final String nl = System.getProperty("line.separator");
abstract public String solve() throws Exception;
protected String readLine(){
try {
return input.readLine()... |
B12082 | B12590 | 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.*;
import java.util.*;
public class RecycledNumbersSmall {
public static void main(String[] args) {
try {
FileWriter output = new FileWriter(new File("output.txt"));
Scanner s = new Scanner(new File("input.txt"));
int trials = s.nextInt();
s.nextLine();
for (int i = 0; i < trials; i++)... |
B10245 | B11291 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | package qualifyingRound;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class RecycledNumbers
{
public static void main (String [] args) throws FileNotFoundException
{
Scanner in = new Scanner (new File ("input.txt"));
int numLines = Integer.parseInt(in.nextLine());... |
B12570 | B10820 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | import java.util.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 + "";
... |
B11361 | B10569 | 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 gcj;
import java.util.*;
import java.io.*;
public class RecycledNumbers {
final static String PROBLEM_NAME = "rnum";
final static String WORK_DIR = "D:\\Gcj\\" + PROBLEM_NAME + "\\";
void solve(Scanner sc, PrintWriter pw) {
int A = sc.nextInt();
int B = sc.nextInt();
int r... |
B10231 | B10426 | 0 | import java.io.*;
class code1
{
public static void main(String args[]) throws Exception
{
File ii = new File ("C-small-attempt1.in");
FileInputStream fis = new FileInputStream(ii);
BufferedReader br = new BufferedReader(new InputStreamReader (fis));
int cases = Integer.parseInt(br.readLine());
FileOutput... | import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Scanner;
public class B {
public static void main(String ... args) throws Exception{
Scanner in = new Scanner(new File("C-small-attempt0.in"));
PrintStream out = new PrintStream(new File("... |
B21207 | B21997 | 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) ... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package cj2012;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.*;
/**
*
* @author agraa1
*/
public class Recycle {
public static void main(String[] args) throws Exception {
Re... |
B12669 | B12030 | 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.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
public class Recycle {
public static void main(String[] args) {
if (args.length == 1) {
String file = args[0];
try {
BufferedReader br = new BufferedRea... |
A20382 | A22714 | 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 cj2012;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
/**
*
* @author agraa1
*/
public class Dance {
... |
A22642 | A20291 | 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.*;
import java.util.*;
public class GA
{
public static void main(String args[]) throws Exception
{
InputReader sc=new InputReader(new FileInputStream(args[0]));
//InputReader sc=new InputReader(System.in);
int tc=sc.readInt(),i,j,p,n,s,t[],a,b,c,res=0;
for(i=1;i<=tc;i++){
res=0;
n=sc.read... |
B12074 | B11957 | 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.*;
public class C {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(in.readLine());
for (int c = 1; c <= t; c++)
{
String[] line = ... |
A12570 | A10734 | 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 problems;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t= sc.nextInt(), N, S, P, Rnumber, number, aux;
for (int i=1; i<=t; i++){
N= sc.nextInt();
S= sc.nextInt();
P= sc.nextInt();
aux=0;
P=3*P-2;
Rnu... |
B21207 | B21423 | 0 | /*
* Problem C. Recycled Numbers
*
* Do you ever become frustrated with television because you keep seeing the
* same things, recycled over and over again? Well I personally don't care about
* television, but I do sometimes feel that way about numbers.
*
* Let's say a pair of distinct positive integers (n, m) ... | /**
*
*/
package 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... |
A13029 | A10448 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class ProblemB {
ProblemB() throws IOException {
Scanner reader = new Scanner(new File("input.txt"));
BufferedWriter writer = new BufferedWriter(new FileWriter("output.tx... |
B20291 | B20229 | 0 | import java.io.*;
import java.util.*;
class B
{
public static void main(String[] args)
{
try
{
BufferedReader br = new BufferedReader(new FileReader("B.in"));
PrintWriter pw = new PrintWriter(new FileWriter("B.out"));
int X = Integer.parseInt(br.readLine());
for(int i=0; i<X; i++)
{
String[]... | import java.io.BufferedReader;
import java.io.FileReader;
public class C {
private static final String head = "Case #";
public static void main(String[] args) {
try{
FileReader f = new FileReader(args[0]);
BufferedReader b = new BufferedReader(f);
String s;
... |
B12941 | B10996 | 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... | package br.com.problema.c;
import java.util.HashSet;
public class Numero {
int num;
public Numero(int num) {
this.num = num;
}
public HashSet<Integer> numRecycled(int B) {
String s = num + "";
HashSet<Integer> recycleds = new HashSet<Integer>();
int numeroCasas = s.length();
System.out.print(num + "(... |
B10361 | B10420 | 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 gcj_2012;
/**
* Time: 6:31:53 PM, Apr 13, 2012
* @author Maya is the best :-)
*/
import java.util.Scanner;
import java.io.PrintWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
public class C {
static Scanner in;
static String path = "src/gcj_... |
A21557 | A21384 | 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.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.util.Scanner;
public class Dancers {
public static void main(String[] args) throws FileNotFoundException
{
FileInputStream file = new FileInputStream... |
A20490 | A20213 | 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... | // no.of users
// no. of sets
// minimum best
// scores
import java.io.*;
import java.util.Scanner;
public class abc
{
public static void main(String args[])
{
try{
FileWriter fstream = new FileWriter("outB.out");
FileInputStream fstream1=new FileInputStream("B-large.in");
DataInputStream in=new DataInputStream(fs... |
A11502 | A10459 | 0 | package template;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
public class TestCase {
private boolean isSolved;
private Object solution;
private Map<String, Integer> intProperties;
private Map<String, ArrayList<Integer>> intArrayProperties;
private Map<String, Arra... | import java.util.*;
public class B {
static Vector<Set<Integer>> num = new Vector<Set<Integer>>();
static void fill() {
for(int i = 0; i < 33; ++i) {
num.add(new TreeSet<Integer>());
}
for(int i = 0; i <= 10; ++i) {
for(int j = i; j <= i+2; ++j) {
for(int k = j; k <= i+2; ++k) {
if(k <= 10)... |
B10702 | B12375 | 0 | import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Recycle {
private static HashMap<Integer, HashSet<Integer>> map = new HashMap<Integer, HashSet<Integer>>();
private static HashSet<Integer> toSkip = new HashSet<Integer>();
/**
* @param args
*/
public static void main(S... | package 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;... |
A10699 | A12909 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Dancing {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) ... | import static java.lang.Math.*;
import static java.util.Arrays.*;
import java.io.*;
import java.util.*;
public class B {
Scanner sc = new Scanner(System.in);
int N, S, p;
int[] ts;
void read() {
N = sc.nextInt();
S = sc.nextInt();
p = sc.nextInt();
ts = new int[N];
for (int i = 0; i < N; i++) ts[i] =... |
B20734 | B20242 | 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.IOException;
import java.io.InputStreamReader;
public class RecycledNumbers {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
int t... |
A12544 | A11024 | 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 fixjava;
public class IntegerMutable {
int value;
public IntegerMutable(int value) {
this.value = value;
}
public IntegerMutable() {
this(0);
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
/** Inc and return new value (threadsafe) */
p... |
A22378 | A20664 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class CodeJam {
// public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt";
public static final String INP... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class SolutionJamB {
/**
* @param args
*/
public static void main(String[] args)
{
try
{
FileInputStream fis... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.