F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
A22360 | A22895 | 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 ... | /*
* Patrick Bonnell
* Google Code Jam 2012
* Qualification Round
* Dancing With the Googlers
*/
import java.io.*;
import java.util.*;
public class DancingSolution
{
String filename;
Case[] cases;
private class Case
{
int s, p;
int totals[];
public Case(int n, int s, int p)
{
totals = new i... |
A10699 | A10261 | 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 MySolution {
public MySolution() {
}
public static void main(String[] a) throws IOException {
sumfile("B-small-attempt0.in");
}
static void sumfile(String filename) throws IOException {
int tests=0;
int N=0;
int S=0;
int p=0;
int ti=0;
int count=0;
Reader r = new ... |
B20734 | B20444 | 0 | package fixjava;
public class StringUtils {
/** Repeat the given string the requested number of times. */
public static String repeat(String str, int numTimes) {
StringBuilder buf = new StringBuilder(Math.max(0, str.length() * numTimes));
for (int i = 0; i < numTimes; i++)
buf.append(str);
return buf.toStr... | import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
public class main {
public static void main(String[] args) {
// inputãã¡ã¤ã«ãèªã¿è¾¼ã¿
BufferedReader bufferReader = null;
String str = "";
try {
bufferReader = new BufferedReader(new InputStreamRead... |
A12846 | A12622 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class B {
private static final String PROBLEM_NAME = "B-small";
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReade... |
B20856 | B20438 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Happy;
import java.io.*;
import java.math.*;
import java.lang.*;
import java.util.*;
import java.util.Arrays.*;
import java.io.BufferedReader;
//import java.io.IOException;
//import java.io.InputStreamReader;
//... | import java.io.File;
import java.io.FileNotFoundException;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class C{
public static void main(String[] args) throws FileNotFoundException
{
Scanner sc = new Scanner(new File("C.txt"));
int testCase = Integer.parseInt(sc.nextLine());
... |
A10568 | A12470 | 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.*;
import javax.swing.*;
import java.util.*;
import java.awt.event.*;
import java.awt.*;
import java.math.*;
import java.text.*;
public class Gjam{
static int _pow(int num, int power)
{
int product=1;
for(int i=0;i<power;i++)
product *= num;
return product;
}
public static void main... |
A22992 | A21945 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author dannocz
*/
public class InputReader {
public static Input r... | import java.io.*;
import java.util.*;
public class B
{
public static void main(String[] args) throws Exception
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int numCases = Integer.parseInt(br.readLine());
for(int i = 0; i < numCases; i++) {
solveCase(i+1, br.readLine());
... |
B13196 | B10429 | 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 codejam;
import java.util.Hashtable;
public class RecycledNumbers {
@SuppressWarnings("unchecked")
Hashtable h1;
@SuppressWarnings("unchecked")
RecycledNumbers(){
h1 = new Hashtable();
}
@SuppressWarnings("unchecked")
long noOfPairs(long min, long max, long num){
String sMin = ""+min;
String sMax ... |
B10899 | B12730 | 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 codejam;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args ) throws Exception
{
String input = FileUtils.readFileToString(new File("/Users/adilme... |
B22190 | B20835 | 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 recycle_no;
import java.io.*;
import java.util.Arrays;
public class Recycle_no {
int N,a,b,count=0;
String s="",temp[];
public Recycle_no(){
try {
FileInputStream fis=new FileInputStream("C-large.in");
DataInputStream dis=new DataInputStream(fis);
FileOu... |
A22771 | A22411 | 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.util.Scanner;
public class CodeB{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int tcase;
int numGoogler, surprising, min;
int totTriplets, surprisingUsed;
int getMinMax;
tcase=sc.nextInt();
for(int q=1;q<=tcase;q++){
surprisingUsed=0;
getMinMax=0;
n... |
B22190 | B21746 | 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 recyclednumbers;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
/**
*
* @author Kocmi
*/
public class RecycledNumbers {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(Sy... |
A10568 | A10016 | 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.util.*;
import java.io.*;
public class B {
public static void main (String[] args)throws Exception
{
String inputfilename = args[0];
String outputfilename = args[1];
BufferedReader br = new BufferedReader(new FileReader(inputfilename));
BufferedWriter bw = new BufferedWriter(new FileWrit... |
A20730 | A22277 | 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.File;
import java.util.Scanner;
public class Googlers {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(new File("resource/B-large.in"));
int T = sc.nextInt();
int i = 1;
while (i<=T) {
int N = sc.nextInt();
int S = sc.nextInt();
int p = sc.nextInt()... |
B20291 | B22210 | 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 proba;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class ProblemC {
/**
* @param args
* @throws FileNotFoundException
*/
public static void main(String[] args) throws FileNotFoundException {
... |
B10858 | B11693 | 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.util.Scanner;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int numTestCases = Integer.valueOf(scanner.nextLine());
for ( int i =0; i < numTestCases; i++ ) {
String theCase = scanner.nextLine();
//Error checki... |
A11201 | A10353 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
public class Submission
{
public static final int numJudges = 3;
public static void main(String[] args)
{
try
{
BufferedReader in = ne... |
A10996 | A11994 | 0 | import java.util.Scanner;
import java.io.*;
class dance
{
public static void main (String[] args) throws IOException
{
File inputData = new File("B-small-attempt0.in");
File outputData= new File("Boutput.txt");
Scanner scan = new Scanner( inputData );
PrintStream print= new PrintStream(outputData);
... | import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
public class Prob2 {
public static void main(String[] args) throws NumberFormatException, IOException {
String filePath = "C://Users//Apoorv//Downloads//B-sm... |
B12762 | B11092 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.File;
import java.io.FileInputStream;
import java.util.Scanner;
/**
*
* @author imgps
*/
public class C {
public static void main(String args[]) throws Exception{
int A,B;
int ctr ... | package probc;
import codejam.CodeJam;
public class Main extends CodeJam {
public static void main(String[] args) {
new Main() {
// Override the input file with the following: e.g. if the value is "large", then read "A-large.in" instead of the default
// @SuppressWarnings("unused")
// public static final... |
A10793 | A10901 | 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.Scanner;
public class Main2 {
public static void main(String argsp[]) throws FileNotFoundException{
Scanner in = new Scanner(new FileReader("input.in"));
PrintWriter out = new PrintWriter("output.txt");
int T = 0;
String S1 = in.nextLine() ;
T = Integer.parseInt(S1);
... |
A22360 | A21729 | 0 | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Scanner;
public class Dancing_With_the_Googlers {
/**
* The first line of the input gives the ... | import java.io.*;
import java.util.*;
public class Second2
{
public static void main(String[]args)throws Exception
{
BufferedReader br = new BufferedReader(new FileReader("B-large.in"));
PrintWriter pw = new PrintWriter(new File("B-large.out"));
StringTokenizer st;
int cases = Integer.parseInt(br.readLine())... |
B21227 | B20980 | 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.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class RecycledNumbers {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
Scanner in;
/*in = new... |
A12273 | A13138 | 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.... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package exercises;
import IO.Input;
/**
*
* @author dannocz
*/
public class Exercise2 {
public static void run(Input input){
// for (String st : input.getTestCases()) {
// input.addRes... |
A12570 | A12254 | 0 | package util.graph;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
public class DynDjikstra {
public static State FindShortest(Node start, Node target) {
PriorityQueue<Node> openSet = new PriorityQueue<>();
Set<Node> closedSet = new HashSet<>();
openSet.add... |
public class Dancing
{
public static void main(String[] args)
{
int T = StdIn.readInt();
for (int tr = 1; tr <= T; tr++)
{
int N = StdIn.readInt();
int S = StdIn.readInt();
int p = StdIn.readInt();
int numP = 0;
int numS = 0;
for (int i = 0; i < N; i++)
{
int tripSum = StdIn.readInt... |
B20734 | B21269 | 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.text.*;
import java.io.*;
import java.util.*;
import java.lang.Math;
public class C
{
public static void main(String[] args) throws Exception
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str;
int T = Integer.parseInt(br.readLine());
for(int t = 1; t <= ... |
B10231 | B10477 | 0 | import java.io.*;
class code1
{
public static void main(String args[]) throws Exception
{
File ii = new File ("C-small-attempt1.in");
FileInputStream fis = new FileInputStream(ii);
BufferedReader br = new BufferedReader(new InputStreamReader (fis));
int cases = Integer.parseInt(br.readLine());
FileOutput... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.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;
... |
A12273 | A10629 | 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 br.com.app;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.util.Scanner;
public class DancingWithTheGooglers {
private static Scanner scan = new Scanner(System.in);
private static String[] entrada;
private static int[] p... |
A12846 | A10230 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam.common;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Lance Chen
*/
public class CodeHelper {
private static String FILE_ROOT = "D:/workspace/googlecodejam/meta";
publi... | package codejam2.dancing;
import java.util.Scanner;
import codejam2.CodejamCase;
import codejam2.CodejamRunner;
public class Dancing extends CodejamRunner implements CodejamCase {
private int nGooglers;
private int surprising;
private int pointMin;
private int[] points;
private String result;
@Override
publi... |
B10702 | B11866 | 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 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... |
A10699 | A11709 | 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.util.*;
import java.io.*;
public class dancing {
public static void main(String[] args) throws Throwable {
Scanner input=new Scanner(new File("dancing.in"));
PrintWriter out=new PrintWriter(new File("dancing.out"));
int cases=input.nextInt();
for(int test=1;test<=cases;test++) {
int n=input.ne... |
B20856 | B20846 | 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 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;
... |
A21010 | A22020 | 0 | package codejam;
import fixjava.Pair;
public class Utils {
public static long minLong(long firstVal, long... otherVals) {
long minVal = firstVal;
for (int i = 0; i < otherVals.length; i++)
minVal = Math.min(firstVal, otherVals[i]);
return minVal;
}
public static int minInt(int firstVal, int... otherVals... | import java.io.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;
/**
*
*/
/**
* @author Pandapotan Christian
*
*/
public class DancingWithGooglers {
/*
* Write string to a fi... |
A20261 | A20630 | 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 qual;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
public class B {
static int rec(int[][] memo , List<Integer> tlist , int supprize , int pos , int point){
int N = tlist.size();
if(pos == N){
return 0;
}
if(memo[pos][supprize] >... |
B20566 | B21202 | 0 | import java.util.Scanner;
import java.io.*;
import java.lang.Math;
public class C{
public static int recycle(String str){
String[] numbers = str.split(" ");
int min = Integer.parseInt(numbers[0]);
int max = Integer.parseInt(numbers[1]);
int ret = 0;
for(int i = min; i < max; i++){
String num = i + "";
... | import java.util.*;
/**
*
* @author Izhari Ishak Aksa
*/
public class ProblemC {
static int ret = 0;
static void check(String a, int A) {
int x = Integer.parseInt(a);
HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
for (int i = 1; i < a.length(); i++) {
... |
B10155 | B12773 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
/**
*
* @author eblanco
*/
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
impo... |
import java.util.Scanner;
public class RecycledNumber {
public int deal(int A, int B)
{
int ans = 0;
for (int i = A; i<= B ; i ++)
{
int left = i;
int k = 1;
int tk = 1;
UniqueList newInts = new UniqueList(10);
while (left >= 10)
{
left = left / 10;
tk = tk * 10;
}
left ... |
A12113 | A12100 | 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"... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package dancingwithgooglers;
import java.util.Scanner;
/**
*
* @author topik
*/
public class DancingWithGooglers
{
/**
* @param args the command line arguments
*/
public static void main(String[] ... |
A11135 | A11492 | 0 | /**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/3/12
* Time: 11:00 AM
* To change this template use File | Settings | File Templates.
*/
import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;
import java.io.*;
import java.util.*;
import java.uti... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
public class CodeJam_B {
public static void main(String[] args){
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
try{
String cou... |
B22190 | B21394 | 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... | import java.util.*;
import java.util.regex.*;
import java.text.*;
import java.math.*;
public class C {
void start() {
Scanner sc=new Scanner(System.in);
int nt=sc.nextInt();
for (int tc=1; tc<=nt; tc++) {
int a=sc.nextInt(), b=sc.nextInt(), re=0;
if (a<b && a>9) {
int p=1;
while (p*10<b)
p*... |
A11277 | A10020 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
public class OutputWriter {
private BufferedWriter bw = null;
private long counter = 1;
public OutputWriter(String fileName) {
try {
bw = new BufferedWriter(new FileWriter(new File(fileName)));
} catch ... |
B12085 | B11988 | 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.FileReader;
import java.io.FileWriter;
import java.io.Writer;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class RecycledNumbers {
private String mInputFileName;
private String mOutputFileName;
private long A;
priva... |
B12570 | B12251 | 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.ArrayList;
import java.util.LinkedList;
public class RecycledNumbers {
public static void solve(String fname) {
Read r = new Read();
r.Read(fname);
int numOfTestCases=r.noOfTestCases;
int[] numbers = r.nums;
String finalAnser="";
for(int i=0;i<numOfTestCases;i++){
String answer="";
int first... |
B21270 | B20530 | 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 gcj2012qual;
import java.io.*;
import java.util.*;
public class RecycleNum {
/**
* @param args
*/
HashMap<String, String> map = new HashMap<String, String>();
int totalpair(int start, int end){
int num = 0;
for(int i = start; i <= end; i++){
String s = String.valueOf(i);
//System.out.... |
B12074 | B12046 | 0 | package jp.funnything.competition.util;
import java.math.BigInteger;
/**
* Utility for BigInteger
*/
public class BI {
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger add( final BigInteger x , final BigInteger y ) {
return... | package codejam;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
public class RecyledNumbers {
public static void main(String[] args) {
String filename = "C:\\Users\\maheswaran\\Desktop\\C-small-attempt0.in"... |
A10568 | A10279 | 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.File;
import java.util.Arrays;
import java.util.Scanner;
public class DancingWiththeGooglers {
public static void main(String[] args) throws Exception {
File inp = new File("B-small-attempt0.in");
Scanner sc = new Scanner(inp);
int T = sc.nextInt();
int result, ... |
A12544 | A12879 | 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.lang.*;
import java.util.*;
class dancer{
int count,s,p;
int doneS;
int can;
void Counts(int i1){
int thrice=3*p;
if(i1>=thrice){count++;
can++;}
else{int diff=(thrice-i1);
if(diff>4){can++;}
else if((diff==1)||(diff==2)){
... |
B10485 | B11208 | 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 c2012;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class RecycledPairCalculator {
private ArrayList<I... |
B10231 | B12532 | 0 | import java.io.*;
class code1
{
public static void main(String args[]) throws Exception
{
File ii = new File ("C-small-attempt1.in");
FileInputStream fis = new FileInputStream(ii);
BufferedReader br = new BufferedReader(new InputStreamReader (fis));
int cases = Integer.parseInt(br.readLine());
FileOutput... | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;
public class RecycledNumbers {
String inputFilePath = "C:\\Temp\\Google\\C-sm... |
B12570 | B12837 | 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 static java.util.Arrays.deepToString;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.ArrayList;
public class C {
public BufferedReader in;
public PrintWriter out;
void debug(Object...os) {System.err.println(deepToString(os));}
st... |
B10245 | B10026 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
public class RecycledNumbers {
static boolean isRecycled(int a, int b, int length) {
String aString = String.valueOf(a);
String bString = String.valueOf(b);
for (int i = 0; i < length - 1; ... |
A21010 | A22156 | 0 | package codejam;
import fixjava.Pair;
public class Utils {
public static long minLong(long firstVal, long... otherVals) {
long minVal = firstVal;
for (int i = 0; i < otherVals.length; i++)
minVal = Math.min(firstVal, otherVals[i]);
return minVal;
}
public static int minInt(int firstVal, int... otherVals... | import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
public class Dancing {
/**
* @param args
*/
public static void main(String[] args) {
try {
System.setIn(new FileInputStream("../B-small-attempt0.in"));
} catch (FileNotF... |
B22190 | B20457 | 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 ch.googlecodejam.qualround;
import java.util.ArrayList;
import java.util.List;
public class RecycledNumbers {
public static String solve(List<List<String>> values) {
StringBuilder result = new StringBuilder();
int numberOfLine = 1;
for (List<String> line : values) {
... |
A22771 | A20915 | 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.*;
import java.util.Scanner;
import java.util.*;
public class trie
{
public static void main(String[] args) throws IOException
{
int i,j,nog,nos,p,n,count;
int[] t=new int[10];
String s1="",p1="",m1="";
solver h1=new solver();
Scanner fin=new Scanner(new F... |
B12570 | B10765 | 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 compete;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.StringTokenizer;
import java.util.TreeSet;
public class C {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileR... |
A22191 | A20789 | 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.*;
public class dancing
{
public static void main(String[] args) throws Exception
{
BufferedReader reader = new BufferedReader(new FileReader("B-large.in"));
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("B-large.out")));... |
B11318 | B11600 | 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... | /**
*
* @author amit
*/
import java.io.*;
import java.util.HashSet;
import java.util.Set;
//import java.util.Arrays;
//import java.math.BigInteger;
public class GCJ {
BufferedReader rin;
BufferedWriter wout;
int numCases;
public String calculate(long A, long B) {
long count =0;
for(long i=A;i<B;i++){
S... |
A22771 | A22401 | 0 | package com.menzus.gcj._2012.qualification.b;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class BProcessorFactory extends AbstractProcessorFactory<BInput, BOutputEntry> {
public BProcessorFactory(Str... | import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.List;
public class ClientB {
public static void main(String args[]) throws Exception {
ClientB client = new ClientB();
String[] inputLines = client.getInputLines(args[0]);
int lineCount = Integer.valueOf(inp... |
A10568 | A10530 | 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... | /*
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. Each triplet of scores consists of three integer scores from 0 to 10 inclusive. The judges have very similar standards, so it's surprising if a triplet of scores contains two... |
A11502 | A11974 | 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.*;
import java.util.*;
import java.math.*;
import java.text.*;
public class DancingWithTheGooglers {
static final int INF = 1 << 28, MAX = 1000;
static final double EPS = 1E-9;
static void solve() {
Scanner scan = new Scanner(in);
int T = scan.nextInt();
for (int t = 1; t <= T; t++) {
ou... |
A12570 | A10789 | 0 | package util.graph;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
public class DynDjikstra {
public static State FindShortest(Node start, Node target) {
PriorityQueue<Node> openSet = new PriorityQueue<>();
Set<Node> closedSet = new HashSet<>();
openSet.add... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.StringTokenizer;
public class C {
public static void main(String[] args) throws IOException {
BufferedReader br=new ... |
B21049 | B20838 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
public cl... |
B12074 | B10249 | 0 | package jp.funnything.competition.util;
import java.math.BigInteger;
/**
* Utility for BigInteger
*/
public class BI {
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger add( final BigInteger x , final BigInteger y ) {
return... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Set;
public class RNumber extends Basic2
{
public static void main(String[] args) throws Exception
{
RNumber p3 = new RNumber();
p3.initializ... |
A12273 | A11088 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Dancing
* Jason Bradley Nel
* 16287398
*/
import java.io.*;
public class Dancing {
public static void main(String[] args) {
In input = new In("input.txt");
int T = Integer.parseInt(input.... | import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Scanner;
public class B {
public static void main(String[] args) throws Exception {
Scanner in = new Scanner(new FileReader(new File("B.in")));
PrintWriter out = new PrintWriter(new FileWriter(... |
A22642 | A22388 | 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 contest.googlejam;
import java.io.File;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import contest.ContestProblem;
import contest.Input;
// http://code.google.com/codejam/africa_arabia/contests.html
public class Qualifier2012 {
public static void main(... |
A11502 | A10403 | 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.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.HashSet;
impor... |
A11201 | A10356 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | import java.util.Scanner;
public class Q2 {
public static void main(String[] args) {
Scanner s = new Scanner(Q2.class.getResourceAsStream("B-small-attempt1.in"));
int n = s.nextInt();
int nt = 1;
while (n-- > 0) {
int resp = 0;
int ng = s.nextInt();
int ex = s.nextInt();
int nm... |
B10155 | B11765 | 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 de.johanneslauber.codejam.model;
import java.util.List;
public interface IProblem {
public void setListOfCases(List<ICase> listOfCases);
public void solveCases();
}
|
A11135 | A11178 | 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 leider.ken;
import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
/**
*
* @author ken
*/
public class Danc... |
B20006 | B20961 | 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 codejam2012.qualification;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
/**
* @author Jaffar Ramay
*
*
Problem
Do you ever bec... |
B11421 | B11244 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Recycled {
public static void main(String[] args) throws Exception{
String inputFile = "C-small-attempt0.in... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashSet;
/**
*
* @author Madhav
*/
public class Recycl... |
A12273 | A10851 | 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 GoogleCodeJam.ed2012;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
public class QualificationB2012 {
private String inputFile;
private String outputFile;
private BufferedReader reader = null;
private BufferedWriter writer = null;
... |
A22992 | A20811 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author dannocz
*/
public class InputReader {
public static Input r... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Dancing {
public static void main(String[] args) {
int numTestCases;
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
try {
numTestCases = Integer.parseInt(in.readLine());
... |
B12762 | B12724 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.File;
import java.io.FileInputStream;
import java.util.Scanner;
/**
*
* @author imgps
*/
public class C {
public static void main(String args[]) throws Exception{
int A,B;
int ctr ... | import java.util.Scanner;
public class C {
public static void main(String[] args) {
boolean[][] isPairs = new boolean[1001][1001];
for (int i = 1; i < 1000; i++) {
for (int j = i+1; j < 1001; j++) {
isPairs[i][j] = isPair(i, j);
}
}
Scanner ... |
A22642 | A21061 | 0 | import java.util.*;
import java.io.*;
public class DancingWithTheGooglers
{
public DancingWithTheGooglers()
{
Scanner inFile = null;
try
{
inFile = new Scanner(new File("inputB.txt"));
}
catch(Exception e)
{
System.out.println("Problem ope... | package com.coding.codejam;
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;
/**
* @author madhava
*
*/
public class B {
private static final int MAX_SCORE = 10;
... |
B13196 | B10832 | 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.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List;
public class ProblemB {
private static List<Integer> digits100(i... |
B21752 | B21681 | 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.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner scan = new Scanner(new File... |
A20382 | A20822 | 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 jam2012.qround;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
public class PB {
public static void main(String args[])
{
int line = 0;
try{
BufferedReader br = new BufferedReader(new FileReader("B-large.in"));
BufferedWriter bw ... |
B10485 | B13143 | 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.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class Reader {
public Case[] read() {
BufferedReader bf;
Case[] cases = null;
try {
bf = new BufferedReader(new FileReader("in"));
int numTestCase = Integer.parseIn... |
B11327 | B11335 | 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]);
}
}
}
| public interface Problem {
void solve();
Object getSolution();
}
|
A11917 | A11919 | 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.Scanner;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Arrays;
public class Dancing2
{
public static void main(String[] args) throws FileNotFoundException
{
Scanner in = new Scanner(new File("222.in"));
int numOfTests = Integer.parseInt(in.nextLine());
for(i... |
A22360 | A21160 | 0 | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Scanner;
public class Dancing_With_the_Googlers {
/**
* The first line of the input gives the ... | package com.google.codejam;
public class DancingGoogler {
public int solve(String str){
String[] arr = str.split(" ");
int n = Integer.valueOf(arr[0]);
int s = Integer.valueOf(arr[1]);
int p = Integer.valueOf(arr[2]);
int[] c = new int[n];
for (int i = 0; i < c.length; i++) {
c[i] = Integer.valueOf(arr... |
A13029 | A11949 | 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 codejam2012qual;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.Arrays;
import util.InputReader;
public class DancingGooglers implements Runnable {
priv... |
A21396 | A22056 | 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 clasificacion.dancing;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Dancing
{
public static void main(String[] args)
{
FileReader fr = null;
BufferedReader br = null;
FileWriter ... |
B10485 | B12740 | 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 es.saspelo.codejam.recyclednumbers;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import jav... |
B12762 | B12624 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.File;
import java.io.FileInputStream;
import java.util.Scanner;
/**
*
* @author imgps
*/
public class C {
public static void main(String args[]) throws Exception{
int A,B;
int ctr ... | import util.CombinationGenerator;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class SetUtil {
public static long getOne(int n) {
return 1<<n;
}
public static List<Integer> getList(long set, int n) {
ArrayList<Integer> integers = new ArrayList<>();
... |
B10245 | B12518 | 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.*;
public class QualC {
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int z = Integer.parseInt(br.readLine());
int[] ten = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000};
for(i... |
A11917 | A10657 | 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.Scanner;
import java.util.List;
import java.util.ArrayList;
class Dancing
{
public static void main(String... args)
{
Scanner sc = new Scanner(System.in);
int tests = sc.nextInt();
for (int test = 1; test <= tests; test++)
{
int n = sc.nextInt();
int s = sc.nextInt();
... |
A22992 | A21371 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author dannocz
*/
public class InputReader {
public static Input r... | import java.util.*;
public class Dancing {
public static void main( String[] args ) {
Scanner scan = new Scanner(System.in);
int cases = scan.nextInt();
for (int i = 0; i < cases; i++) {
int count = 0;
int n = scan.nextInt();
int s = scan.nextInt();
int p = scan.nextInt();
for( int j = 0; j < n; ... |
A10568 | A11576 | 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... | package com.google.codejam.qualrnd.dncingglers;
public class DancingGooglersInput {
private int noOfCases;
private GooglersScoreboard[] scoreboards;
public DancingGooglersInput() {
}
public DancingGooglersInput(int noOfCases) {
this.noOfCases = noOfCases;
}
public DancingGooglersInput(int noOfCase... |
B12570 | B13234 | 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.*;
import java.util.*;
public class QualC{
private BufferedReader in;
private StringTokenizer st;
private PrintWriter out;
void solve() throws IOException{
int kases = nextInt();
int kase = 0;
while(kases-->0){
kase++;
out.print("Case #"+kase+": ");
int a = nex... |
A22771 | A20280 | 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... | package common;
public interface ISolver {
String solve(String problem);
void addCase(String problem, String answer);
}
|
B21227 | B20582 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class RecylcedNumbers {
public static void main(String[] args) throws Exception {
Scanner in = new Scanner(new File("input.in"));
BufferedWriter bfr... |
A20119 | A20482 | 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 gcj2012qr;
import java.io.*;
import java.util.*;
import java.util.concurrent.*;
import com.google.*;
/**
* @author Roman Kosenko <madkite@gmail.com>
*/
public class DancingWithTheGooglers extends SingleThreadSolution<Object> {
public static void main(String[] args) throws Exception {
solve(new SolutionF... |
A12570 | A10161 | 0 | package util.graph;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
public class DynDjikstra {
public static State FindShortest(Node start, Node target) {
PriorityQueue<Node> openSet = new PriorityQueue<>();
Set<Node> closedSet = new HashSet<>();
openSet.add... | import java.io.*;
import java.util.*;
public class B {
public static void main(String args[]) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("B-small-attempt0.in"));
PrintWriter out = new PrintWriter(new FileWriter("B-small.out"));
int T = Integer.parseInt(in.readLine());
for(in... |
B10245 | B13075 | 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 c;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class C {
Set<Integer>[] c = new HashSet[2000001];
public C()
{
Scanner s = new Scanner(System.in);
int t = s.nextInt();
for(int i =0; i < t;i ++)
{
int a = s.nextInt();
int b = s.nextInt();
for(int j ... |
A12846 | A11719 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
public class CodeJamTextOutputWriter {
private final BufferedWriter writer;
CodeJamTextOutputWriter(File outputFile) throws IOException {
writer = new BufferedWriter(new FileWriter(outputFile));
}
publ... |
B11318 | B10783 | 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.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.io.ObjectInputStream.GetField;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.math.BigInteger;
public class C {
private static char[] alph;
p... |
B10702 | B11646 | 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 com.jp.common;
import java.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.PrintStream;
import java.util.Scanner;
public class InputOutputProcessor {
private int numberOfCases;
private boolean doesInputHaveDataSetLines;
private int indexOfDataSetLine;
p... |
B21207 | B20460 | 0 | /*
* Problem C. Recycled Numbers
*
* Do you ever become frustrated with television because you keep seeing the
* same things, recycled over and over again? Well I personally don't care about
* television, but I do sometimes feel that way about numbers.
*
* Let's say a pair of distinct positive integers (n, m) ... | import java.util.*;
public class RecycledNumber {
int digits;
Collection<String> set = new HashSet<String>();
public int countInInterval(int a, int b)
{
int count = 0, rotation;
String temp = ""+ a;
this.digits = temp.length();
for(int i = a; i<b; i++)
{
for(int j = 1; j<digits;j++)
{
ro... |
A12460 | A10131 | 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 com.googlecodejam;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.util.Scanner;
public class Dancing {
private final int ... |
A20382 | A22056 | 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 clasificacion.dancing;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Dancing
{
public static void main(String[] args)
{
FileReader fr = null;
BufferedReader br = null;
FileWriter ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.