F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
A20934 | A20321 | 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 QR_2012;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import Utils.IOStreams;
public class B_Dancing_With_The_Googlers {
public static void main(String[] args) throws IOException {
IOStreams streams = new IOSt... |
B11696 | B12722 | 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 codejam.Y2012;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Collections;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class RecycledNumbers {
/**
* @param args
* @throws FileNotFoundException
*/
public static void main(String[] args) ... |
B11318 | B11874 | 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 qualification_2012;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;
public class PC {
static Scanner sc = new Scanner(System.in);
static PrintWriter pw = new PrintWriter(System.out);
public static void main(String[] args) {
int n = sc.nextInt();
for (int i = 1; i <= n... |
A11917 | A11238 | 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.util.*;
public class B
{
static int[] a;
static int[][] dp;
static int n, s, p;
public static void main(String args[])
{
Scanner scan = new Scanner(System.in);
int T = scan.nextInt();
for(int ca=1;ca <= T;ca++)
{
n = scan.nextInt();
s = scan.nextInt();
p = scan.nextInt();
a = new... |
A12273 | A11825 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Dancing
* Jason Bradley Nel
* 16287398
*/
import java.io.*;
public class Dancing {
public static void main(String[] args) {
In input = new In("input.txt");
int T = Integer.parseInt(input.... | package com.bertramtruong.utils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Arrays;
/**
* This class provides advanced reading capabilities to files.
* @author Bertram
*/
public class DataReader {... |
B12085 | B11426 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | import java.io.*;
import java.util.*;
public class RecycledNumbers {
static int A, B;
public static void main(String[] args) throws IOException {
Kattio io = new Kattio(System.in, new FileOutputStream("recycle.out"));
int T = io.getInt();
for (int test = 1; test <= T; test++) {
A = io.getInt();
B = io... |
A12273 | A10959 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Dancing
* Jason Bradley Nel
* 16287398
*/
import java.io.*;
public class Dancing {
public static void main(String[] args) {
In input = new In("input.txt");
int T = Integer.parseInt(input.... | import java.util.*;
import java.io.*;
public class B{
void solve() throws FileNotFoundException{
File fin = new File("data.in");
File fout = new File("data.out");
Scanner cin = new Scanner(fin);
PrintWriter cout = new PrintWriter(fout);
int T, n, s, p;
T = cin.nextInt();
for(int k = 0; k < T; k++){
... |
A20730 | A21747 | 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... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.Reader;
public class ProB {
/**
* @param args
*/
public static void main(String[] args) {
/... |
B12085 | B11084 | 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 fixjava;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map.Entry;
import java.util.Set;
/**
* Simple multimap class. <code>
MultiMap<String, String> map = MultiMapKeyToList.make();
map.put("a",... |
B12941 | B11435 | 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 gcj_qr_c;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Scanner;
/**
*
* @author amahdy
*/
public class GCJ_QR_C {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws FileNotFoundExc... |
B21270 | B21358 | 0 | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
public class CopyOfCopyOfMain {
static int ndigits(int n) {
return (int) (Math.log10(n) + 1);
}
static i... | package com.my;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.HashSet;
import java.util.Set;
public class Main {
public static void main(String[] args) {
try {
RecycledNumbers r = new RecycledNumbers();
String fileLocation = "C://Training//Google//RecycledN... |
A22078 | A21484 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
public class GooglersDancer {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated metho... | package google.codejam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
public class Problem2 {
public Problem2() {
super();
... |
B20006 | B21284 | 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.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class ProblemC {
public static int eval(int A, String n, int B){
int r = 0;
for(int i = 1; i < n.length(); i++){
int nn = Integer.parseInt((n));
String ini =... |
A11201 | A13071 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | package com.vp.common;
import com.vp.fact.SolutionFactory;
import com.vp.iface.Problem;
public class ExecutorApp {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String inputFileName = "C:/Workspace/GCJ2012/src/com/vp/data/sample_input.txt";
S... |
A22771 | A22343 | 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.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
public class ProblemB {
public static void main(String[] args) throws FileNotFoundException {
String test = "4\n" + "3 1 5 15 13 11\n" + "3 0 8 23 22 21\n" + "2 1 1 8 0\n"
+ "6 2 8 29 20 8 18 18 21... |
A21010 | A21860 | 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 test.com;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Stack;
public class QualB {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
FileInputStream fos = new FileInputStream("c... |
A11502 | A12563 | 0 | package template;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
public class TestCase {
private boolean isSolved;
private Object solution;
private Map<String, Integer> intProperties;
private Map<String, ArrayList<Integer>> intArrayProperties;
private Map<String, Arra... |
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class Problem2 {
public static void main(String arg[])
{
try{
FileInputStream fstream = new FileInputStream("... |
B21207 | B21062 | 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) ... | /*
* @author Magix.Lu
*/
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class RecycledNum {
public static void main(String[] args) throws IOException {
Scanner scanInput = new Scanner(System.in);
String target = scanInput.... |
A20261 | A22948 | 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.ozan.jam;
import com.google.common.base.Preconditions;
import org.springframework.core.io.ClassPathResource;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public abstract class JamBase {
private final File inputFile;
private final File outpu... |
B20734 | B20184 | 0 | package fixjava;
public class StringUtils {
/** Repeat the given string the requested number of times. */
public static String repeat(String str, int numTimes) {
StringBuilder buf = new StringBuilder(Math.max(0, str.length() * numTimes));
for (int i = 0; i < numTimes; i++)
buf.append(str);
return buf.toStr... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
//package codejam.practice;
/**
*
* @author Saikat Roy
*/
import java.io.*;
public class Main2 {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
public void input() throws IOExce... |
A10793 | A12984 | 0 | import java.io.*;
import java.math.*;
import java.util.*;
import java.text.*;
public class b {
public static void main(String[] args) {
Scanner sc = new Scanner(new BufferedInputStream(System.in));
int T = sc.nextInt();
for (int casenumber = 1; casenumber <= T; ++casenumber) {
... | import java.io.*;
import java.util.*;
public class DancingWithTheGooglers {
private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
private static StringTokenizer st;
public static void main ( String [] args ) throws IOException
{
int T = Integer.parseInt(br.read... |
A21557 | A22871 | 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.*;
public class Main2 {
public static void main(String[] args) {
try {
String[] a;
FileInputStream fstream = new FileInputStream("B-large.in");
DataInputStream in = new DataInputStream(fstream);
FileWriter fst = new FileWriter("out.txt");
BufferedWriter out = new BufferedWriter(fst);
... |
B13196 | B12174 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Q3M {
public static void main(String[] args) throws Exception {
compute();
}
private ... | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
public class recycle {
public static void rec() throws NumberFormatException, IOException {
BufferedReader in = new BufferedReader(new FileReader("src... |
B12669 | B10891 | 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 de.at.codejam.gui;
import java.awt.BorderLayout;
import java.io.File;
import javax.swing.JFileChooser;
import javax.swing.JPanel;
import javax.swing.filechooser.FileFilter;
import de.at.codejam.util.CodeJamConstants;
import de.at.codejam.util.StatusListener;
import de.at.codejam.util.TaskStatus;
public clas... |
B10485 | B10999 | 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.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class TestB {
private final static String DAT_PATH = "/Users/ttsurumi/Downloads/";
// private final static String dat = "A-sample-practice.in";
// private final stati... |
A22378 | A20444 | 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.util.Scanner;
public class B {
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
int cases;
cases = in.nextInt();
in.nextLine();
for(int i = 0; i < cases; i ++ ) {
int n = in.nextInt();
int su... |
A10793 | A12339 | 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 google.codejam2012.awanish;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;
import java.util.StringTokenizer;
public class GooglersDance {
private static int count = 0;
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
... |
B21790 | B21525 | 0 | import java.io.*;
import java.util.*;
public class C {
void solve() throws IOException {
in("C-large.in"); out("C-large.out");
long tm = System.currentTimeMillis();
boolean[] mask = new boolean[2000000];
int[] r = new int[10];
int t = readInt();
for (int cs = 1; cs... | package com.archu.contest;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashSet;
public class RecycledNum
{
/**
* @param args
*/
public static void main(String[] args)
{
File inputFile = null;
File... |
A11277 | A12112 | 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.Scanner;
public class B {
/**
* @param args
*/
public static void main(String[] args) throws IOException {
Scanner s = new Scanner(new FileReader(new File("B-small-attempt0.in")));
PrintWriter out = new PrintWriter(new File("B.out"));
StringBuilder resultat =new String... |
B12074 | B11475 | 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 ReNu {
public static void main(String[] args)
{
Scanner scan = null;
PrintWriter outStream = null;
try
{
outStream = new PrintWriter(new FileOutputStream("c_out.txt"));
scan = new Scanner(new FileInputStream("C-small-attempt0.in"));
}catch (FileNotFo... |
B11696 | B12464 | 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 codejam2012;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import reusable.CodeJamBase;
public class RecycledNumbers {
public static void main(String[] args) {
new CodeJamBase("C-small-attempt0") {
private int rotate(int value, int rotations, int t... |
B21752 | B22246 | 0 | package Main;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
/**
* Created with IntelliJ IDEA.
* User: arran
* Date: 14/04/12
* Time: 3:12 PM
* To change ... | import java.util.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... |
B20424 | B21434 | 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 jp.funnything.competition.util;
public class Prof {
private long _start;
public Prof() {
reset();
}
private long calcAndReset() {
final long ret = System.currentTimeMillis() - _start;
reset();
return ret;
}
private void reset() {
_start = Sys... |
A11135 | A12558 | 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.util.*;
public class Main
{
public static void main(String[]args)
{
Scanner in = new Scanner(System.in);
int inputs = in.nextInt();
for(int i = 1; i <= inputs; i++)
{
int ppls = in.nextInt();
int sup = in.nextInt();
int score = in.nextInt();
int count = 0;
int scount = 0;
for(int... |
B21790 | B21604 | 0 | import java.io.*;
import java.util.*;
public class C {
void solve() throws IOException {
in("C-large.in"); out("C-large.out");
long tm = System.currentTimeMillis();
boolean[] mask = new boolean[2000000];
int[] r = new int[10];
int t = readInt();
for (int cs = 1; cs... | import java.util.*;
class QC{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int kase = sc.nextInt();
for(int k = 1; k<=kase; k++){
int A = sc.nextInt();
int B = sc.nextInt();
int count = 0;
for(int x= A; x<B; x++){
int[] cyc = new int[Integer.toString(x).length()]... |
B10858 | B10136 | 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.awt.Point;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
public class Prob2 {
private static String doAlgorithm(String[] lines) {
StringBui... |
B21049 | B20321 | 0 | package it.simone.google.code.jam2012;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumber implements GoogleCodeExercise {
int a = 0;
int b = 0;
Set<Couple> distinctCouple = null;
long maxTime = 0;
private class Couple {
int x = 0;
int y = 0;
public Couple(int x, int y) {
this... | package ulohy;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class codejam_3 {
static byte cases;
static int A, B;
static List<... |
B12085 | B11461 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Scanner;
public class C {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter("c.txt")));
/... |
B10485 | B11333 | 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.util.*;
import java.io.*;
import java.lang.*;
import static java.lang.System.*;
public class RecycledNumbers{
static HashSet<Integer> set;
static int ctr, low, high;
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(in));
int ii = I... |
A11277 | A11641 | 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.StringTokenizer;
/**
* Created by IntelliJ IDEA.
* User: marcus
* Date: 4/13/12
* Time: 8:18 PM
* To change this template use File | Settings | File Templates.
*/
public class DancingGooglers {
public static void main(String a[]) throws IOException {
int T = 0;
... |
B12570 | B11378 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.S... |
B20424 | B20436 | 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... |
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... |
B10245 | B12609 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | import java.io.IOException;
import java.text.NumberFormat;
import java.util.List;
public class Welcome extends JamProblem {
String welc = "welcome to code jam";
public static void main(String[] args) throws IOException {
Welcome p = new Welcome();
p.go();
}
@Override
String solve... |
B11421 | B12734 | 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 googlecodejam2012.qualification.recyclednumbers;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Writer;
public class RecycledNumb... |
A22642 | A20823 | 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 codeJam2011;
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 B {
/**
* @param args
*/
public static void main(String[] args) {
try {
Buff... |
B12669 | B12514 | 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.math.*;
public class recycle
{
static int A=0;
static int B=0;
static int C=0;
static int T=0;
static int ans=0;
static HashSet<Integer> ansset= new HashSet<Integer>();
public static void main(String[] args)
{
Scanner scan= new Scanner(System.in);
T=scan.... |
A10568 | A12481 | 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 QualB {
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int z = Integer.parseInt(br.readLine());
int[] u = {0, 0, 3, 6, 9, 12, 15, 18, 21, 24, 27};
int[] ul = {0, 0, 1, 4, 7, 10, 13, 16, 19, ... |
A11277 | A10517 | 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.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Scanner;
public class Dancers {
public static void main(String[] args) throws FileNotFoundException, IOException {
Scanner scanner = new Scanner(new File("Bsmall.in"));
int t = scanner.nextInt... |
B11696 | B10709 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recycled;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumbers {
/**
* @param args
* @throws IOException
* @throws NumberForm... |
B21752 | B21712 | 0 | package Main;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
/**
* Created with IntelliJ IDEA.
* User: arran
* Date: 14/04/12
* Time: 3:12 PM
* To change ... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
public class CodeJamSolverRecycle {
public static HashMap<Integer,... |
A11135 | A10036 | 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 SolnB;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
public class ProbBTest {
@Before
public void setUp() throws Exception {
}
@Test
public void test() {
fail("Not yet implemented");
}
}
|
B11327 | B13231 | 0 | package recycledNumbers;
public class OutputData {
private int[] Steps;
public int[] getSteps() {
return Steps;
}
public OutputData(int [] Steps){
this.Steps = Steps;
for(int i=0;i<this.Steps.length;i++){
System.out.println("Test "+(i+1)+": "+Steps[i]);
}
}
}
| package classes;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Recycle
{
public static void main(String[] args)
{
try
{
FileInputStream fstream = new FileInputStream("/Users/jleibsly200... |
A12211 | A11884 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class Dancing_improved {
static int f_Superan_limites(String params){
int superan_limite=0;
String[] para... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.Scanner;
public class Dance implements Runnable {
public void run(){
try {
Scanner in = new Scanner(new File("B-small-attempt0.in"));
PrintWriter out = new Pri... |
B20856 | B20687 | 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.util.*;
import java.io.*;
class problemC {
static class Coordinate implements Comparable<Coordinate> {
int x, y;
public Coordinate(int x, int y) {
this.x = x;
this.y = y;
}
public boolean equal(Object o) {
if (o == null || !(o instanceof Coordinate)) {
return false;
} else {
... |
B11318 | B11824 | 0 | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
int casos=1, a, b, n, m, cont;
while(t!=0){
a=sc.nextInt();
b=sc.nextInt();
if(a>b){
int aux=a;
a=b;
b=aux;
}
System.out.printf("Case #%d: ",casos... | import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
String inputName = "C-small-attempt0";
FileRead... |
B21207 | B20049 | 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.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:\... |
A22360 | A20908 | 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.Scanner;
public class Dancing {
/**
* @param args
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int cases = Integer.parseInt(sc.nextLine());
for(int i = 0; i < cases; i++) {
Scanner line = new Scanner(sc.nextLine());
int triplets = line.next... |
A10793 | A11715 | 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) {
... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
import java.io.*;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author user
*/
public class CodeJam {
/**
* @param args the command line arguments
*/
p... |
B12570 | B10777 | 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;
/*
* Google Code Jam 2012
* Program by Tommy Ludwig
* Problem: Recycled Numbers
* Date: 2012-04-13
* Time: 02:08 AM
*/
public class recycle {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for (int i = 1; i <= T; i++) {
... |
B12074 | B10322 | 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 sebastianco;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumbers {
public static void main(String[] args) throws Exception {
BufferedReader re... |
A20119 | A20834 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Arrays;
import java.util.Scanner;
public class B {
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(new File("./src/B-large.in"));
BufferedWriter out... |
B12085 | B10699 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | import java.io.*;
import java.util.*;
import java.math.*;
public class Main implements Runnable {
static int power = 1;
private static String filename;
public static void main(String[] args) {
if (args.length>0 && args[0].equals("f")) filename = "input.txt";
else filename = "";
new Thread(new Main()).s... |
A10699 | A10712 | 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.FileReader;
public class DancingTest {
public static void main(String[] args) {
int numCase = 0;
int caseIndex = 0;
int[] numGooglers = null;
int[] numSurprises = null;
int[] bestResult = null;
int[][] scores = null;
int maxNumScores = 30;
try {
Fi... |
A20119 | A22693 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | package google.codejam;
public class DanceGoogler implements GoogleSolver {
@Override
public String solve(String str) {
String[] input = str.split(" ");
int dancerNumber = Integer.parseInt(input[0]);
int surprisingCount = Integer.parseInt(input[1]);
int bestResult = Integer.parseInt(input[2]);
... |
B20566 | B20918 | 0 | import java.util.Scanner;
import java.io.*;
import java.lang.Math;
public class C{
public static int recycle(String str){
String[] numbers = str.split(" ");
int min = Integer.parseInt(numbers[0]);
int max = Integer.parseInt(numbers[1]);
int ret = 0;
for(int i = min; i < max; i++){
String num = i + "";
... | package recycledNumbers;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class Flow {
public static InputData Readin(String filename){
try {
FileReader fr = new FileReader(filena... |
B12669 | B10878 | 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 de.at.codejam.util;
import java.util.ArrayList;
import java.util.List;
public abstract class AbstractCaseSolver<CASE> implements CaseSolver<CASE> {
private final List<StatusListener> statusListenerList = new ArrayList<StatusListener>();
@Override
public void updateStatus(TaskStatus taskStatus) {
for (S... |
A12570 | A12489 | 0 | package util.graph;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
public class DynDjikstra {
public static State FindShortest(Node start, Node target) {
PriorityQueue<Node> openSet = new PriorityQueue<>();
Set<Node> closedSet = new HashSet<>();
openSet.add... | import java.util.Scanner;
public class Dancing {
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
for (int C=1;C<=N;C++)
{
System.out.printf("Case #%d: ", C);
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt();
int count = 0;
... |
B21049 | B21015 | 0 | package it.simone.google.code.jam2012;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumber implements GoogleCodeExercise {
int a = 0;
int b = 0;
Set<Couple> distinctCouple = null;
long maxTime = 0;
private class Couple {
int x = 0;
int y = 0;
public Couple(int x, int y) {
this... | import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.HashSet;
import java.util.Scanner;
public class C {
public static int factorial(int x) {
int fact = 1;
for (int i = 2; i <= x; i++) {
fact *= i;
}
return fact;
}
/**
* @param args
*/
public static void main(S... |
A13029 | A12585 | 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.IOException;
import java.util.List;
public class StoreCredit extends JamProblem {
public static void main(String[] args) throws IOException {
StoreCredit problem= new StoreCredit();
problem.go();
}
@Override
String solveCase(JamCase jamCase) {
StoreCreditCase cas... |
B11318 | B12598 | 0 | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
int casos=1, a, b, n, m, cont;
while(t!=0){
a=sc.nextInt();
b=sc.nextInt();
if(a>b){
int aux=a;
a=b;
b=aux;
}
System.out.printf("Case #%d: ",casos... | import java.io.*;
import java.util.*;
import java.lang.Math.*;
public class gcj3
{
public static void main(String args[])throws Exception
{
//Scanner in=new Scanner(System.in);
//BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
//BufferedReader br = new Buffer... |
B12115 | B10789 | 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();
... |
public interface TestCaseFactory {
TestCase getInstance(int number);
} |
B20424 | B20694 | 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 org.moriraaca.codejam.recyclednumbers;
import org.moriraaca.codejam.AbstractTest;
import org.moriraaca.codejam.TestConfiguration;
@TestConfiguration(solverClass = RecycledNumbersSolver.class)
public class RecycledNumbers extends AbstractTest {
public RecycledNumbers(String fileName) {
super(fileName);
}
}... |
A12273 | A13055 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Dancing
* Jason Bradley Nel
* 16287398
*/
import java.io.*;
public class Dancing {
public static void main(String[] args) {
In input = new In("input.txt");
int T = Integer.parseInt(input.... | import java.io.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]>=avg)
count... |
B12085 | B11246 | 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.FileNotFoundException;
import java.util.Scanner;
public class cyclic {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int in = Integer.parseInt(sc.nextLine());
int i = 1;
while (i <= in) {
int A = sc.nextInt();
int B = Integer.parseIn... |
A10793 | A11893 | 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.IOException;
import java.io.InputStreamReader;
import java.util.TreeMap;
public class GoogleCodeJam {
/**
* @param args
* @throws IOException
*/
/* Speaking Tongues */
/* public static void main(String[] args) throws IOException {
// TODO Auto-generated method... |
A12544 | A10365 | 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.PrintWriter;
import java.util.Scanner;
/**
*
* @author pulasthi
*/
public class QB12 {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
PrintWriter out = new PrintWriter("b.txt");
int T = sc.nextInt();
for (int i = 0;... |
B12570 | B13133 | 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;
public class Rec {
static Scanner sc =new Scanner(System.in);
public static void main (String [] args ) {
int n =sc.nextInt();
for (int m =1; m <= n; m++) handleCase(m);
}
public static int a,b;
static void handleCase(int num) {
int sum=0;
a =sc.nextInt();
b =sc.nextInt();
for (int i =a; i... |
B21968 | B21805 | 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... | import java.io.*;
import java.util.ArrayList;
import java.util.List;
public abstract class JamProblem {
int caseCount;
int lastLine;
abstract String solveCase(JamCase jamCase);
abstract JamCase parseCase(List<String> file, int line);
List<String> loadFile() throws IOException {
FileReader... |
B10899 | B12497 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
public class ReadFile {
public static void main(... | package com.google;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class RecycledNumbers {
private static int numberOfRecycledPairsPossible(int a, int lowerLimit,
int upperLimit) {
int length = (a + "").length();
if ... |
B20006 | B20799 | 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 QualificationRound;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Dictionary;
import java.util.regex.Pattern;
public class C
{
public C()
{
}
public ... |
A12544 | A12377 | 0 | package problem1;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Arrays;
public class Problem1 {
public static void main(String[] args) throws FileNotFoundException, IOException{
try {
TextIO... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
public class Main {
private static String fileDirectory = "files/";
/**
* @param args
*/
public static void main(String[] args) {
... |
B20856 | B22083 | 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.util.*;
import java.io.*;
public class codejam1{
public static void main(String [] args){
HashMap<Integer, Integer> permuToPairs = new HashMap<Integer, Integer>();
permuToPairs.put(1,0);
permuToPairs.put(2,1);
permuToPairs.put(3,3);
permuToPairs.put(4,6);
... |
B20856 | B21287 | 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;
//... | package codejam.codejam_2012;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;
/**
* Created by IntelliJ IDEA.
* User: csrazvan
* Date: 14.04.2012
* Time: 13:44
* To change this template use File | Setti... |
A20119 | A21366 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | package com.dennis.codejam;
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.StringTokenizer;
public class DancingGoogle {
/**
* @param args
*/
... |
A21396 | A21547 | 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 com.jp.common;
public interface Puzzle {
public String[] solve(String[] dataSet );
}
|
B20291 | B21282 | 0 | import java.io.*;
import java.util.*;
class B
{
public static void main(String[] args)
{
try
{
BufferedReader br = new BufferedReader(new FileReader("B.in"));
PrintWriter pw = new PrintWriter(new FileWriter("B.out"));
int X = Integer.parseInt(br.readLine());
for(int i=0; i<X; i++)
{
String[]... | /**
*
*/
package org.mikeyin;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Scanner;
/**
* @author yincrash
*
*/
public class RecycledNumbers
{
// from stackoverflow, exponentiation by squaring
public static int ipow(int bas... |
B10361 | B10619 | 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 ProblemSolvers;
import CaseSolvers.RecycledNumbersCase;
public class RecycledNumbers extends ProblemSolver {
public RecycledNumbers(String filePath) {
super(filePath);
}
@Override
public void process() {
cases = io.readInt();
for (int i = 1; i <= cases; i++) {
new RecycledNumbersCase(i, 1, io)... |
B12115 | B10734 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... | import java.util.*;
public class probC
{
public static int N=2000001, K=0 ;
public static void main (String[] args)
{
Scanner scan = new Scanner (System.in) ;
int A[] = new int[N];
boolean visited[] = new boolean [N];
for (int i=0 ; i<A.length ; i++)
A[i]=-1;
for (int i=0 ; i<A.length ; i++)... |
B11421 | B13131 | 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.Arrays;
import java.util.Locale;
import java.util.Scanner;
public class RecycledNumbers {
// -ea âXmx256M âXss64M
long A, B;
private Object solve() throws Exception {
long result = 0;
for (long n = A; n < B; n++) {
long d = 1;
... |
B20424 | B22108 | 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... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.StringTokenizer;
public class MainC {
private static boolean esValido(Integer n,Integer A,Integer B,boolean comp)
{
int i=0;
boolea... |
B20291 | B20651 | 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.FileInputStream;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Scanner;
public class ProblemC {
public static void main(String[] args) throws Exception {
Scanner in = new Scanner(//
// System.in
// new FileInputStream("c-small.in")
... |
B10245 | B11861 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | package com.google.code.jam2012.problemC;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashSet;
import java.util.Scanner;
/**
* Created with IntelliJ IDEA.
* User: Vahid
* Date: 4/14/12
* Time: 6:54 PM
* To cha... |
B11327 | B10971 | 0 | package recycledNumbers;
public class OutputData {
private int[] Steps;
public int[] getSteps() {
return Steps;
}
public OutputData(int [] Steps){
this.Steps = Steps;
for(int i=0;i<this.Steps.length;i++){
System.out.println("Test "+(i+1)+": "+Steps[i]);
}
}
}
|
import java.io.BufferedReader;
import java.util.*;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
public class program {
/**
* @param args
*
* Reads the input file for test cases.
*/
//main method for Problem A.
public static void SolveA(String[] args) {
// TODO Auto-gener... |
A20382 | A21547 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... | package com.jp.common;
public interface Puzzle {
public String[] solve(String[] dataSet );
}
|
B10245 | B10547 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | import java.io.*;
import java.util.*;
class Q3
{
public static void main(String str[])throws IOException
{
// long time1=System.currentTimeMillis();
FileReader fr=new FileReader("C-small-attempt0.in");
// FileReader fr=new FileReader("C-large.in");
BufferedReader br=new BufferedRea... |
B21790 | B21899 | 0 | import java.io.*;
import java.util.*;
public class C {
void solve() throws IOException {
in("C-large.in"); out("C-large.out");
long tm = System.currentTimeMillis();
boolean[] mask = new boolean[2000000];
int[] r = new int[10];
int t = readInt();
for (int cs = 1; cs... | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.BitSet;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class B {
public static void main(String[]args)throws Exception {
File f = new File(args[0]);... |
B12115 | B13004 | 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.FileReader;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
public class C {
public static void main(String[] args) throws NumberFormatException, IOException {
File file = new File(args[0]... |
B21790 | B20327 | 0 | import java.io.*;
import java.util.*;
public class C {
void solve() throws IOException {
in("C-large.in"); out("C-large.out");
long tm = System.currentTimeMillis();
boolean[] mask = new boolean[2000000];
int[] r = new int[10];
int t = readInt();
for (int cs = 1; cs... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class RecycledNumbers {
public static int len(int A){
int k = 1 ;
int r = 0;
while( k < A){
k = k * 10;
r = r + 1;
}
return r;
... |
B12074 | B12395 | 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.FileInputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
public class C {
private static Map<Long, Long> map = new HashMap<Long, Long>();
public static void main(String args[]) {
try {
String fileName = "C:\\Users\\Lenovo Z... |
A10793 | A12835 | 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) {
... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package dancing;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
/**
*
* @author Serban
*/
public class Input {
PrintWriter out;
public Input(Stri... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.