F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
A20490 | A22187 | 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.ArrayList;
import java.util.List;
public class Main {
public static void main(String[] args) {
List<String> lstLinesOutput = new ArrayList<String>();
List<String> lstLinesInput = FileReaderHandler.openFile("/home/guillaume/Bureau/input");
for(int n=1;n< Integer.parseInt(lstLinesInput.get(... |
A12211 | A10118 | 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 GCJ;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class ProblemB {
public static void main(String args[]) throws IOException{
File file = new File("I:/res/ACMCS/GCJ/B-small-attempt0.in");
File outFile = new Fil... |
B12074 | B10160 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package cj2012;
/**
*
* @author aaron
*/
public class ACj2012 {
public static void main(String[] args) {
//System.out.println(recyclePairs("1111 2222"));
dataOut(processData(getData("C-small-attempt0.in... |
A21557 | A22919 | 0 | import java.io.*;
import java.util.*;
public class DancingWithGooglers {
public static class Googlers {
public int T;
public int surp;
public boolean surprising;
public boolean pSurprising;
public boolean antiSurprising;
public boolean pAntiSurprising;
public Googlers(int T, int surp) ... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class DancingWithTheGooglers {
/**
* @param args
*/
public static void main(String[] args) {
int T = -1;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)... |
A22191 | A22455 | 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.ArrayList;
import java.util.List;
public abstract class JamProblem {
int caseCount;
int lastLine;
abstract String solveCase(JamCase jamCase);
abstract JamCase parseCase(List<String> file, int line);
List<String> loadFile() throws IOException {
FileReader... |
B10858 | B10261 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| package qualification;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
import core.ExtendedBufferedReader;
import core.Template;
public class ProblemC extends Template {
int _numberOfCases;
Vector<List<Integer>> _cases = new Vector<List<Integer>>();
@Override
public void feedData(Ex... |
B21270 | B21016 | 0 | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
public class CopyOfCopyOfMain {
static int ndigits(int n) {
return (int) (Math.log10(n) + 1);
}
static i... | import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class Recycled {
private int A;
private int B;
private int pairs;
/**
* Constructor
*
* @param a
* @param b
*/
public Recycled(... |
B21207 | B21836 | 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.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class C {
public static void main(String[] args) throws Exception{
new C().solve(args[0]);
}
private void solve(String file) throws Exception {
Scanner s = new Scanner(new File(file));
int x=s.nextInt()... |
A12211 | A12826 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class Dancing_improved {
static int f_Superan_limites(String params){
int superan_limite=0;
String[] para... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class FileRW {
public static List<String> readFile(String fileName) throws IOException{
List<String> lines... |
A10996 | A12417 | 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.*;
import java.util.*;
public class test2
{
public static void main(String[] args) throws Exception
{
new test2().run();
}
PrintWriter out = null;
boolean isOK(int n, int p, boolean s)
{
int a = n / 3;
if (n % 3 != 0)
a++;
if (a >= p)
return true;
if (s)
{
return 3 * p - ... |
A10793 | A13127 | 0 | import java.io.*;
import java.math.*;
import java.util.*;
import java.text.*;
public class b {
public static void main(String[] args) {
Scanner sc = new Scanner(new BufferedInputStream(System.in));
int T = sc.nextInt();
for (int casenumber = 1; casenumber <= T; ++casenumber) {
... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
class IOSystem {
private String filePath;
private List<String> inputList = new ArrayList<String>... |
A11502 | A13053 | 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.InputStreamReader;
public class B {
void run() {
try {
BufferedReader bfd = new BufferedReader(new InputStreamReader(
System.in));
int tc = Integer.parseInt(bfd.readLine()), i, j, k, s, p, goo[], surp[],
res[], t, r, cnt;
boolean[] taken;
Strin... |
B13196 | B10571 | 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.io.*;
import java.util.Scanner;
public class C_2012 {
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(System.in);
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("test.out")));
int c = in.nextInt();
for(int cases=0;c... |
B21049 | B20522 | 0 | package it.simone.google.code.jam2012;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumber implements GoogleCodeExercise {
int a = 0;
int b = 0;
Set<Couple> distinctCouple = null;
long maxTime = 0;
private class Couple {
int x = 0;
int y = 0;
public Couple(int x, int y) {
this... | package 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... |
B21049 | B21559 | 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.FileReader;
import java.io.FileWriter;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumbers {
private static final String fname = "C-large.in";
public static void main(String[] args) throws Exception {
new Recycle... |
A12211 | A11459 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class Dancing_improved {
static int f_Superan_limites(String params){
int superan_limite=0;
String[] para... | import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
public class source {
public static void main(String args[ ]) throws IOException {
FileInputStream fstream = new ... |
B12762 | B13113 | 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 com.vp.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... |
A22771 | A21199 | 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;
/*
* el resto es 0 --> puede ser caso especial y no
* 15 --> 5 5 5 ó 4 5 6
* el resto es 1 --> puede ser caso especial y no
* 16 --> 4 6 6 ó 5 5 6
* el resto es 2 --> puede ser caso especial y no
* 17 --> 5 7 7 ó 5 6 6
*/
public class B {
public static void main(String[] ar... |
B20566 | B21391 | 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.*;
import java.util.*;
import java.math.*;
import java.text.*;
public class RecycledNumbersHard {
static final int INF = 1 << 28, MAX = 1000;
static final double EPS = 1E-9;
static int digits(int x) {
int d;
for (d = 0; x > 0; d++)
x /= 10;
return d;
}
static int hash(int m, int d) {... |
B12115 | B10179 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gjam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
/**
*
* @author iNahoo
*/
public cla... |
A21010 | A20282 | 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.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class DancingWithTheGooglers {
public static void main(String[] args) throws IOException {
File input = new File("files/B-large.in.txt");
File output = new File("files/B-large.out.txt");
PrintWriter pw... |
A12113 | A12736 | 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"... | package main;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
public class MyTest {
public int getNumOfGoogler(int S, int p, List<Integer> points) {
if(p == 0) {
return points.size... |
B20566 | B20397 | 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.*;
import java.io.*;
public class RecycledNumbers {
private static int numTest;
private static Scanner input;
private static PrintWriter output;
public static void main(String[] args) throws FileNotFoundException, IOException {
// Initialization of Input/Output streams
input = new Scanner... |
A22360 | A22794 | 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 gcjqrpb;
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.StringTokenizer;
public class gcjqrpb {
public static void main(String[] args) {
//variables
int T... |
A12273 | A11542 | 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.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.Arrays;
import java.util.Scanner;
public class B {
/**
* @param args
* @throws IOException
*/
public... |
A12570 | A13068 | 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.BufferedWriter;
import java.io.FileWriter;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Scanner;
public class GCJ3 {
/**
* @param args
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] hold = new int[n];
f... |
A22078 | A22911 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Dancing {
/**
* @param args
*/
public static void main(String[] args) {
try {
... |
A11917 | A12052 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package googlecodejamqualifier;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
*
* @author Dean
*/
public class DancingWithGooglers {
public static void main(Str... |
B11421 | B12189 | 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 google;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Set;
import java.util.StringTokeniz... |
A20730 | A20534 | 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.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class Dancing {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(new File("B-large.in"));
FileWrite... |
A20730 | A22598 | 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.util.Scanner;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Chamika
*/
public class GDance {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int cases = s.nextInt();
... |
A21010 | A20032 | 0 | package codejam;
import fixjava.Pair;
public class Utils {
public static long minLong(long firstVal, long... otherVals) {
long minVal = firstVal;
for (int i = 0; i < otherVals.length; i++)
minVal = Math.min(firstVal, otherVals[i]);
return minVal;
}
public static int minInt(int firstVal, int... otherVals... | import java.io.*;
import java.util.*;
public class GoogleDancing {
public static void main(String[] args) throws IOException {
BufferedReader read = new BufferedReader(new FileReader("B-large.in.txt"));
int T = Integer.parseInt(read.readLine());
for(int i = 1; i <= T; i++){
StringTokenizer st = new StringToke... |
A20490 | A22870 | 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 googleCodeJam;
import java.io.*;
import java.util.*;
public class ThirdExercise {
/**
* @param args
*/
public static void main(String[] args) {
try{
FileInputStream fstream = new FileInputStream("B-large.in");
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new Buffer... |
A20119 | A20314 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... |
import java.io.FileNotFoundException;
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.Scanner;
/**
*
* @author dafferianto
*/
public class DancingWithTheGooglers {
private st... |
B12085 | B11640 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | package codejam;
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 Recycled {
public static void main(String[] args) throws IOException
{
Scanner scan... |
A11917 | A11812 | 0 | package com.silverduner.codejam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
public class Dancing {
public static void main(String[] args) throws Exception {
File input = new File("B-small-attempt... | import java.io.*;
import java.util.*;
public class Second2
{
public static void main(String[]args)throws Exception
{
BufferedReader br = new BufferedReader(new FileReader("B-small-attempt3.in"));
PrintWriter pw = new PrintWriter(new File("B-small-attempt3.out"));
StringTokenizer st;
int cases = Integer.parse... |
B12669 | B11386 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package year_2012.qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.... | import java.io.*;
import java.util.*;
public class Main implements Runnable {
Scanner in = new Scanner(System.in);
HashMap map;
long[] cnt = new long[2000000];
public Integer[] findPartner(int n) {
ArrayList<Integer> arr = new ArrayList<Integer>();
String num = String.valueOf(n);
for (int i = 1;... |
B12762 | B10722 | 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;
import java.io.*;
public class Pair {
public static int a, b, l;
public static boolean inr(String x) {
int t = Integer.parseInt(x);
if ((t + "").length() != l) return false;
if (t <= b && t >= a) {
return true;
}
else return false;
}
public static String t... |
A20382 | A20836 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... | import java.io.*;
import java.util.*;
public class DanceScore
{
int score;
boolean surprise = false;
boolean madeIt = false;
public DanceScore(int score)
{
this.score = score;
}
private void p(String p)
{
//System.out.println(p);
}
public void process(int bestResult)
{
int goal = bestResult-2;
... |
B20006 | B21466 | 0 | import java.io.*;
import java.math.BigInteger;
import java.util.*;
import org.jfree.data.function.PowerFunction2D;
public class r2a
{
Map numMap = new HashMap();
int output = 0;
/**
* @param args
*/
public static void main(String[] args)
{
r2a mk = new r2a();
try {
... | package com.renoux.gael.codejam.utils;
import java.util.Date;
public class Timer {
private static long timestamp;
public static void start() {
timestamp = new Date().getTime();
}
public static String check() {
long delay = (new Date().getTime() - timestamp);
long seconds = delay / 1000;
long millis = ... |
A21010 | A22339 | 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 qualifier;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Map;
import java.util.Scanner;
public class TB {
private Map<Character, Character> translate = null;
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
PrintWr... |
B10245 | B12546 | 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.File;
import java.lang.StringBuilder;
import java.util.Scanner;
import java.io.FileWriter;
public class RN {
public static void main(String[] args) throws Exception{
File input = new File("C-small-attempt1.in");
File output = new File("output.out");
FileWriter fw = new FileWriter(output);
Sca... |
A11201 | A11335 | 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.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Dancing_with_the_googlers {
public static int s;
public static int max(int x, int s, final int sMax, int p) {
int tmp, i = 0, mm = 0, maxx = 0... |
B10361 | B13163 | 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());... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class Test {
public static void main(String[... |
B21207 | B20279 | 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.*;
import java.io.*;
import java.math.*;
import java.awt.*;
import static java.lang.Math.*;
import static java.lang.Integer.parseInt;
import static java.lang.Double.parseDouble;
import static java.lang.Long.parseLong;
import static java.lang.System.*;
import static java.util.Arrays.*;
import static jav... |
A12211 | A11829 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class Dancing_improved {
static int f_Superan_limites(String params){
int superan_limite=0;
String[] para... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.Arrays;
/**
* Created with IntelliJ IDEA.
* User: vikash
* Date: 14/04/12
* Time: 9:51 AM
* To change this template use File | Settings | File Templates.
*/
public class DancingGoo... |
A21010 | A21983 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class B {
static PrintWriter out;
public static void main(String[] args) throws IOException {
String name = "B-large";
Scanner s = new Scanner(n... |
A21396 | A20603 | 0 | import java.util.*;
public class Test {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int i = 1; i<=T; i++) {
int n = in.nextInt();
int s = in.nextInt();
int p = in.nextInt();
int result = 0;
for(int j = 0; j<n; j++){
... | package com.snap.training;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
public class DancingGooglers {
public static ArrayList<String> readFromFile()
{
ArrayList<String> inputList = new... |
B12941 | B10610 | 0 | package com.menzus.gcj._2012.qualification.c;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class CProcessorFactory extends AbstractProcessorFactory<CInput, COutputEntry> {
public CProcessorFactory(Str... | import java.util.*;
class Recycle
{
public static int compute(int lowerBound, int upperBound)
{
int count = 0;
int numDigits = 1 + (int)Math.log10(lowerBound);
int new_num, cut;
boolean[] check = new boolean[upperBound-lowerBound+1];
boolean[] check2;
if(lowerBound/10 == 0)
retur... |
B12941 | B11721 | 0 | package com.menzus.gcj._2012.qualification.c;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class CProcessorFactory extends AbstractProcessorFactory<CInput, COutputEntry> {
public CProcessorFactory(Str... | import java.io.*;
import java.util.*;
class recycledNumbers{
public static void main(String arg[]){
System.out.println("Please Enter the name of your file");
Scanner input = new Scanner(System.in);
String fileName = input.next();
recycle(fileName);
}
public static void recycle(String fileName){
... |
B20424 | B20185 | 0 | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
// static int MAX = 10000;
static int MAX = 2000000;
static Object[] All = new Object[MAX+1];
static int size( int x ) {
if(x>999999) return 7;
if(x>99999) return 6;
if(x>9999) return 5;
if(x>999) retu... | package com.codejam.practice;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;
public class Recycled {
public static void main(String[] args) {
/... |
A11502 | A10951 | 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.File;
import java.io.FileReader;
public class Reader {
private String fileName;
private BufferedReader reader;
public Reader(String fileName){
this.fileName= fileName;
}
public void open() throws Exception{
reader = new BufferedReader(new FileReader(new File(... |
B10485 | B10387 | 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.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;
public class Prob3 {
/**
* @param args
* @throws FileNotFoundException
*/
public static void main(String[] args) throws FileNotFoundException {
Scanner scan = new Sc... |
B10245 | B11325 | 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 recycledNumbers;
public class InputData {
private int Test_Number;
public int getTest_Number() {
return Test_Number;
}
public int[] getA() {
return A;
}
public int[] getB() {
return B;
}
private int [] A;
private int [] B;
public InputData(int Test_Number, int [] A, int [] B){
this.T... |
B20006 | B21239 | 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 codejam;
import java.util.*;
/**
*
* @author JoeJev
*/
public class ProblemC {
Scanner scan;
public ProblemC(Scanner scan) {
this.scan = scan;
}
public void processProblem(){
int cases = scan.nextInt();
for (int m = 1; m <= cases; m++){
System.out.... |
B12669 | B12751 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package year_2012.qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.... | package codejam03;
import java.io.*;
import java.util.StringTokenizer;
public class CodeJam03
{
public static void main(String[] args) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int T,A,B;
String temp1,temp2;
int output,n;
... |
B22190 | B21421 | 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.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.TreeSet;
public class prob2 {
private static long oneTest(int a, int b){
boolean [] bool=... |
B20734 | B21809 | 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.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()... |
B10702 | B12887 | 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.techy.rajeev;
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 Recycled {
public static int[] toIntArray(String line){
String[] p = line.trim().split("\\s+");
int[] out = n... |
A12544 | A12742 | 0 | package problem1;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Arrays;
public class Problem1 {
public static void main(String[] args) throws FileNotFoundException, IOException{
try {
TextIO... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
public class ProblemB {
static Map<Integer, Score[]> scores;
public static void main(String[] args){
scores = new HashMap<Integer, Score[]>();
scores.put(0, new S... |
B10899 | B11015 | 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(... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author AlexR
*/
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
public class PrintResult {
FileOutputStream fout;
PrintStream fstream;
public ... |
A20382 | A20603 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... | package com.snap.training;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
public class DancingGooglers {
public static ArrayList<String> readFromFile()
{
ArrayList<String> inputList = new... |
A13029 | A12280 | 0 | import java.util.List;
public class Case implements Runnable {
private int id;
private String output;
private int n;
private int s;
private int p;
private List<Integer> g;
public Case(int id) {
this.id = id;
}
public Case(int id, int n, int s, int p, List<Integer> g) {
super();
this.id = id;
this... | package com.mademoisellegeek.googlecodejam;
import com.mademoisellegeek.googlecodejam.y2012.qualround.DancingWithTheGooglers;
import com.mademoisellegeek.googlecodejam.y2012.qualround.SpeakingInTongues;
public class GoogleCodeJam {
public static void main(String[] args) {
new Thread(new DancingWithTheGoo... |
B10245 | B12028 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | import java.util.*;
import java.io.*;
public class Main {
final static String FNAME = "A-small-practice";
public BufferedReader in;
public PrintWriter out;
void open() throws IOException {
in = new BufferedReader( new FileReader( new File( FNAME + ".in" ) ) );
out = new PrintWriter( new File( FNAME + "... |
A12273 | A12907 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Dancing
* Jason Bradley Nel
* 16287398
*/
import java.io.*;
public class Dancing {
public static void main(String[] args) {
In input = new In("input.txt");
int T = Integer.parseInt(input.... | import java.util.Scanner;
public class QualB
{
public static void main(String args[])
{
Scanner kb = new Scanner(System.in);
int ntc = kb.nextInt();
for(int tc=0;tc<ntc;tc++)
{
int n = kb.nextInt();
int s = kb.nextInt();
int p = kb.nextInt();
int ti;
int sc = 0;
int y = 0;
for(int t=... |
A22191 | A22018 | 0 | package com.example;
import java.io.IOException;
import java.util.List;
public class ProblemB {
enum Result {
INSUFFICIENT,
SUFFICIENT,
SUFFICIENT_WHEN_SURPRISING
}
public static void main(String[] a) throws IOException {
List<String> lines = FileUtil.getLines("/B-large.in");
int cases = Int... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.File;
import java.util.List;
import java.util.ArrayList;
public class GCJ_qr_b {
public static void main(String[] args) {
GCJReader in = new GCJReader(args[0]);
GCJWriter out = ne... |
B10361 | B10045 | 0 | package codejam;
import java.util.*;
import java.io.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("in.txt"));
PrintWriter out = new PrintWriter(new File("out.txt"));
int T = Integer.parseInt(in.readLine());... |
package codejam;
import java.io.*;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
/**
*
* @author Ronak
*/
public class C {
public static void main(String[] args) throws FileNotFoundException, IOException {
File f = new File("C-small-attempt1.in");
Fi... |
B10155 | B12849 | 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... |
public class RecycledPair {
public int num1;
public int num2;
public RecycledPair(int n1, int n2) {
this.num1 = n1;
this.num2 = n2;
}
@Override
public String toString() {
return "(" + num1 + ", " + num2 + ")";
}
@Override
public boolean equals(Object obj) {
if(obj instanceof RecycledPair) {
... |
B22190 | B20383 | 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.io.*;
import java.util.*;
class Q3
{
public static void main(String str[])throws IOException
{
// long time1=System.currentTimeMillis();
// FileReader fr=new FileReader("C-small-attempt0.in");
FileReader fr=new FileReader("C-large.in");
BufferedReader br=new BufferedRea... |
A12273 | A10461 | 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.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class DancingWithTheGooglers {
static int surprise;
public static void main(String[] args) throws IOException{
BufferedReader in = new BufferedReader(new FileRe... |
A12460 | A11900 | 0 | /**
*
*/
package pandit.codejam;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Scanner;
/**
* @author Manu Ram Pandit
*
*/
public class DancingWithGoogle... |
import java.util.Scanner;
public class Dancer{
private static int t;
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
t=in.nextInt();
in.nextLine();
// System.out.println(t+" Cases");
for (int i=0;i<t;i++){
int n=in.nextInt... |
A20934 | A22696 | 0 | import java.util.*;
public class B {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
B th = new B();
for (int i = 0; i < T; i++) {
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt()... | import java.util.Scanner;
import java.io.File;
import java.io.FileWriter;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.FileNotFoundException;
public class Dance {
public static void main(String[] args)
{
File f = new File("B-large.in");
try
{
Scanner scan = new Scanner(f);
... |
A10699 | A11738 | 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) ... |
public class Scores {
private int N; // Number of Googlers
private int S; // Number of surprising triplets of scores
private int p; // Score at least
private int[] t; // total point of Googlers
public Scores(String str) {
String[] tmpArr = str.split(" ");
N = Integer.parseInt(tmpArr[0]);
S = Integer.p... |
B10231 | B10179 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gjam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
/**
*
* @author iNahoo
*/
public cla... |
A11135 | A11831 | 0 | /**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/3/12
* Time: 11:00 AM
* To change this template use File | Settings | File Templates.
*/
import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;
import java.io.*;
import java.util.*;
import java.uti... | package googlers;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Main {
public static int calcWIS(int n){
if(n - 2 < 0)
return 0;
return ((n - 2) / 3) + 2;
}
public static int calcWOS(int n){
if(n - 1 < 0)
return 0;
return ((n - 1) / 3) + 1;
}
... |
A21557 | A21038 | 0 | import java.io.*;
import java.util.*;
public class DancingWithGooglers {
public static class Googlers {
public int T;
public int surp;
public boolean surprising;
public boolean pSurprising;
public boolean antiSurprising;
public boolean pAntiSurprising;
public Googlers(int T, int surp) ... | package qualification;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class ProblemB {
/**
* @param args
*/
public static String input = "B-large.in";
public static void main(String[] args) throws IOException {
/... |
A10568 | A11365 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader (new... |
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.HashMap;
public class Googlers {
public static void main(String[] args) throws Exception{
String inpu... |
A12460 | A12297 | 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.google.codejam;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class DancingGooglers {
public static void main(String[] args) throws FileNotFoundException {
new DancingGooglers().run();
}
private stati... |
A20119 | A22269 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Solution2 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
// System.out.... |
B12941 | B12182 | 0 | package com.menzus.gcj._2012.qualification.c;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class CProcessorFactory extends AbstractProcessorFactory<CInput, COutputEntry> {
public CProcessorFactory(Str... | import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Problem3_C {
public static void main(String[] args) throws FileNotFoundException {
Scanner scanner = new Scanner(new File("C-small-attempt0.in"));
int num = scanner.nextInt();
for(int count = 1 ; count <= num ; ... |
B21752 | B21695 | 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 reusable;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
public abstract class CodeJamBase {
private final List<String> inputLines;
private final String filename;
private int testCases;
... |
A22191 | A20689 | 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 qualification.b;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
/**
*
* 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 score... |
B12669 | B11897 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package year_2012.qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.... | import java.io.File;
import java.util.Scanner;
public class RecycledNumbers {
private static Scanner scan;
private static File file = new File("C-small-attempt0.in");
public static void main(String[] args) throws Exception {
scan = new Scanner(file);
int total = scan.nextInt();
int A, B;
for (int t = 1; t ... |
B10702 | B10912 | 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 Test1;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Test1 {
public static void main(String[] args) {
String temp1 = null;
String temp2 = null;
int n,a,b;
BufferedReader in = new BufferedReader(new InputStreamReader(System.in)) ;
try {
String str... |
B12074 | B10196 | 0 | package jp.funnything.competition.util;
import java.math.BigInteger;
/**
* Utility for BigInteger
*/
public class BI {
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger add( final BigInteger x , final BigInteger y ) {
return... | import java.io.*;
import java.util.*;
public class recycle
{
public static StringTokenizer st;
public static void main(String[] args)
{
try
{
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream("C-small-attempt0.in")));
PrintWriter pw = new PrintWriter(new FileWriter("output... |
B21207 | B21832 | 0 | /*
* Problem C. Recycled Numbers
*
* Do you ever become frustrated with television because you keep seeing the
* same things, recycled over and over again? Well I personally don't care about
* television, but I do sometimes feel that way about numbers.
*
* Let's say a pair of distinct positive integers (n, m) ... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.... |
B20424 | B20506 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.*;
import java.util.Scanner;
/**
*
* @author Mash
*/
public class Main {
public st... |
A22771 | A20538 | 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 DancingWiththeGooglers {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for (int index = 1; index <= T; index++) {
int N = in.nextInt();
int S = in.nextInt();
int p = in.nextInt();
int count = 0;
int mat... |
A12570 | A10558 | 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.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.Scanner;
public class B {
public static void main(String[] args) throws FileNotFoundException {
Scanner scan = new Scanner(new File("B-small-attempt1.in"));
System.setOut(new PrintStream("B-small-attempt1.out")... |
B20291 | B20482 | 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 test.googlejam.year2012.jam;
import java.io.IOException;
import org.apache.commons.lang.StringUtils;
import test.googlejam.base.ProblemProcessor;
import test.googlejam.base.ValueReader;
public class RecycledNumbers extends ProblemProcessor
{
static java.util.Map<Integer, Integer> mapping = new java.util.T... |
A22642 | A23037 | 0 | import java.util.*;
import java.io.*;
public class DancingWithTheGooglers
{
public DancingWithTheGooglers()
{
Scanner inFile = null;
try
{
inFile = new Scanner(new File("inputB.txt"));
}
catch(Exception e)
{
System.out.println("Problem ope... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.PrintWriter;
public class Main2 {
public static final String fileName = "A-small-attempt0.in";
/**
* @param args
* @throws FileNotFoundException
*/
public static void main(Stri... |
A20490 | A21184 | 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... | /**
* Copyright 2012 Christopher Schmitz. All Rights Reserved.
*/
package com.isotopeent.codejam.lib.converters;
import com.isotopeent.codejam.lib.InputConverter;
public class StringLine implements InputConverter<String> {
private String input;
@Override
public boolean readLine(String data) {
input = data;... |
A12570 | A11301 | 0 | package util.graph;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
public class DynDjikstra {
public static State FindShortest(Node start, Node target) {
PriorityQueue<Node> openSet = new PriorityQueue<>();
Set<Node> closedSet = new HashSet<>();
openSet.add... | import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
public class B{
Scanner sc=new Scanner(System.in);
int INF=1<<28;
double EPS=1e-9;
int caze, T;
int n, s, p;
int[] ts;
void r... |
B12762 | B12454 | 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.io.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader bfr = new BufferedReader(
new InputStreamReader(System.in));
PrintWriter pr = new PrintWriter(System.out);
int n = Integer.parseInt(bfr.readLine());
for (int i = 1; i <= n; i++) {
... |
B21968 | B21595 | 0 | import java.util.*;
import java.io.*;
public class recycled_numbers {
public static void main(String[]a) throws Exception{
Scanner f = new Scanner(new File(a[0]));
int result=0;
int A,B;
String n,m;
HashSet<String> s=new HashSet<String>();
int T=f.nextInt(); //T total case count
for (int t=1; t<=T... | import java.io.*;
import java.util.*;
public class Prob3 {
public static PrintStream out;
public static int caseNum;
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(new File("in.txt"));
out = new PrintStream(new File("out.txt"));
int numCases = Integer.parseInt(sc.nextLine(... |
A22378 | A21078 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class CodeJam {
// public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt";
public static final String INP... | package QualRound;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class DancingWiththeGooglers {
String inFile = "c:/temp/DancingWiththeGoogle... |
B21752 | B21682 | 0 | package Main;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
/**
* Created with IntelliJ IDEA.
* User: arran
* Date: 14/04/12
* Time: 3:12 PM
* To change ... | import java.util.*;
import java.io.*;
public class problem3
{
private final Scanner sc;
private static final boolean debug = true;
static void debug(Object ... objects)
{
if(debug)
System.err.println(Arrays.toString(objects));
}
problem3()
{
sc = new S... |
B10361 | B11204 | 0 | package codejam;
import java.util.*;
import java.io.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("in.txt"));
PrintWriter out = new PrintWriter(new File("out.txt"));
int T = Integer.parseInt(in.readLine());... |
package gcj;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.util.HashMap;
import java.util.Scanner;
/**
*
* @author Mervin.Lavin
*/
public class Gcj
{
public static void main
(String[] args)
throws Exception
{
doProb3( "C-small-attempt1... |
B21790 | B21039 | 0 | import java.io.*;
import java.util.*;
public class C {
void solve() throws IOException {
in("C-large.in"); out("C-large.out");
long tm = System.currentTimeMillis();
boolean[] mask = new boolean[2000000];
int[] r = new int[10];
int t = readInt();
for (int cs = 1; cs... | package de.hg.codejam.tasks.numbers.controller;
import de.hg.codejam.tasks.io.Reader;
import de.hg.codejam.tasks.io.Writer;
import de.hg.codejam.tasks.numbers.help.Converter;
import de.hg.codejam.tasks.numbers.service.Calculator;
public class Test {
public static void main(String[] args) {
String inputPath = "fil... |
A22378 | A22028 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class CodeJam {
// public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt";
public static final String INP... | import java.util.*;
public class Scores {
public static int tests = 0;
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
tests = Integer.parseInt(scan.nextLine());
for (int i=1; i<=tests; i++) {
String[] input = scan.nextLine().split("\\s+");
// int g = Integer.parseInt(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.