F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
A11502 | A11195 | 0 | package template;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
public class TestCase {
private boolean isSolved;
private Object solution;
private Map<String, Integer> intProperties;
private Map<String, ArrayList<Integer>> intArrayProperties;
private Map<String, Arra... | import java.io.*;
import java.util.*;
public class B {
public static void main(String[] args) {
new B().run();
}
BufferedReader br;
StringTokenizer st;
PrintWriter out;
boolean eof = false;
Random rand = new Random(1235446);
private void run() {
try {
br = new BufferedReader(new FileReader(FNAME + ".... |
A11502 | A10094 | 0 | package template;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
public class TestCase {
private boolean isSolved;
private Object solution;
private Map<String, Integer> intProperties;
private Map<String, ArrayList<Integer>> intArrayProperties;
private Map<String, Arra... | package com.codejam2012;
public class CodeJam2 {
public static String fileDir = "P:\\CodeJam2012\\";
public static String baseFileName = "B-small-attempt0";
public static String inputFileName = fileDir + baseFileName + ".in";
public static String outputFileName = fileDir + baseFileName + ".out";
public static i... |
A20261 | A21738 | 0 | package com.gcj.parser;
public class MaxPoints {
public static int normal(int value){
int toReturn = 0;
switch (value) {
case 0 : toReturn = 0 ; break;
case 1 : toReturn = 1 ; break;
case 2 : toReturn = 1 ; break;
case 3 : toReturn = 1 ; break;
case 4 : toReturn = 2 ; break;
case 5 : toReturn = 2 ; b... | package com.bertramtruong.utils;
/**
* This file contains all common
* @author Bertram
*/
public class BT {
/// SETTINGS
private static boolean debugMode = true;
///
///
// LOGGING FUNCTIONS
///
/**
* Toggles between debug mode.
* @param debugMode
*/
public static ... |
A22378 | A21965 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class CodeJam {
// public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt";
public static final String INP... | import java.io.*;
/**
* Created with IntelliJ IDEA.
* User: Frederick
* Date: 4/14/12
* Time: 8:36 AM
* To change this template use File | Settings | File Templates.
*/
public class DancingWithTheGooglers {
private static int solve(int number, int surprising, int p, int[] totalPoints) {
int count = ... |
B11327 | B11035 | 0 | package recycledNumbers;
public class OutputData {
private int[] Steps;
public int[] getSteps() {
return Steps;
}
public OutputData(int [] Steps){
this.Steps = Steps;
for(int i=0;i<this.Steps.length;i++){
System.out.println("Test "+(i+1)+": "+Steps[i]);
}
}
}
| import java.io.File;
import java.io.FileWriter;
import java.util.HashMap;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) throws Exception {
RecycledNumbers recycledNumbers = new RecycledNumbers();
// file name
String fileName = "recycled_numbers";
// file... |
B13196 | B12126 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Q3M {
public static void main(String[] args) throws Exception {
compute();
}
private ... | import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.FileInputStream;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class C {
public static int gao(int a, int b) {
int r = 0;
int n = ("" + a).... |
A11201 | A10591 | 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 ProblemSolvers;
import CaseSolvers.DancingGooglersCase;
public class DancingGooglers extends ProblemSolver {
public DancingGooglers(String filePath) {
super(filePath);
}
@Override
public void process() {
cases = io.readInt();
for (int i = 1; i <= cases; i++) {
new DancingGooglersCase(i, 1, i... |
A12113 | A12088 | 0 | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class B {
static int[][] memo;
static int[] nums;
static int p;
public static void main(String[] args)throws IOException
{
Scanner br=new Scanner(new File("B-small-attempt0.in"... | import java.io.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-Small";
Scanner s = new Scanner(n... |
B20424 | B20179 | 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 recyclednumbers;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
//package recyclednumbers;
/**
*
* @author sony
*/
public class R... |
B11361 | B10200 | 0 | import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
public class C{
Scanner sc=new Scanner(System.in);
int INF=1<<28;
double EPS=1e-9;
int caze, T;
int A, B;
void run(){
T=sc.n... | import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Q3 {
public static void main (String[] args)
{
Scanner s = new Scanner(System.in);
int numTests = s.nextInt();
for (int test = 0; test < numTests; test++)
{
int a = s.nextInt();
int b = s.nextInt();
int count = ... |
B11696 | B12383 | 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.*;
import java.util.*;
public class Main {
public static void main(String... args) throws Exception {
int t, a, b, T;
Scanner in = new Scanner(new File("recycled.in"));
//PrintStream out = System.out;
PrintStream out = new PrintStream(new File("recycled.out"));
T = in.nextInt();
for (t = 1;... |
A22378 | A22345 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class CodeJam {
// public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt";
public static final String INP... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.Arrays;
public class Dancing {
/**
*... |
A22771 | A21413 | 0 | package com.menzus.gcj._2012.qualification.b;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class BProcessorFactory extends AbstractProcessorFactory<BInput, BOutputEntry> {
public BProcessorFactory(Str... |
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.Observable;
import java.io.FileNotFoundException;
import java.io.IOExcep... |
B20734 | B21742 | 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 round0;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
public class Dance {
BufferedReader _in;
PrintWriter _out;
int _numTestCases;
Input[] _inputs;
public Dance(BufferedReader in) throws Exception {
this._... |
B10149 | B11667 | 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.*;
public class Recycled{
public static void main(String args[])
{
try{
File myFile = new File("C-small-attempt0.in");
FileReader fileReader = new FileReader(myFile);
BufferedReader reader = new BufferedReader(fileReader);
FileWriter fileWriter = new FileWriter("C-small-attempt0.out");
BufferedWriter w... |
B20856 | B21530 | 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.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class RecycledNumbers {
public static void main(String[] args) {
List<String> lines = getline("C:\\Users\\Ami\\Downloads\\C-larg... |
B10231 | B12271 | 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... | package QualificationRound2012.C.RecycledNumbers;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class RecycledNumbers {
static final String _DIR = "src/QualificationRound2012/C/RecycledNumber... |
B10899 | B11129 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
public class ReadFile {
public static void main(... | package com.codegem.zaidansari;
import java.util.ArrayList;
import java.util.List;
class Score {
int score1, score2, score3;
int bestScore;
boolean isSurprising;
public Score(int score1, int score2, int score3) {
super();
this.score1 = score1;
this.score2 = score2;
t... |
A12570 | A12108 | 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 qualif.problem2;
import qualif.problem1.ReadWrite;
public class Main2 {
private static String pathToFile = "src/qualif/problem2/";
private static String fileName = "B-small";
private static String outputName = "output";
private static String filePath = pathToFile + fileName + ".txt";
private static St... |
A21396 | A23051 | 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 dancing;
import java.io.BufferedReader;
import java.io.FileReader;
public class MaxScoreDetector {
/**
* @param args
*/
public static void main(String[] args) {
String fileName = null;
if(args.length == 1){
fileName = args[0];
}else{
System.err.println("Requires a command line argument: fil... |
A20490 | A21449 | 0 | /**
*
*/
package hu.herba.codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io... | import java.io.*;
/**
* ***************************************************************************
* Created by IntelliJ IDEA.
* User: Narender Singh Pal
* Date: 4/14/12
* Time: 8:32 AM
* <p/>
* ***************************************************************************
* <p/>
* Copyright (c) 2012 All Rights... |
B10485 | B10141 | 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.*;
import java.util.Scanner;
class RecycledNumbers
{
public static void main(String Args[]) throws Exception
{
Scanner s=new Scanner(new FileReader("inputCs.in"));
BufferedWriter br=new BufferedWriter(new FileWriter("outputCs.txt"));
int T, a, b,total=0;
T=s.nextInt();
String x,y;
for(int I... |
B12074 | B13147 | 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.util.Scanner;
import java.io.IOException;
import java.util.Arrays;
import java.util.ArrayList;
import java.io.PrintStream;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.FileInputStream;
import java.io.InputStream;
/**
* Built using CHelper plug-in... |
A22378 | A20530 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class CodeJam {
// public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt";
public static final String INP... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
static int N,S,p;
static int t[];
static int solve() {
int i,j,k;
int a,b,c;
int opt[][] = new int[N+1][S+1];
boolean canMakeOne, goodScoreCase... |
B12570 | B10930 | 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.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
public class ProbB {
/**
*... |
B10245 | B10400 | 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.*;
class RecycledNumbers
{
public static void main(String[] args)
{
try {
//parse the input
FileInputStream fstream = new FileInputStream(args[0]);
DataInputStream dstream = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(dstream));
... |
B11696 | B12963 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recycled;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util... | package codejam2012;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class QualB {
public static void main(String[] args) throws Fil... |
A22992 | A22578 | 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.IOException;
import java.util.Scanner;
public class DancingWithTheGooglers {
public static void main(String[] args) throws IOException {
Scanner scan = new Scanner(System.in);
int T = scan.nextInt();
int counter = 1;
while (T-- > 0) {
int returned = 0;
int N = scan.nextInt();
int surp... |
A20382 | A23051 | 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 dancing;
import java.io.BufferedReader;
import java.io.FileReader;
public class MaxScoreDetector {
/**
* @param args
*/
public static void main(String[] args) {
String fileName = null;
if(args.length == 1){
fileName = args[0];
}else{
System.err.println("Requires a command line argument: fil... |
A12113 | A11233 | 0 | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class B {
static int[][] memo;
static int[] nums;
static int p;
public static void main(String[] args)throws IOException
{
Scanner br=new Scanner(new File("B-small-attempt0.in"... | import java.io.*;
import java.util.StringTokenizer;
public class CodeJam3 {
static BufferedReader br;
static PrintWriter pw;
static int n,surp,p,total[],count;
static Triplet scores[];
public static void main(String[] args)throws Exception{
br=new BufferedReader (new FileReader ("in.txt"));
pw=new Print... |
A13029 | A12062 | 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.*;
import java.util.InputMismatchException;
public class qualifierQ2 {
public static void main(String[] args) throws FileNotFoundException {
PrintStream printStream = null;
File file = null;
try {
if (Boolean.getBoolean("toFile")) {
file = new Fil... |
A22771 | A22865 | 0 | package com.menzus.gcj._2012.qualification.b;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class BProcessorFactory extends AbstractProcessorFactory<BInput, BOutputEntry> {
public BProcessorFactory(Str... | import java.io.File;
import java.util.*;
public class Googlers {
public static void main(String[] args) throws Throwable{
Scanner scan = new Scanner(new File("in_b"));
scan.nextLine();
int l = 1;
while(scan.hasNextLine()){
String[] line = scan.nextLine().split(" ");
int surprise = Integer.valueOf(li... |
A21010 | A21202 | 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.util.Scanner;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
Scanner sc = null;
BufferedWriter bw = null;
try{
sc = new Scanner(new File("input.txt"));
bw = new BufferedWrit... |
B20856 | B20974 | 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.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
public class Recycle {
public Recycle() {
String line;
Integer maxInputs,output;
Integer a, b;
try {
BufferedReader read = new BufferedReader(new Inp... |
A22378 | A21958 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class CodeJam {
// public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt";
public static final String INP... | import java.io.*;
import java.util.InputMismatchException;
public class qualifierQ2 {
public static void main(String[] args) throws FileNotFoundException {
PrintStream printStream = null;
File file = null;
try {
if (Boolean.getBoolean("toFile")) {
file = new Fil... |
B12115 | B10861 | 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();
... | package be.mokarea.gcj.recyclednumbers;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
import be.mokarea.gcj.common.TestCaseReader;
public class RecycledNumbersTestCaseReader extends
TestCaseReader<RecycledNumbersTestCase> {
private final... |
A13029 | A10809 | 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 me.adrabi.codejam;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
/**
* @author Adrabi Abderrahim, z3vil
*
*/
public class P2
{
private static int SURPRISING = 0;
... |
B20734 | B21860 | 0 | package fixjava;
public class StringUtils {
/** Repeat the given string the requested number of times. */
public static String repeat(String str, int numTimes) {
StringBuilder buf = new StringBuilder(Math.max(0, str.length() * numTimes));
for (int i = 0; i < numTimes; i++)
buf.append(str);
return buf.toStr... | import java.io.*;
import java.security.SecureRandom;
import java.util.*;
import java.math.*;
import java.awt.geom.*;
import static java.lang.Math.*;
public class Main implements Runnable {
static String filename = "C-large";
HashSet<Integer> getCycles(int n) {
int nc = n;
int digitcount = 0;
int pow10 = 1... |
A12460 | A12443 | 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.*;
import static java.lang.Math.*;
public class B {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int a = 1; a <= T;a++){ //caso de prueba
in.nextLine();
int N = in.nextInt();
int S = in.nextInt();
int pInt = in.nextInt()... |
B10858 | B10979 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| import java.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.*;
public class recycled {
public static void main(String[] args) throws IOException
{
BufferedReader in = new BufferedRe... |
A11201 | A10348 | 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.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;
public class prob2sol {
public static void main(String[] args) {
BufferedReader in;
String li... |
B11421 | B11832 | 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.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... |
B10858 | B13209 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
public class RecycledNumbers {
private static int lowRange = 0, highRange = 0;
private static ArrayList<Integer> list = null;
private ... |
B10155 | B11999 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
/**
*
* @author eblanco
*/
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
impo... | import java.io.BufferedReader;
import java.io.FileReader;
import java.util.LinkedList;
import java.util.StringTokenizer;
public class RecycledNumbers {
// private static String INPUT_FILE = "input.txt";
private static String INPUT_FILE = "C-small-attempt0.in";
private static final String DELIM = " ";
public v... |
B22190 | B21252 | 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.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Shell {
private static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
private static final String ERROR = "Error!";
private static final ... |
A12846 | A12409 | 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 Googlers {
public static void main(String[] args)throws IOException {
Scanner sc = new Scanner(new File("input2.txt"));
int loop = sc.nextInt();
int num;
int s = 0;
int p;
int n;
int count = 0;
int check;
ArrayList<Integer> a... |
B20006 | B22251 | 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.util.ArrayList;
import java.util.Arrays;
public class Problem3
{
public void solve(){
ReadWriter rw = new ReadWriter();
ArrayList<String> input = rw.readFile("C-large.in");
ArrayList<String> ans = new ArrayList<String>();
int num;
boolean first = true;
int... |
B10899 | B12972 | 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(... | import java.io.*;
import java.util.StringTokenizer;
public class B {
public static void main(String[] args) throws Exception
{
BufferedReader bf = new BufferedReader(new FileReader("B.in"));
System.setOut(new PrintStream("B.out"));
int N = Integer.parseInt(bf.readLine()), caso = 1;
while(N-->0){
boolean... |
A10568 | A10475 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader (new... | import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Scanner;
public class dancers {
public static void main(String[] args) {
try {
Scanner input = new Scanner(new File("c:\\files\\B-small-attempt0.in"));
FileWriter fw = new FileWriter("c:\\files\\douts.txt");
Print... |
A20490 | A22335 | 0 | /**
*
*/
package hu.herba.codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io... | import java.io.*;
import java.util.*;
/**
* @author OleGG
*/
public class QualTaskB {
public static void main(String[] args) throws Throwable {
StreamTokenizer st = new StreamTokenizer(new BufferedReader(new FileReader("B-large.in.txt")));
PrintWriter pw = new PrintWriter(new FileWriter("B-large.... |
B10231 | B10227 | 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... | package qualification;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.BufferedReader;
import java.... |
B20734 | B20222 | 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 qual1;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.StringTokenizer;
public class C {
public static void main(String[] args) throws IOException {
// Use BufferedReader rather than RandomAccessFile; it's much ... |
B20734 | B21973 | 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.File;
import java.io.PrintWriter;
import java.util.*;
public class RecycledNumbers {
public static void main(String[] args) throws Exception {
Scanner scanner = new Scanner(new File("C-large.in"));
int num = scanner.nextInt();
scanner.nextLine();
PrintWriter writer = new PrintWriter(new File("... |
B11361 | B11209 | 0 | import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
public class C{
Scanner sc=new Scanner(System.in);
int INF=1<<28;
double EPS=1e-9;
int caze, T;
int A, B;
void run(){
T=sc.n... | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Scanner;
public class C {
public static void main(String[] args) {
try {
Scanner in = new Scanner(new File("C.in"));
BufferedWriter writer = new BufferedW... |
A10699 | A12334 | 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) ... | package com.google.codejam;
import java.io.File;
import java.io.IOException;
import java.util.List;
import com.google.common.base.CharMatcher;
import com.google.common.base.Function;
import com.google.common.base.Splitter;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.... |
B21049 | B20793 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.falidae;
import java.util.*;
import java.io.*;
/**
*
* @author LittleRock
*/
public class RecycledNumbers {
public RecycledNumbers() {
}
public void init() {
}
public long s... |
B21207 | B21924 | 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.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class ProblemC {
public static void main(String[] args){
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
try{
String line = in.readLine();
in... |
B21968 | B20184 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
//package codejam.practice;
/**
*
* @author Saikat Roy
*/
import java.io.*;
public class Main2 {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
public void input() throws IOExce... |
B12941 | B10836 | 0 | package com.menzus.gcj._2012.qualification.c;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class CProcessorFactory extends AbstractProcessorFactory<CInput, COutputEntry> {
public CProcessorFactory(Str... | package codejam;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
public class RecycledNumbers {
private StreamTokenizer in;
private PrintWriter out;
// private Set<Chain> map = new HashSet<... |
A21396 | A21937 | 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 jp.funnything.competition.util;
public enum Direction {
UP , DOWN , LEFT , RIGHT;
public int dx() {
switch ( this ) {
case UP:
case DOWN:
return 0;
case LEFT:
return -1;
case RIGHT:
return 1;
default:
throw... |
A13029 | A11943 | 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 Utils;
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;
import java.util.HashMap;
import java.util.List;
public class FileHelper {
private Str... |
A12113 | A12998 | 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 qualification.q1;
import com.sun.deploy.net.proxy.StaticProxyManager;
import qualification.common.InputReader;
import qualification.common.OutputWriter;
/**
* Created by IntelliJ IDEA.
* User: ofer
* Date: 14/04/12
* Time: 17:36
* To change this template use File | Settings | File Templates.
*/
public c... |
A11201 | A10512 | 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.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.io.IOException;
import java.io.InputStreamReader;
public class Dance {
private int[][] inputFin;
private int Ar... |
B10231 | B11705 | 0 | import java.io.*;
class code1
{
public static void main(String args[]) throws Exception
{
File ii = new File ("C-small-attempt1.in");
FileInputStream fis = new FileInputStream(ii);
BufferedReader br = new BufferedReader(new InputStreamReader (fis));
int cases = Integer.parseInt(br.readLine());
FileOutput... | import java.util.*;
public class C {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
int T = in.nextInt();
int i,j,len,p,temp,total;
HashSet<Integer>[] map = new HashSet[2000000];
for (i=1;i<2000000;i++) {
map[i]... |
A13029 | A12586 | 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 com.sun.org.apache.bcel.internal.generic.AALOAD;
import java.io.IOException;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class RecycledNum extends JamProblem {
public static void main(String[] args) throws IOException {
RecycledNum p = new RecycledNum();
p.... |
A10568 | A10647 | 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 static java.util.Arrays.deepToString;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;
public class QB {
public static void main(String[] args) throws Exception
{
... |
A20382 | A21937 | 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 jp.funnything.competition.util;
public enum Direction {
UP , DOWN , LEFT , RIGHT;
public int dx() {
switch ( this ) {
case UP:
case DOWN:
return 0;
case LEFT:
return -1;
case RIGHT:
return 1;
default:
throw... |
B10702 | B12874 | 0 | import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Recycle {
private static HashMap<Integer, HashSet<Integer>> map = new HashMap<Integer, HashSet<Integer>>();
private static HashSet<Integer> toSkip = new HashSet<Integer>();
/**
* @param args
*/
public static void main(S... | import java.io.*;
import java.util.*;
public class C {
public static void main(String[] args) {
new C().run();
}
BufferedReader br;
StringTokenizer st;
PrintWriter out;
boolean eof;
public void run() {
try {
// br = new BufferedReader(new InputStreamReader(System.in));
// out = new PrintWriter(System.... |
A12211 | A10750 | 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.util.Scanner;
/*
* Google Code Jam 2012
* Program by Tommy Ludwig
* Problem: Dancing With the Googlers
* Date: 2012-04-13
*/
public class dancing {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T, N, S, p;
T = in.nextInt();
for (int i = 1; i <= T; i++)... |
B21968 | B22103 | 0 | import java.util.*;
import java.io.*;
public class recycled_numbers {
public static void main(String[]a) throws Exception{
Scanner f = new Scanner(new File(a[0]));
int result=0;
int A,B;
String n,m;
HashSet<String> s=new HashSet<String>();
int T=f.nextInt(); //T total case count
for (int t=1; t<=T... | package google.codejam2012.qualification;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class RecycledNumbers {
static private int getDigitsCount(int number) {
int sh = 10;
int digits = 1;
while (sh <= number) {
sh *= 10;
digits++;
}
retur... |
A20119 | A20445 | 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.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Dancer {
public static void main(String args[]) throws FileNotFoundException{
Scanner in=new Scanner(new FileInputStream("input2.txt"));
int T=in.nextInt();
System.out.println("T : " + T);
... |
B21752 | B21156 | 0 | package Main;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
/**
* Created with IntelliJ IDEA.
* User: arran
* Date: 14/04/12
* Time: 3:12 PM
* To change ... | import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
public class Recycled {
public static void main(String[] args){
Recycled r = new Recycled();
try{
// Open the file that is the first
// command line parameter
FileIn... |
B20006 | B21078 | 0 | import java.io.*;
import java.math.BigInteger;
import java.util.*;
import org.jfree.data.function.PowerFunction2D;
public class r2a
{
Map numMap = new HashMap();
int output = 0;
/**
* @param args
*/
public static void main(String[] args)
{
r2a mk = new r2a();
try {
... | import java.io.*;
import java.util.HashSet;
import java.util.Set;
/**
* ***************************************************************************
* Created by IntelliJ IDEA.
* User: Narender Singh Pal
* Date: 4/14/12
* Time: 10:59 AM
* <p/>
* *******************************************************************... |
B20734 | B21210 | 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 test3;
import java.io.*;
import java.util.LinkedList;
import java.util.Scanner;
/**
*
* @author Student
*/
public class Test3 {
public static int rotations(int number, int max) {
int l = 0;
... |
A22992 | A22153 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author dannocz
*/
public class InputReader {
public static Input r... | import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import static java.lang.Math.*;
public class Solution implements Runnable {
public static void main(String[] a... |
B10245 | B13211 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... |
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.StringTokenizer;
public class C {
String PATH = "C:\\Users\\XiaoweiChen\\Desktop\\Jam\\"... |
A11277 | A10878 | 0 | package googlers;
import java.util.Scanner;
import java.util.PriorityQueue;
import java.util.Comparator;
public class Googlers {
public static void main(String[] args) {
int n,s,p,count=0,t;
Scanner sin=new Scanner(System.in);
t=Integer.parseInt(sin.nextLine());
int result[]=new int[t];
int ... | import java.io.File;
import java.io.FileNotFoundException;
import java.io.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... |
A11502 | A10295 | 0 | package template;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
public class TestCase {
private boolean isSolved;
private Object solution;
private Map<String, Integer> intProperties;
private Map<String, ArrayList<Integer>> intArrayProperties;
private Map<String, Arra... | import java.io.*;
import java.util.*;
import java.math.*;
public class Main implements Runnable
{
static Scanner scanner;
static BufferedReader input;
static PrintWriter pw;
public static void main(String[] args) throws Exception
{
new Thread(new Main()).start();
}
public void run()
{
try
{
input = ... |
A11502 | A10221 | 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;
import java.util.StringTokenizer;
class process implements Runnable {
Thread t;
int c=0,n=0,s=0,p=0;
int[] sc;
int res=0;
String a="";
process(int i,int a,int b,int e,int[] d) {
c=(i+1);
n=a;
s=b;
p=e;
sc=d;
t = new Thread(this);
t.run... |
A20490 | A21900 | 0 | /**
*
*/
package hu.herba.codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class Program {
/**
* @param args
*/
public static void main1(String[] args) {
Speaking_in_Tongues sit=new Speaking_in_Tongues();
sit.initialize();
sit.register("our language is... |
A22191 | A21638 | 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.File;
import java.io.IOException;
import java.util.Arrays;
public class QrB {
private CodeJamTextInputReader input = null;
private CodeJamTextOutputWriter output = null;
public static void main(String args[]) {
// CodeJamUtils.initLineEndings();
try {
QrB qrA = new QrB();
qrA.run(new File(... |
A12846 | A11843 | 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.*;
public class Dancing {
public static boolean wasS(int score){
switch(score) {
case 0:
return false;
case 1:
return false;
case 30:
return false;
case 29:
return false;
}
int resi = score%3;
if(resi == 1){
return false;
}
return true;
}
public stat... |
B12941 | B10049 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package google.code.jam.recycled.numbers;
import java.io.*;
import java.util.ArrayList;
/**
*
* @author Lucas
*/
public class Utils {
public ArrayList<Integer[]> parse(String file) {
BufferedReader... |
B21207 | B20976 | 0 | /*
* Problem C. Recycled Numbers
*
* Do you ever become frustrated with television because you keep seeing the
* same things, recycled over and over again? Well I personally don't care about
* television, but I do sometimes feel that way about numbers.
*
* Let's say a pair of distinct positive integers (n, m) ... | package Round1;
/*
ID: kevinle7
LANG: JAVA
TASK: recycled
*/
import java.io.*;
import java.util.*;
class recycled
{
public static int[] pow = {1,10,100,1000,10000,100000,1000000,10000000,100000000};
public static void main(String[] args) throws IOException
{
BufferedReader f = new BufferedReader(new FileRea... |
B12941 | B10060 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package googlejam;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
/**
*
* @author AEK
*/
public class Problem_C_small {
... |
A20261 | A21706 | 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 javax.swing.*;
import java.util.Scanner;
import java.io.*;
class ProblemB
{
public static void main (String []sdvv) throws IOException
{
int cases=0, N, S, p, normal, surprise, number, total;
String palabra="";
Scanner sc;
PrintWriter es;
try
{
sc = new Scanner(new File("Blarge.IN"));
es = ... |
A20261 | A21067 | 0 | package com.gcj.parser;
public class MaxPoints {
public static int normal(int value){
int toReturn = 0;
switch (value) {
case 0 : toReturn = 0 ; break;
case 1 : toReturn = 1 ; break;
case 2 : toReturn = 1 ; break;
case 3 : toReturn = 1 ; break;
case 4 : toReturn = 2 ; break;
case 5 : toReturn = 2 ; b... | package com.googlecode.codejam.contest.gcj2012.round_q;
import java.util.Arrays;
import java.util.Iterator;
import java.util.concurrent.Callable;
import com.googlecode.codejam.model.JamCaseResolver;
import com.googlecode.codejam.model.JamCaseResolverFactory;
import com.googlecode.codejam.model.JamResolver;
public cl... |
B10155 | B12444 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
/**
*
* @author eblanco
*/
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
impo... | import java.util.*;
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... |
A11135 | A10901 | 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.* ;
import java.util.Scanner;
public class Main2 {
public static void main(String argsp[]) throws FileNotFoundException{
Scanner in = new Scanner(new FileReader("input.in"));
PrintWriter out = new PrintWriter("output.txt");
int T = 0;
String S1 = in.nextLine() ;
T = Integer.parseInt(S1);
... |
A20934 | A21841 | 0 | import java.util.*;
public class B {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
B th = new B();
for (int i = 0; i < T; i++) {
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt()... | package com.sam.googlecodejam.speakingtoungue;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import com.sam.googlecodejam.helper.InputReader;
/**
* This class generates the mapping based on the samples that have been provided.
* @author Saifuddin Merchant
*
... |
B12074 | B10307 | 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 bsevero.codejam.qualification;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumbers {
private static Set<String> FOUND_PAIRS = new HashSet<String>();
public static int recycle(String minStr, String maxStr) {
FOUND_PAIRS = new HashSet<String>();
int min = Integer.valueOf(minStr... |
B10702 | B12121 | 0 | import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Recycle {
private static HashMap<Integer, HashSet<Integer>> map = new HashMap<Integer, HashSet<Integer>>();
private static HashSet<Integer> toSkip = new HashSet<Integer>();
/**
* @param args
*/
public static void main(S... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class RecycledNumbers
{
public static void main(String[] args) throws IOException {
FileWriter wr=new FileWriter("Output.txt");
BufferedWr... |
A22191 | A22862 | 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.util.*;
class Dance {
public static void main (String args[]) {
Scanner sc = new Scanner(System.in);
int numCases = sc.nextInt();
for (int i = 0; i < numCases; i++) {
int numScores = sc.nextInt();
int numSuprises = sc.nextInt();
int smallest = sc.nextInt();
int won = 0;
for (int k = 0;... |
B20424 | B20169 | 0 | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
// static int MAX = 10000;
static int MAX = 2000000;
static Object[] All = new Object[MAX+1];
static int size( int x ) {
if(x>999999) return 7;
if(x>99999) return 6;
if(x>9999) return 5;
if(x>999) retu... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.InputStream;
import java.io.InputStreamReader;
public class RecycledNumbers {
public static void main(String[] args) {
try {
run();
} catch (Exception e) {
e.printStackTrace();
}
}
private static voi... |
B12085 | B11730 | 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... | /*
* SpeakingApp.java
*/
package speaking;
import org.jdesktop.application.Application;
import org.jdesktop.application.SingleFrameApplication;
/**
* The main class of the application.
*/
public class SpeakingApp extends SingleFrameApplication {
/**
* At startup create and show the main frame of the ap... |
B21207 | B22042 | 0 | /*
* Problem C. Recycled Numbers
*
* Do you ever become frustrated with television because you keep seeing the
* same things, recycled over and over again? Well I personally don't care about
* television, but I do sometimes feel that way about numbers.
*
* Let's say a pair of distinct positive integers (n, m) ... | package google.solver;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
public class ProblemPackageCreator implements ChallengeConstants{
private final String packageName;
private String directoryName;
private String challengeDef;
private String readerName;
private String challeng... |
B20424 | B20581 | 0 | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
// static int MAX = 10000;
static int MAX = 2000000;
static Object[] All = new Object[MAX+1];
static int size( int x ) {
if(x>999999) return 7;
if(x>99999) return 6;
if(x>9999) return 5;
if(x>999) retu... | import java.io.File;
import java.io.FileWriter;
import java.util.*;
public class Recycled {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(new File("./src/recycledL-input.txt"));
FileWriter fw = new FileWriter("./src/recycledL-output.txt");
int total = sc.nextInt();
for(i... |
B12669 | B10809 | 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.HashSet;
import java.util.Scanner;
public class C {
public static void main(String[] args) throws Exception {
Scanner in = new Scanner(new File("C-small-attempt0.bin"));
// Scanner in = new Scanner(new File("test.in"));
int T = in.nextInt();
for (int zz = 1; zz <= T; ++zz... |
A11201 | A13215 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
public class Recycle {
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new FileReader("B-small-attempt2.in"));
BufferedWrit... |
B21790 | B20495 | 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... | //saurabh
import java.io.*;
import java.util.*;
public class Recycle
{
public static void main(String args[]) throws IOException
{
Recycle ob=new Recycle();
int T,A,B;
Scanner c= new Scanner(new File("Recycle.txt"));
T=c.nextInt();
int ans[]=new int[T];
for(int i=0;i<T;i++)
{
A=c.nextInt();
B=c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.