F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
B12074 | B10460 | 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... |
public class codejam {
public static void main(String argv[]) throws Exception{
RecycledNumbers recycledNumbers=new RecycledNumbers();
recycledNumbers.start();
}
}
|
A11135 | A11862 | 0 | /**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/3/12
* Time: 11:00 AM
* To change this template use File | Settings | File Templates.
*/
import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;
import java.io.*;
import java.util.*;
import java.uti... | import java.util.*;
public class B
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int test = 1, cases = sc.nextInt();
int n, s, p, g, score, count, even, extra;
while(test <= cases)
{
count = 0;
n = sc.nextInt();
s = sc.nextInt();
p = sc.nextInt();
for(g = ... |
A21396 | A23067 | 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++){
... | 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-large.in"));
BufferedWriter bw = n... |
B10485 | B10706 | 0 |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class Recycle
{
public static void main(String[] args)
{
/* Set<Integer> perms = getPermutations(123456);
for(Integer i: p... | import java.util.Scanner;
import java.util.ArrayList;
public class RecycledNumbers {
/**
* @param args
*/
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String st = in.nextLine();
int n = Integer.parseInt(st);
int a[][] = new int[n][2];
int ans[] = new int[n];
for(... |
A11277 | A10816 | 0 | package googlers;
import java.util.Scanner;
import java.util.PriorityQueue;
import java.util.Comparator;
public class Googlers {
public static void main(String[] args) {
int n,s,p,count=0,t;
Scanner sin=new Scanner(System.in);
t=Integer.parseInt(sin.nextLine());
int result[]=new int[t];
int ... |
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.PrintStream;
/**
*
* @author peterboyen
*/
public class DancingWithTheGooglers {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new FileReader("/Users/peterboyen/Downloads/B-small... |
B21968 | B21480 | 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.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).... |
B20291 | B20553 | 0 | import java.io.*;
import java.util.*;
class B
{
public static void main(String[] args)
{
try
{
BufferedReader br = new BufferedReader(new FileReader("B.in"));
PrintWriter pw = new PrintWriter(new FileWriter("B.out"));
int X = Integer.parseInt(br.readLine());
for(int i=0; i<X; i++)
{
String[]... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintStream;
public class RecycledNumbers {
public static String SMALL_IN_FILE_NAME = "./input.txt";
static PrintStream out = null;
/**
* @param args
* @throws IOException
*/
public s... |
B10245 | B10033 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | package com.google.cj;
public class Entry {
public String n;
public String m;
public Entry() {
// TODO Auto-generated constructor stub
}
public Entry(String n, String m) {
super();
this.n = n;
this.m = m;
}
@Override
public String toString() {
return "Entry [n=" + n + ", m=" + m + "]";
}
@Ov... |
B20006 | B20311 | 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.io.BufferedReader;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Set;
public class C {
public static void main(String[] args) throws Exception {
BufferedReader in = new BufferedReader(new File... |
B22190 | B20036 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
public class Recycled {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.par... |
package 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-large.in");
FileInputSt... |
B12082 | B11046 | 0 | package jp.funnything.competition.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.apache.commons.io.IOUtils;
public class QuestionReader {
pr... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication1;
import java.io.FileNotFoundException;
import java.util.Scanner;
import java.io.File;
/**
*
* @author kutub
*/
public class rn {
public static void main(String args[]) throws FileNotFoun... |
B11421 | B12194 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Recycled {
public static void main(String[] args) throws Exception{
String inputFile = "C-small-attempt0.in... | import java.io.*;
import java.util.*;
public class Solution {
private StringTokenizer st;
private BufferedReader in;
private PrintWriter out;
final String file = "C-small-attempt0";
public void solve() throws IOException {
int tests = nextInt();
int[] pows10 = {1, 10, 100, 1000, 10000, 100000, 1000000, 1... |
B10899 | B12042 | 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.util.*;
import java.io.*;
import java.math.*;
public class Recycle {
public static void main(String args[]) throws Exception
{
BufferedReader in = new BufferedReader(new FileReader(new File("recycle.in")));
FileWriter out = new FileWriter(new File("recycle.out"));
int n = Integer.parseInt(in.re... |
B21270 | B20640 | 0 | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
public class CopyOfCopyOfMain {
static int ndigits(int n) {
return (int) (Math.log10(n) + 1);
}
static i... | package gcj2012.qual;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class C {
final boolean DEBUG = false;
final String PACKAGE = "gcj2012/qual";
final String P... |
A13029 | A10528 | 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.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class ProbB {
static int[][] SurprisingCombinations = {{0,0,2},{0,1,2},{0,2,2}};
static int[][] notSurprisingCombinations = {{0,0,0},{0,0,1},{0,1,1}};
public static void main(Str... |
B20566 | B21507 | 0 | import java.util.Scanner;
import java.io.*;
import java.lang.Math;
public class C{
public static int recycle(String str){
String[] numbers = str.split(" ");
int min = Integer.parseInt(numbers[0]);
int max = Integer.parseInt(numbers[1]);
int ret = 0;
for(int i = min; i < max; i++){
String num = i + "";
... | package recycled;
import java.util.Scanner;
public class Recycled {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int t = scanner.nextInt();
int[] count = new int[t];
for (int i = 0; i < t; i++) {
int a = scanner.nextInt();
... |
A10699 | A12809 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Dancing {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) ... | import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Scanner;
/**
* @author Max Loewenthal
*/
public class B {
public void solve(Scanner input, StringBuilder buffer) {
int N =... |
B12115 | B13108 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... | import java.util.*;
public class RCTest{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int numberOfCases = Integer.parseInt(scan.nextLine());
for(int i = 1; i <= numberOfCases; ++i){
String line = scan.nextLine();
String[] inputs = line.split(" ");
int lower = Intege... |
B20856 | B20010 | 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.*;
import java.util.*;
public class Recy {
int CASE=0, rec[][];
public Recy(String filename) {
Scanner sc;
ArrayList<String> result = new ArrayList<String>();
try {
sc = new Scanner(new File(filename));
CASE= sc.nextInt();
rec = new int[CASE][2];
in... |
B20291 | B20265 | 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[]... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
import java.io.File;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.TreeMap;
/**
*
* @author Ben
*/
public class Main {
public static Scann... |
B21790 | B20225 | 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 bsevero.codejam.qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
public class IOUtils {
public static L... |
B12941 | B11880 | 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 com.gdacarv.codejam;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
public class ProblemC {
public static void main(String [ ] args){
try{
FileInputStream fstream = new FileInputStream("input_problemC.in");
DataInputSt... |
B10155 | B12133 | 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.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.LinkedList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
LinkedList<String> list = readFile("C:/Users/Wurschti/workspace2/2012_3_re... |
B20006 | B21762 | 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.HashSet;
import java.util.Scanner;
public class qualifier3 {
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int numcases = sc.nextInt();
sc.nextLine();
for(int curcase = 1;curcase <=numcases;curcase++)
{
int min = sc.nextInt();
int max = sc.nextInt();
int ... |
B21790 | B20745 | 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 fixjava;
/**
* Convenience class for declaring a method inside a method, so as to avoid code duplication without having to declare a new method
* in the class. This also keeps functions closer to where they are applied. It's butt-ugly but it's about the best you can do in
* Java.
*/
public interface Lambd... |
B21752 | B22206 | 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.*;
import java.util.*;
import java.util.ArrayList;
public class CodeJamProblem implements Runnable {
//Problem C
public boolean InRisultati(ArrayList<String> array, String controllo) {
for(int i =0; i<array.size();i++) {
if(array.get(i)==controllo) {
System.out.println("Risutlato gia conta... |
B21049 | B21055 | 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.*;
import java.util.*;
public class Recycled {
public static void main(String[] args) {
BufferedReader input = null;
BufferedWriter output = null;
try {
input = new BufferedReader(new FileReader("C:\\Users\\cerebrus\\eclipse-workspace\\QualiC-Recycled\\src\\C-big-attempt0.in"));
output = n... |
A10568 | A12517 | 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.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class mainclass {
public static void main(String args[]) throws IOException {
int cases;
int n;
int s;
int p;
int t;
int flag;
int counter;
int[] data;... |
A11135 | A12178 | 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 hk.polyu.cslhu.codejam.thread;
import hk.polyu.cslhu.codejam.lib.ResultCollector;
import hk.polyu.cslhu.codejam.solution.Solution;
import java.util.List;
import org.apache.log4j.Logger;
public abstract class JamThread implements Runnable {
public static Logger logger = Logger.getLogger(JamThread.class);
... |
A11201 | A12330 | 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.... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.*;
import java.util.*;
/**
*
* @author Alex
*/
public class GooglePartay
{
public static void main(String sArgs[]) throws IOException
{
Scanner oScan = new Scanner(new File... |
B12941 | B13085 | 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.*;
public class RecycledNo
{
public static void main (String arg[]) throws Exception
{
BufferedReader ob=new BufferedReader (new FileReader("C-small-attempt2.in"));
PrintWriter pw=new PrintWriter ("output.txt");
String temp="";
temp=ob.readLine();
int t=Integer.parseInt(temp);
int a=0,b=0;
for(int l=1... |
B10702 | B11041 | 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.StringTokenizer;
/**
* User: Grant
* Date: 14/04/12
* Time: 23:29
*/
public class ProblemC {
public static void main(String[] args) throws IOException {
// Prepare output file
File outputFile = new File("E:\\Programming\\Java\\CodeJam\\resources\\problemCOutpu... |
A12544 | A10319 | 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;
public class TestTwoSolver extends SolverModule {
public StringBuilder process(BufferedReader in, StringBuilder builder)
throws IOException {
in.readLine();
String line = in.readLine();
int count = 1;
while (line != null) {
line = processline(l... |
A11135 | A11349 | 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.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class DancingWithGooglers {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
Scanner in;
in = ... |
A20119 | A23034 | 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,... |
/**
* @(#)gcjB.java
*
*
* @author
* @version 1.00 2012/4/14
*/
import java.io.*;
public class gcjB {
/**
* Creates a new instance of <code>gcjB</code>.
*/
public gcjB() {
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
/... |
A11135 | A10682 | 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 google.exercise.b;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
/**
* @author tomtom
*
*/
public class B {
... |
A10793 | A11587 | 0 | import java.io.*;
import java.math.*;
import java.util.*;
import java.text.*;
public class b {
public static void main(String[] args) {
Scanner sc = new Scanner(new BufferedInputStream(System.in));
int T = sc.nextInt();
for (int casenumber = 1; casenumber <= T; ++casenumber) {
... | package ru.sidorkevich.google.jam.qualification.b;
import java.util.List;
public class Task {
int n;
int s;
int p;
List<Integer> t;
public Task(int n, int s, int p, List<Integer> t) {
this.n = n;
this.s = s;
this.p = p;
this.t = t;
}
public int getN() {
... |
A12273 | A11197 | 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.*;
import java.util.*;
/**
*
* @author kronenthaler
*/
public class B {
static HashMap<Integer, Set<ArrayList<Integer>>> cache = new HashMap<Integer, Set<ArrayList<Integer>>>();
public static void main(String arg[]){
try{
int max = 0;
for(int i=0;i<=10;i++){
for(int j=0;j<=10;j++){
... |
B10245 | B11658 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | import java.io.*;
import java.util.*;
public class RecycledNumbers {
public static void main(String... args) throws IOException {
// BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
BufferedReader reader = new BufferedReader(new FileReader("C-small-attempt0.in"));
// PrintWr... |
B21752 | B22179 | 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.*;
import java.util.*;
import java.math.*;
public class Qual22C
{
public static void main(String[] args) throws IOException
{
BufferedReader ips=new BufferedReader(new FileReader("C-large.in"));
PrintWriter ops=new PrintWriter(new FileWriter("recno.in"));
int T=Integer.parseInt(ips.readLine());
... |
B12082 | B10420 | 0 | package jp.funnything.competition.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.apache.commons.io.IOUtils;
public class QuestionReader {
pr... | package gcj_2012;
/**
* Time: 6:31:53 PM, Apr 13, 2012
* @author Maya is the best :-)
*/
import java.util.Scanner;
import java.io.PrintWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
public class C {
static Scanner in;
static String path = "src/gcj_... |
A13029 | A12125 | 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.File;
import java.io.PrintWriter;
import java.util.Scanner;
public class Solution {
static int getGroup(int t, int p) {
if (t >= 2) {
if ((t + 1) / 3 + 1 < p) return 0;
if ((t + 2) / 3 < p) return 1;
return 2;
} else if ((t + 2) / 3 >= p) return 3;
return 4;
}
public static void main... |
A20490 | A21534 | 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.LinkedList;
class firstgame21
{
BufferedReader br;
PrintWriter pw;
String input;
int totalpass;
public firstgame21()
{
try
{
br = new BufferedReader(new FileReader("B-large.in"));
pw = new PrintWriter(new BufferedWriter(new FileWriter("output1.txt")));
inp... |
B10245 | B10574 | 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 boy0;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class CodeJam_C_Small {
public static void main(String[] args) throws IOException {
String strLine;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
CodeJam_C_Small me = ne... |
A21396 | A21611 | 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++){
... | import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
public class Counter {
private int T;
private Lock lock;
private ICounterZeroEvent e;
public Counter(int T, ICounterZeroEvent e)
{
this.T = T;
this.e = e;
lock = new ReentrantLock();
}
public void increase() ... |
A11135 | A11667 | 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... |
public class kickClass {
public static void main(String[] args){
//testGraph.run();
//testCollection.run();
solutionRunner t1 = new solutionRunner();
}
}
|
B10361 | B11564 | 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.is;
/**
* Created with IntelliJ IDEA.
* User: ofer
* Date: 4/13/12
* Time: 8:49 PM
* To change this template use File | Settings | File Templates.
*/
public abstract class TestAbstract implements Test {
private final static String newline = System.getProperty("line.separator");
@Overrid... |
A22642 | A20060 | 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.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
public class B {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String... |
B20424 | B20944 | 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 main;
import java.io.File;
import java.io.IOException;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.swing.JFileChooser;
import javax.swing.filechooser.FileNameExtensionFilter;
import com.google.common.base.Charsets;
import com.google.common.ba... |
A20934 | A22249 | 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()... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package qualification;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
/**
*
* @author anvarik
*/
public class dancers {
public static void main(String[] args) throws Fi... |
A11277 | A13236 | 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 ... | package jam;
import java.util.Scanner;
public class Main_B {
static int[] results;
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int tests = Integer.valueOf(scan.nextLine());
results = new int[tests];
int c = 0;
while(c < tests)
{
solve(scan.nextLine(), c);
c++;
... |
A11135 | A12095 | 0 | /**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/3/12
* Time: 11:00 AM
* To change this template use File | Settings | File Templates.
*/
import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;
import java.io.*;
import java.util.*;
import java.uti... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package cjam;
import java.io.*;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Administrator
*/
public class Cjam {
/**
* @param args the command l... |
B12669 | B12346 | 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 gcj;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
class Recycled {
Scanner sc;
PrintWriter pw;
int t, a, b, n, m, y;
Recycled() {
try {
sc = new Scanner(new File("C-small-attempt0.in"));
pw = new PrintWriter(ne... |
A11135 | A13180 | 0 | /**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/3/12
* Time: 11:00 AM
* To change this template use File | Settings | File Templates.
*/
import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;
import java.io.*;
import java.util.*;
import java.uti... | import java.util.*;
public class reverse {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
int m=sc.nextInt();
int i;
int j;
for(i=1;i<=m;i++) {
int n=sc.nextInt();
int s=sc.nextInt();
int p=sc.nextInt();
... |
A13029 | A10282 | 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 qual1;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.StringTokenizer;
public class B {
public static void main(String[] args) throws IOException {
for (int i=0; i<=10; i++) {
System.out.println(Math.max((i-2)+(i-2)+i,i));
}
//... |
A20382 | A21611 | 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.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
public class Counter {
private int T;
private Lock lock;
private ICounterZeroEvent e;
public Counter(int T, ICounterZeroEvent e)
{
this.T = T;
this.e = e;
lock = new ReentrantLock();
}
public void increase() ... |
B11696 | B10473 | 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 recycled
{
public static void main(String[] args)
{
try
{
FileReader fread = new FileReader(new File("C-small-attempt0.in"));
BufferedReader br = new BufferedReader(fread);
FileWriter fwrite = new FileWriter(new File("output.txt"));
PrintWriter pw =... |
B21207 | B22113 | 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 googleCodeJam;
import java.io.*;
import java.util.*;
public class firstExercise {
/**
* @param args
*/
public static void main(String[] args) {
try{
FileInputStream fstream = new FileInputStream("C-large.in");
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new Buffer... |
B10231 | B13108 | 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 RCTest{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int numberOfCases = Integer.parseInt(scan.nextLine());
for(int i = 1; i <= numberOfCases; ++i){
String line = scan.nextLine();
String[] inputs = line.split(" ");
int lower = Intege... |
A10996 | A11344 | 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.util.Scanner;
public class Two {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner s = new Scanner (System.in);
int cases=s.nextInt();
for(int i=0;i<cases;i++){
int total=0;
int num=s.nextInt();
int suprising=s.nextInt();
in... |
B12082 | B12245 | 0 | package jp.funnything.competition.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.apache.commons.io.IOUtils;
public class QuestionReader {
pr... | package codej;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class QualB {
Scanner scanner = null;
int caseLog = 0;
int A = 0;
int B = 0;
/**
* @param args
*/
public static void main(String[] args) {
QualB b = new QualB();
b.go();
}
public void go() {
... |
A22078 | A21097 | 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.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class DancingWithTheGooglers {
public static void readInput(String pFil... |
B12115 | B12674 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.util.Arrays;
import java.util.Scanner;
public class RecycledNumbersSmall {
public static void main(String[] args) {
File file = new File("/Users/NoK/Desktop/C-small-attempt0.in");
int... |
B12669 | B11147 | 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.util.*;
class c
{
public static void main(String [] args)
{
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int t=1;t<=T;++t)
{
int a,b;
a = in.nextInt();
b = in.nextInt();
long pairs = 0;
for(int i=a;i<=b;++i)
{
HashSet<Integer> m = new HashSet<Integer>();
... |
B10149 | B11478 | 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 =... | package qualification.C;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class C {
public static void main(String[] args) {
int totalCase = 0;
int a = 0;
int b = 0;
FileInputStr... |
A22771 | A20827 | 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.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class letDance {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
... |
A22992 | A21638 | 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.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(... |
A10568 | A10028 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader (new... | package uk.ac.cam.rio22.problemB;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintStream;
public class ProblemB {
public static void main (String[] args) throws NumberFormatException, IO... |
B12082 | B12368 | 0 | package jp.funnything.competition.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.apache.commons.io.IOUtils;
public class QuestionReader {
pr... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.*;
import java.util.*;
/**
*
* @author Alex
*/
public class ReduceReuseButDont
{
public static void main(String sArgs[]) throws IOException
{
Scanner oScan = new Scanner(n... |
A12570 | A13217 | 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.PrintWriter;
import java.util.Scanner;
public class B {
public static void main(String[] args) throws FileNotFoundException {
Scanner scanner = new Scanner(new File("B-small-attempt0.in"));
PrintWriter printer = new PrintWrit... |
B10899 | B11851 | 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 googlecodejam;
import java.io.*;
/**
*
* @author $Ruslan
*/
public class Recycled_numbers {
private static FileInputStream fileInputStream;
private static int testCaseNumber = -1;
public static void main(String[] args)
{
String filepath = "D:\\Programming\\NetBeansProjects\\" + ""
+ "GoogleCodeJam... |
A11502 | A10536 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package one.codejam.b;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Arrays;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;
public class Dancing... |
A10699 | A10177 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Dancing {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) ... | import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class main {
public static void main(String[] args) throws FileNotFoundException {
Scanner sc = new Scanner(System.in);
//Scanner res = new Scanner( new File("/home/loic/INF422/workspace/CodeJam1/bin/Result.txt")... |
B12570 | B10223 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | import java.io.*;
import java.util.*;
public class ProblemC {
public static void main(String[] args) {
try {
// Create file
FileWriter fstream = new FileWriter("out.txt");
BufferedWriter out = new BufferedWriter(fstream);
// Close the output stream
Scanner in = new Scanner(System.in);
int count = ... |
B12762 | B11088 | 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 fixjava;
import java.util.ArrayList;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import fixjava.ParallelWorkQueue.CallableFactory;
public class ParallelWorkQueueTest {
/**
* @param args
*/
public static void main(String[] ... |
B12074 | B10405 | 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 C;
import java.io.*;
import java.util.*;
public class C {
static int[] pow = {10, 100, 1000, 10000, 100000, 1000000};
public static void main(String[] args) throws Exception {
BufferedReader in = new BufferedReader(new FileReader("C.in"));
PrintWriter out = new PrintWriter(new BufferedWriter(new Fil... |
A12211 | A10556 | 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 com.codejam;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class CodeJam1 {
char map[];
public static void main(String[] args) {
Scanner fileIn = null;
FileWriter fileOut = null;
try {
fileIn = new Scanner(new File("input.txt"));
f... |
B21270 | B21320 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication7;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
/**
*
... |
A22992 | A22862 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author dannocz
*/
public class InputReader {
public static Input r... | import java.util.*;
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;... |
A11502 | A12811 | 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 ru.guredd.codejam;
import java.util.StringTokenizer;
public class Qualification2012B {
public void solve() {
int count = Integer.valueOf(Main.inputData.get(0));
for (int i = 0; i < count; i++) {
int result = 0;
String data = Main.inputData.get(i + 1);
... |
B10702 | B11559 | 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.lang.*;
import java.util.*;
public class Recycle{
public static void main(String args []){
try{
FileInputStream fstream = new FileInputStream("C-small-attempt0.in");
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new B... |
B21270 | B22228 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam2012;
/**
*
* @author Abdelrahman
*/
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Ha... |
B12085 | B12707 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | import java.io.File;
import java.io.FileNotFoundException;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String args[]) throws FileNotFoundException {
new RecycledNumbers().Go();
}
public void Go() throws FileNotFoundExcept... |
B21752 | B21617 | 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 ... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcodejam2012;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.Date;
import java.util.LinkedList;
import java.util.Scanner;
/**
*
* @author al... |
A20119 | A21549 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | package qualify;
import java.util.Scanner;
public class B {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for (int i=0;i<t;i++) {
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt();
int total = 0;
for (int j=0;j<n;j++) {
in... |
A22771 | A21230 | 0 | package com.menzus.gcj._2012.qualification.b;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class BProcessorFactory extends AbstractProcessorFactory<BInput, BOutputEntry> {
public BProcessorFactory(Str... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class DancingGooglers
{
public static void main(String[] args)
{
try
{
BufferedReader reader = new BufferedReader(new FileReader(args[0]));
FileWriter fileWriter = new FileWri... |
A21396 | A21742 | 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.google.codejam2011.dancing;
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;
import java.util.ArrayList;
public class Runner {
public ArrayList<String... |
B10899 | B12995 | 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 mgg.utils;
import java.util.List;
public class ListUtils {
public static String pureList(List<?> list) {
StringBuilder builder = new StringBuilder();
for (Object elem : list) {
builder.append(" " + elem);
}
return builder.substring(1).toString();
}
}
|
A12113 | A11465 | 0 | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class B {
static int[][] memo;
static int[] nums;
static int p;
public static void main(String[] args)throws IOException
{
Scanner br=new Scanner(new File("B-small-attempt0.in"... | import java.util.ArrayList;
public class Googler {
private String total;
private ArrayList<Triplet> triplets;
public Googler(String _total,ArrayList<Triplet> _triplets){
total=_total;
triplets = _triplets;
}
public void setTriplets(ArrayList<Triplet> triplets) {
this.triplets = triplets;
}
public A... |
A13029 | A10102 | 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 googlecodejam;
/**
*
* @author ffreakk
*/
import java.util.Scanner;
import java.lang.Math;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for (int t=1; t<=T; t++){
int N = in.nextInt();
... |
B12082 | B12259 | 0 | package jp.funnything.competition.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.apache.commons.io.IOUtils;
public class QuestionReader {
pr... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.io.*;
/**
*
* @author Peter
*/
public class RecycledNumbers {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
... |
A12460 | A13052 | 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 Start {
/**
* @param args
*/
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
int cases=in.nextInt();
for (int x=1;x<=cases;x++){
int c=0;
int num=in.nextInt();
int surp=in.nextInt();
int best=in.nextInt();
// int[] dancer... |
A20490 | A21780 | 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.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class DancingWithTheGooglers {
public static void main(String args[]){
try {
Scanner scanner = new Scanner(new File("B-large.in"));
int noOfCase = scanner.nextInt();
scanner.nextLine();
// System.out.println(noOf... |
B20566 | B21160 | 0 | import java.util.Scanner;
import java.io.*;
import java.lang.Math;
public class C{
public static int recycle(String str){
String[] numbers = str.split(" ");
int min = Integer.parseInt(numbers[0]);
int max = Integer.parseInt(numbers[1]);
int ret = 0;
for(int i = min; i < max; i++){
String num = i + "";
... | package com.codejam;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class ProblemC {
public static void main(String[] args) throws FileNotFoundException {
Scanner sc = new Scanner(new File("C-large.in"));
... |
A22078 | A21754 | 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.*;
class Googlers
{
public static void main(String args[]) throws IOException
{
FileInputStream fstream = new FileInputStream("B-large.in");
DataInputStream dstream = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(dstream));
FileWriter fw = new FileW... |
B10245 | B10137 | 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 qualifying;
import java.util.*;
public class RecycledNumbers {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
final int NUM_TESTS = in.nextInt();
for (int t = 1; t <= NUM_TESTS; ++t) {
final int A = in.nextInt();
final int B = in.nextInt();
final int num... |
A20382 | A21742 | 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.google.codejam2011.dancing;
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;
import java.util.ArrayList;
public class Runner {
public ArrayList<String... |
A20119 | A20095 | 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.util.*;
import java.io.*;
import java.math.*;
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
try {
inputStream = new FileInputStream("a.in");
outputStream = new FileOutputStream("a.out");
} catch (File... |
B12074 | B11887 | 0 | package jp.funnything.competition.util;
import java.math.BigInteger;
/**
* Utility for BigInteger
*/
public class BI {
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger add( final BigInteger x , final BigInteger y ) {
return... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashSet;
public class CRecycledNumbers {
public static HashSet<Integer> hs = new HashSet<Integer>();
public st... |
A20490 | A22980 | 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 dancingwiththegooglers.codejam;
import java.util.Scanner;
public class Case {
String str;
int n, s, p;
int[] t;
Case(Scanner in){
n = in.nextInt();
s = in.nextInt();
p = in.nextInt();
t = new int[n];
for (int i=0; i<n;i++){
t[i] = in.nextInt();
}
}
public String solve(){
int y = 0;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.