F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
B12074 | B12328 | 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 main;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.uti... |
B21752 | B21966 | 0 | package Main;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
/**
* Created with IntelliJ IDEA.
* User: arran
* Date: 14/04/12
* Time: 3:12 PM
* To change ... | package ru.guredd.codejam;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
public class Main {
protected static List<String> inputData = new ArrayList<String>();
protected static List<String> outputData = new ArrayList<String>();
public static void loadInputData(String fileName) thr... |
B11327 | B11709 | 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 googlejam;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class RecycledNumbers {
public static void main(String[] args) throws FileNotFoundException {
Scanner sc = new Scanner(new File... |
A12846 | A11052 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam.common;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Lance Chen
*/
public class CodeHelper {
private static String FILE_ROOT = "D:/workspace/googlecodejam/meta";
publi... | import java.io.*;
import java.util.*;
public class B {
BufferedReader ins;
PrintStream outs;
static String INPUT = "B-small-attempt0.in";
static String OUTPUT;
static {
OUTPUT = "B.out";
}
public B(BufferedReader ins, PrintStream outs) {
this.ins = ins;
this.outs ... |
B20856 | B21592 | 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 com.mademoisellegeek.googlecodejam;
import com.mademoisellegeek.googlecodejam.y2012.qualround.DancingWithTheGooglers;
import com.mademoisellegeek.googlecodejam.y2012.qualround.RecycledNumbers;
import com.mademoisellegeek.googlecodejam.y2012.qualround.SpeakingInTongues;
public class GoogleCodeJam {
public... |
B21752 | B20522 | 0 | package Main;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
/**
* Created with IntelliJ IDEA.
* User: arran
* Date: 14/04/12
* Time: 3:12 PM
* To change ... | package 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... |
B11421 | B10189 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Recycled {
public static void main(String[] args) throws Exception{
String inputFile = "C-small-attempt0.in... | import java.util.Scanner;
import java.util.TreeSet;
public class C {
static TreeSet<Integer> s;
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner kb = new Scanner(System.in);
int t = kb.nextInt();
int c = 1;
int cnt, a, b;
while(t-- > 0)
{
... |
B12762 | B12740 | 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 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... |
A12273 | A12033 | 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 jp.funnything.competition.util;
import java.math.BigDecimal;
/**
* Utility for BigDeciaml
*/
public class BD {
public static BigDecimal ZERO = BigDecimal.ZERO;
public static BigDecimal ONE = BigDecimal.ONE;
public static BigDecimal add( final BigDecimal x , final BigDecimal y ) {
return... |
A21010 | A22005 | 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 qualif.problem2;
import java.util.Scanner;
public class DancingWithTheGooglers {
public int testCaseNb = 0;
private Scanner casesScanner;
public DancingWithTheGooglers(Scanner input){
try{
String nextLine = input.nextLine();
testCaseNb = new Integer(nextLine);
} finally{
}
this.casesSca... |
B20424 | B21220 | 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... | public class CodeJamUtils {
/**
* Makes sure that the line separator written by BufferedWriter is a single
* newline character
*/
public static void initLineEndings() {
System.setProperty("line.separator", "\n");
}
}
|
A22191 | A20990 | 0 | package com.example;
import java.io.IOException;
import java.util.List;
public class ProblemB {
enum Result {
INSUFFICIENT,
SUFFICIENT,
SUFFICIENT_WHEN_SURPRISING
}
public static void main(String[] a) throws IOException {
List<String> lines = FileUtil.getLines("/B-large.in");
int cases = Int... | package 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 = MultiMapKeyToSet.make();
map.put("a", ... |
B11318 | B10036 | 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.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
Scanner input;
try {
File in = new File(arg... |
B10149 | B10016 | 0 | import java.io.FileInputStream;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeSet;
// Recycled Numbers
// https://code.google.com/codejam/contest/1460488/dashboard#s=p2
public class C {
private static String process(Scanner in) {
int A = in.nextInt();
int B = in.nextInt();
int res =... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
public class R1P3 {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
BufferedReader in = new BufferedReader(new FileReader("C-small-attempt0.in"));
BufferedWrite... |
B12941 | B12500 | 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... |
//Author KNIGHT0X300
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
int t=s.nextInt();
long time = System.nanoTime();
for(int i=0;i<t;i++)
{ int tot=0;
int A=s.nextInt();
... |
B20291 | B21854 | 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.digiharbor.gene;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.Console;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
public class CJ2012 {
... |
B13196 | B10212 | 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 ... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Dimitris
*/
import java.io.*;
public class trito {
File ffff;
FileReader fr;
BufferedReader br;
File fout;
FileWriter fw;
BufferedWriter bw;
public static void main(... |
A12570 | A10838 | 0 | package util.graph;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
public class DynDjikstra {
public static State FindShortest(Node start, Node target) {
PriorityQueue<Node> openSet = new PriorityQueue<>();
Set<Node> closedSet = new HashSet<>();
openSet.add... | package be.mokarea.gcj.googledancers;
import be.mokarea.gcj.common.TestCase;
public class GoogleDancerTestCase extends TestCase {
private final int numberOfGooglers;
private final int numberOfSurprisingTripletsOfScores;
private final int scoreLowerBoundary;
private final int[] scores;
protected GoogleDancerTe... |
A10568 | A12268 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader (new... | import java.io.BufferedReader;
import java.io.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... |
B21207 | B20897 | 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.*;
public class RecycledNumbers {
public static void main(String[] args) {
BufferedReader in;
BufferedWriter out;
int T, i;
String line;
try {
in = new BufferedReader(new FileReader("input.txt"));
out = new BufferedWriter(new FileWriter("output.txt"));
} catch (FileNotFoundExce... |
A10568 | A12627 | 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 q2;
import java.util.Scanner;
public class DWG {
/**
* @param args
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for (int _t = 0; _t < t; _t++) {
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt();
int flo... |
A10793 | A12498 | 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 com.google.codejam;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
public class DancingWithGooglers {
public static void main(String argsp[]) throws NumberFormatException, IOException{
BufferedReader br = new BufferedReader(new I... |
A22191 | A22932 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class Dance {
Scanner in;
BufferedWriter out;
Dance(String input, String output) throws Exception {
in = new Scanner(new File(input));
FileWriter fs... |
A20119 | A20301 | 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.eduardcapell.gcj2012.qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.List;
import java.util.Vector;
public class B {
public static void main(String[] args) throws Exception {
B a = new B();
a.run();
}
public void run() throws Except... |
A22992 | A20264 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author dannocz
*/
public class InputReader {
public static Input r... | package problemB;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.Writer;
import java.util.Scanner;
public class DancingWithTheGooglers {
public static void main(String[] args) throws Exception {
Writer write = new FileWriter(new File("out.txt"));
Writer writer ... |
A20490 | A21433 | 0 | /**
*
*/
package hu.herba.codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io... | package com.google.jam.eaque.stub;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
public class InputFileManager {
private BufferedReader br;
public InputFileManager(String filePath) throws NumberFormatException,
IOException {
br = new BufferedReader(new FileReader(fileP... |
B21968 | B21213 | 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.util.*;
import java.io.*;
public class recycle {
public static int[] pow10 = {1,10,100,1000,10000,100000,1000000,10000000};
public static void main(String[] args) throws Throwable {
Scanner input=new Scanner(new File("recycle.in"));
PrintWriter out=new PrintWriter(new File("recycle.out"));
int ... |
A22992 | A22609 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author dannocz
*/
public class InputReader {
public static Input r... | package main;
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 TestClass {
public static void main (String[] args) throws IOException, InterruptedException {
... |
B20006 | B21809 | 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.IOException;
import java.lang.reflect.Array;
import java.util.*;
public class MBHappy extends JamProblem {
Map<Integer, Integer> baseMap;
Map<Long, Integer> minMap = new HashMap<>();
int ile = 0;
void prepare() {
SetUtil.cycleSubsets(bases.size(), new SetUtil.SubsetCallBack()... |
A12570 | A11609 | 0 | package util.graph;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
public class DynDjikstra {
public static State FindShortest(Node start, Node target) {
PriorityQueue<Node> openSet = new PriorityQueue<>();
Set<Node> closedSet = new HashSet<>();
openSet.add... | package com.codejam.two12.GooglerDance;
import java.util.ArrayList;
import java.util.Arrays;
import com.jp.common.Puzzle;
public class GooglerDance implements Puzzle{
private int numberOfGooglers;
private int surprisingTriplets;
private int parValue;
private int[] totalPointArray;
private int currentNumbe... |
B20856 | B21173 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
public class C {
public static void main(String args[]){
try{
BufferedReader br = new BufferedReader(new FileReader(args[0]));
String strTm... |
B12082 | B10363 | 0 | package jp.funnything.competition.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.apache.commons.io.IOUtils;
public class QuestionReader {
pr... | import java.io.*;
import java.util.StringTokenizer;
public class RecycledNumbers {
public static void main(String[] args) {
try {
BufferedReader ifStream = new BufferedReader(new FileReader("C.in"));
PrintWriter ofStream = new PrintWriter(new FileWriter("C.out"));
int numCase;
String inputCase;
numC... |
B20856 | B20255 | 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;
//... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package ex3;
import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
/**
*
* @author Jean-Nicolas
*/
public class Ex3 {
public static String readFile(File file) {
String result = "";
... |
B20856 | B21473 | 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.HashSet;
import java.util.Scanner;
import java.util.Set;
public class C {
/**
* @param args
*/
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
Set<String> recycled = new HashSet<String>();
int T = in.nextInt();
in.nextLine();
for (int i = 1; i <= T; ... |
A22191 | A21452 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package googlejam2;
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.IOExcepti... |
A21396 | A20734 | 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++){
... | public class MalformedInputFileException extends Throwable {
private static final long serialVersionUID = -6714074599343669185L;
public MalformedInputFileException() {
super();
}
public MalformedInputFileException(String message) {
super(message);
}
public MalformedInputFileException(String message, Throw... |
A12211 | A12647 | 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... | package net.mauhiz.contest.codejam.qual2012;
import java.io.IOException;
import net.mauhiz.contest.codejam.CodejamLineChunkSolver;
public class DancingGoogler extends CodejamLineChunkSolver {
public static void main(String... args) throws IOException {
new DancingGoogler().run(args);
}
@Override
protected St... |
B10149 | B10345 | 0 | import java.io.FileInputStream;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeSet;
// Recycled Numbers
// https://code.google.com/codejam/contest/1460488/dashboard#s=p2
public class C {
private static String process(Scanner in) {
int A = in.nextInt();
int B = in.nextInt();
int res =... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
public class C {
public final String INPUT_FILE_NAME = "c_in";
pub... |
A11917 | A11688 | 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.HashMap;
import java.util.Map;
import java.util.Scanner;
public class QuestionA extends Question{
private static Map<Character, Character> translationMap;
private static boolean isInit;
private StringBuilder sb;
public QuestionA(Result result, Counter counter)
{
super(result, counter);
if... |
A20490 | A22808 | 0 | /**
*
*/
package hu.herba.codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io... | import java.util.Scanner;
public class Dancing {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for(int i=0; i<T; i++)
{
int N = sc.nextInt();
int S = sc.nextInt();
int p = sc.nextInt();
// int [] score = new int[N];
int numPass = 0;
f... |
A12273 | A11011 | 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 probb;
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 S... |
B11421 | B10802 | 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... |
public class Pair {
private int first;
private int second;
public Pair(int first, int second) {
if (first < second) {
this.first = first;
this.second = second;
} else {
this.first = second;
this.second = first;
}
}
public int getFirst() {
return first;
}
public int getSecond() {
return sec... |
B11421 | B10685 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Recycled {
public static void main(String[] args) throws Exception{
String inputFile = "C-small-attempt0.in... | import java.io.*;
import java.util.*;
public class RecycledNumbers
{
public static void main(String [] args) throws Exception
{
BufferedReader br = new BufferedReader(new FileReader("CI.txt"));
String write = "";
int i = Integer.parseInt(br.readLine());
for(int j = 1; j <= i; j++)
{
String ra = br.read... |
A21396 | A21120 | 0 | import java.util.*;
public class Test {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int i = 1; i<=T; i++) {
int n = in.nextInt();
int s = in.nextInt();
int p = in.nextInt();
int result = 0;
for(int j = 0; j<n; j++){
... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package leider.ken;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Callable;
/**
*
* @author ken
*/
class DancingAlgorithm implements Callable<String> {
private final int caseNumb... |
B12570 | B11768 | 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 de.johanneslauber.codejam.model;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.List;
/**
*
* @author Johannes Lauber - joh.lauber@googlemail.com
*
*/
public abstract class BaseProblem implements IProblem {
protected List<ICase> listOfCases;
pr... |
A12570 | A10178 | 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.StringTokenizer;
import java.lang.Math;
public class qualifycodejamB{
public static int surprisePVal(int score){
if(score < 4){
if(score == 0){
return 0;
}else if(score == 1){
return 1;
}else{
return 2;
}
}
double dscore = (double) score;
if((dscor... |
A22191 | A21969 | 0 | package com.example;
import java.io.IOException;
import java.util.List;
public class ProblemB {
enum Result {
INSUFFICIENT,
SUFFICIENT,
SUFFICIENT_WHEN_SURPRISING
}
public static void main(String[] a) throws IOException {
List<String> lines = FileUtil.getLines("/B-large.in");
int cases = Int... | package com.renoux.gael.codejam.utils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.net.URISyntaxException;
import java.net.URL;
/**
* Pour tests unitaires
*
* @author renouxg
*/
public fin... |
B10149 | B11177 | 0 | import java.io.FileInputStream;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeSet;
// Recycled Numbers
// https://code.google.com/codejam/contest/1460488/dashboard#s=p2
public class C {
private static String process(Scanner in) {
int A = in.nextInt();
int B = in.nextInt();
int res =... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashSet;
public class RecycleNumber {
public static void solution(String fileName) throws IOException {
FileReader fileReader = new FileReader(new File(fileName));
BufferedReader bufferedRe... |
B21227 | B20476 | 0 | import java.util.HashSet;
import java.util.Scanner;
public class C {
static HashSet p = new HashSet();
static int low;
static int high;
int count = 0;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int no = sc.nextInt();
for (int i = 1; i <= no; i++) {
p.clear();
lo... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class RecycledNumber {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOEx... |
B10155 | B11283 | 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 qualification;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.Scanner;
public class C {
static int pow(int b)
{
return (int)Math.pow(10,b);
}
public static void main(String args[]) throws FileNotFoundException
{
Scanner sin=new Scanner(new Fil... |
B11318 | B10451 | 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 MyAllgoritmicLib;
public class BinnomNeutona {
public static int C(int k, int n){
return factorial(n)/(factorial(k)*factorial(n-k));
}
public static int factorial(int n){
int result = 1;
for(int i = n; i > 1; i--){
result *= i;
}
return result;
}
}
|
A20261 | A22882 | 0 | package com.gcj.parser;
public class MaxPoints {
public static int normal(int value){
int toReturn = 0;
switch (value) {
case 0 : toReturn = 0 ; break;
case 1 : toReturn = 1 ; break;
case 2 : toReturn = 1 ; break;
case 3 : toReturn = 1 ; break;
case 4 : toReturn = 2 ; break;
case 5 : toReturn = 2 ; b... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class Dancing {
private static int[] data;
public static void main(String[] args) throws IOException ... |
A11277 | A11492 | 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.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... |
B21207 | B21214 | 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.LinkedList;
import java.util.Scanner;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
/**
*Recycled Numbers
*/
/**
* @author Avengee
*/
public class Demo {
public static void main(String[] args) throws IOException {
//Reading and Writi... |
B10361 | B13171 | 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());... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
/**
*
*... |
A12460 | A10203 | 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.whitecrow.codejam2012.qualification;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.StringTokenizer;
public class B {
/**
* @param args
*/
public static void main(String[] args) {
St... |
A20382 | A21120 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package leider.ken;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Callable;
/**
*
* @author ken
*/
class DancingAlgorithm implements Callable<String> {
private final int caseNumb... |
A11135 | A11443 | 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.io.StreamTokenizer;
public class B {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(... |
A12113 | A11763 | 0 | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class B {
static int[][] memo;
static int[] nums;
static int p;
public static void main(String[] args)throws IOException
{
Scanner br=new Scanner(new File("B-small-attempt0.in"... | import java.util.*;
import java.io.*;
public class DancingWithGooglers {
public void translate() throws Exception {
Scanner sc = new Scanner(new FileReader("C:\\Users\\i047312\\Desktop\\B-small-attempt0.in"));
PrintWriter pw = new PrintWriter(new FileWriter("C:\\Users\\i047312\\Desktop\\output_small_B.txt"));
/... |
B12570 | B12484 | 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.*;
public class C {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int i=0; i<T; i++){
int A = sc.nextInt();
int B = sc.nextInt();
int count = 0;
for (int j=A; j<B; j++){
if (j<10) {continue;}
int[] recycles = recycles... |
B20734 | B21765 | 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... | package qualificationRound;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
public class Q3Recycled {
/**
* @param args
* @throws FileNotFoundException
*/
public static void main(String[] args) throws FileNotFoundException {
Scanner sc = new ... |
A12846 | A10737 | 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.util.*;
import java.io.*;
public class b{
public static int[] nums;
public static int[][] memo;
public static int p;
public static void main(String[] args) throws IOException{
Scanner br = new Scanner(new File("b.in"));
PrintWriter out = new PrintWriter(new File("b.out"));
int cases = br.nextInt()... |
A22078 | A21169 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
public class GooglersDancer {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated metho... | import java.io.*;
import java.util.*;
public class B{
public static void main(String[] args) throws Exception{
BufferedReader fin = new BufferedReader(new FileReader("B.txt"));
PrintWriter fout = new PrintWriter(new FileWriter("Bout.txt"));
String s = fin.readLine();
int t = Integer.parseInt(s);
s = fin.re... |
B10702 | B11707 | 0 | import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Recycle {
private static HashMap<Integer, HashSet<Integer>> map = new HashMap<Integer, HashSet<Integer>>();
private static HashSet<Integer> toSkip = new HashSet<Integer>();
/**
* @param args
*/
public static void main(S... | import java.util.*;
class Recycle
{
public static int[] combi = {0,0,1,3,6,10,16,21};
public static boolean[] bool;
public static int howMany(int x, int least, int greatest)
{
int rotate = x;
int pair = 1;
int i;
int j;
int dummy;
ArrayList<Integer> digit = new ArrayList<Integer>();
bool[rotate]=... |
A22191 | A20702 | 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.StringTokenizer;
/**
* @author Ivan Romanov
*/
public class B {
private String solve(int n) throws IOException {
int s = nextInt();
int p = nextInt();
int[] t = new int[n];
for (int i = 0; i < n; i++) {
t[i] = nextInt();
}
... |
B12762 | B11814 | 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 ... | /**
* Google CodeJam 2012
* Qualification round - Problem C
* Recycled Numbers
*
* Solved by Üllar Soon <positivew@gmail.com>
*/
package eu.positivew.codejam.recycled;
import java.io.File;
import java.util.ArrayList;
import eu.positivew.codejam.framework.CodeJamIO;
/**
* Recycled Numbers main class.
*
* ... |
A21396 | A21324 | 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 Codejam;
import java.util.HashMap;
import java.util.Scanner;
public class CodeJamB {
public static void main(String args[]){
Scanner scn = new Scanner(System.in);
int t = scn.nextInt();
int n;
int s;
int p;
int triplet;
int result;
int score;
for(int i = 0; i < t; i++){
n = scn.nex... |
A12113 | A12287 | 0 | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class B {
static int[][] memo;
static int[] nums;
static int p;
public static void main(String[] args)throws IOException
{
Scanner br=new Scanner(new File("B-small-attempt0.in"... | import java.util.Scanner;
public class B {
/**
* @param args
*/
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int nbr_case = scan.nextInt();
for(int i = 0; i < nbr_case; i++)
{
int N = scan.nextInt();
int S = scan.nextInt();
int p = scan.nextInt();
int poss... |
B11696 | B11529 | 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.DataInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
public class RecNum {
public static void main(String[] args) throws Exception {
// long start = System
String filename = "D:\\Hardik\\workspace\\CodeJam\\C-small-attempt2.in";
FileInputStream file = new FileInputSt... |
A13029 | A11860 | 0 | import java.util.List;
public class Case implements Runnable {
private int id;
private String output;
private int n;
private int s;
private int p;
private List<Integer> g;
public Case(int id) {
this.id = id;
}
public Case(int id, int n, int s, int p, List<Integer> g) {
super();
this.id = id;
this... | import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
public class Run2
{
public static void main(String[] args)
{
String path = "files/B-small-attempt1.in";
int T = 0;
ArrayList<ArrayList<Integer>> googlers = new ArrayList<ArrayList<Integer>>();
ArrayList<Integer> surpris... |
B21227 | B21091 | 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... | package codejam.is;
/**
* Created with IntelliJ IDEA.
* User: ofer
* Date: 4/13/12
* Time: 8:47 PM
* To change this template use File | Settings | File Templates.
*/
public interface Test {
/** Runs the test on the given input */
public void run(String input);
/** Returns the output of the test */
... |
A22992 | A20540 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.*;
public class B {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(new File("B.in"));
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("... |
B10245 | B12695 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | import java.util.*;
public class Recycle {
static boolean[][] recycled = new boolean[10000][10000];
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int T = scan.nextInt();
for (int i = 0; i < T; i++) {
int min = scan.nextInt();
int max = scan.nextInt();
int count = 0... |
B20566 | B21129 | 0 | import java.util.Scanner;
import java.io.*;
import java.lang.Math;
public class C{
public static int recycle(String str){
String[] numbers = str.split(" ");
int min = Integer.parseInt(numbers[0]);
int max = Integer.parseInt(numbers[1]);
int ret = 0;
for(int i = min; i < max; i++){
String num = i + "";
... | import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
public class WriteFile {
public static void write(String path, String content) throws IOException {
//BufferedWriter bw = new BufferedWriter(new FileWriter("C:\\test\\output.txt",false));
BufferedWriter bw = new BufferedWriter... |
B12570 | B10839 | 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.FileReader;
import java.io.PrintStream;
import java.util.HashSet;
/**
*
* @author peterboyen
*/
public class RecycledNumbers {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new FileReader("/Users/peterboye... |
A12113 | A11663 | 0 | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class B {
static int[][] memo;
static int[] nums;
static int p;
public static void main(String[] args)throws IOException
{
Scanner br=new Scanner(new File("B-small-attempt0.in"... | import java.util.Scanner;
public class ProblemB {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for (int tt = 1; tt <= t; tt++) {
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt();
int v[] = new int[n];
for (int i = 0; i < n; i... |
A12273 | A11619 | 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.sakthi.demo;
import java.io.File;
import java.util.Scanner;
/**
* @author Balaji
*
*/
public class GooglersDance {
/**
* @param args
*/
public static void main(String[] args) throws Exception{
// TODO Auto-generated method stub
// System.out.println("check");
Scanner in = new Sc... |
B12570 | B12946 | 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.*;
class Main {
public static void main( String[ ] args ) {
Scanner in=new Scanner(System.in);
int cin=in.nextInt();
for (int ci=1;ci<=cin;ci++){
int a=in.nextInt(),b=in.nextInt();
int ans=0;
for (int i=a;i<b;i++){
HashSet<Integer> la=new HashSet<Intege... |
A10699 | A12093 | 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.Scanner;
public class Dancing {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int numCases = sc.nextInt();
for (int i = 0; i < numCases; i++) {
int N = sc.nextInt();
int S = sc.nextInt();
int S_counter = S;
int p = sc.... |
B13196 | B12230 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Q3M {
public static void main(String[] args) throws Exception {
compute();
}
private ... | import java.util.*;
public class RecycledNumbers {
private final int A;
private final int B;
private final boolean[] allNumbers;
public RecycledNumbers(int A, int B) {
this.A = A;
this.B = B;
//numbers are A + i, where i is the array index
allNumbers = new boolean[B - A... |
A11277 | A11178 | 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 ... | /*
* 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... |
A12273 | A13114 | 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.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
public class Dance {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseIn... |
B11696 | B13089 | 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.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author viswas
*/
public class Recycled {
pub... |
A13029 | A12675 | 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 y2012;
import java.io.File;
import java.io.PrintWriter;
import java.util.Scanner;
public class QR2 {
public static void main(String[] args) throws Exception {
Scanner inputFile=new Scanner(new File(args[0]));
PrintWriter outputFile=new PrintWriter(new File(args[1]));
int t=Integer.parseInt(inputF... |
B21049 | B22223 | 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... | // Google Code Jam 2011
// lid
package Real;
import java.io.*;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.InputMismatchException;
import org.apache.commons.lang.ArrayUtils;
@SuppressWarnings("unused")
class ... |
A20261 | A20036 | 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 SolnB;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.*;
public class ProbB {
/**
* @param args
*/
public static void main(String[] args) throws IOException{
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
FileOutputStream out = new FileOutpu... |
B12085 | B11965 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class Main {
BufferedReader in;
StringTokenizer st;
PrintWriter out;
private String inFilename = "in.txt";
private String outFilename = "out.txt";
boolean can(int a, int b) {
String s1 = String.valueOf(a);
String s2 = String.val... |
B12074 | B12422 | 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 blacky.codejam.qualifications;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumbers {
private static class Pair {
final public int m;
final public int n;
public Pair... |
A12544 | A10878 | 0 | package problem1;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Arrays;
public class Problem1 {
public static void main(String[] args) throws FileNotFoundException, IOException{
try {
TextIO... | import java.io.File;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Scanner;
public class answer {
public static int solve(int N, int S, int P, int[] googler) {
int greater = 0;
int score;
for (int i = 0; i < N; i++) {
score = googler[i... |
B12082 | B11508 | 0 | package jp.funnything.competition.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.apache.commons.io.IOUtils;
public class QuestionReader {
pr... | import java.util.Scanner;
import java.util.TreeMap;
public class RecycledNumbers {
public static void main(String[]args){
Scanner sc = new Scanner(System.in);
//Read in the T int -- Test Cases
int T = Integer.parseInt(sc.nextLine());
for (int t = 1; t <= T; t++) {
int num = 0;
//START OF CODE
int a ... |
A12846 | A10183 | 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 codejam;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
public class fileHandler {
FileInputStream input;
FileOutputStream output;
BufferedReader buf;
public... |
A10568 | A11649 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package uk.co.epii.codejam.common;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author jim
*/
public class FileLoader {
public F... |
B21752 | B20539 | 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 ... | public class MalformedInputFileException extends Throwable {
private static final long serialVersionUID = -6714074599343669185L;
public MalformedInputFileException() {
super();
}
public MalformedInputFileException(String message) {
super(message);
}
public MalformedInputFileException(String message, Throw... |
B20734 | B20825 | 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 problem.c;
import java.util.Scanner;
import java.io.*;
/**
*
* @author Jason
*/
public class ProblemC {
/**
* @param args the command line arguments
*/
public static void main(String[] args... |
A22771 | A21080 | 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 test;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
public class DancingWithTheGooglers {
/**
* @param args
*/
public static void main(String[] args) {
PrintWriter out = null;
BufferedReader... |
B10155 | B10467 | 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 mairbek.codejam;
import com.google.common.collect.Lists;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
public class SolutionC {
public static void main(String[] args) {
List<Pair<Integer, Integer>> input = parseInputFile("50\n" +
"146 982\n" +
... |
B12570 | B13043 | 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 QualificationRoundC {
public static int power(int i, int p){
int k = 1;
for(int j = 0; j < p; j++)
k *= i;
return k;
}
public static int recycle(int n, int k){
int d = power(10, k);
int e = power(10, numD... |
B20006 | B20155 | 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 {
... |
public class Recycled {
JamInputReader ir;
public Recycled(String fileName) {
ir = new JamInputReader(fileName);
int t = ir.getNumItems();
for(int i = 0; i < t; i++) {
System.out.println("Case #" + (i + 1) + ": " + proc(ir.getNextItem(), ir.getNextItem()));
}
}
int proc(String A, String B) {
i... |
B12762 | B10224 | 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 Qualification;
import java.util.*;
import java.io.*;
public class C {
private static boolean checkRecycling2( String n, String m ){
String last;
String first;
int status = 0;
for( int pos=n.length()-1; pos>0; pos-- ){
last = n.substring(pos);
first = n.substring(0, pos);
//System.o... |
A11201 | A13018 | 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.google.codejam.googlers;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
/**
*
* Class to generate Test Report.
* @author Sushant Deshpande
*/
public class OutputRecorder {
/**
* Method for generating Test Report.
* @param te... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.