F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
B13196 | B12946 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Q3M {
public static void main(String[] args) throws Exception {
compute();
}
private ... |
import java.util.*;
class Main {
public static void main( String[ ] args ) {
Scanner in=new Scanner(System.in);
int cin=in.nextInt();
for (int ci=1;ci<=cin;ci++){
int a=in.nextInt(),b=in.nextInt();
int ans=0;
for (int i=a;i<b;i++){
HashSet<Integer> la=new HashSet<Intege... |
B20023 | B21821 | 0 | 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.Set;
public class GoogleC {
public String szamol(String input){
String result="";
String... | import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
public class C2 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt(); in.nextLine();
//for each test case
for (int i = 1; i <= T; i++)
{
int A = in.nextInt();
int ... |
B12762 | B12976 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.File;
import java.io.FileInputStream;
import java.util.Scanner;
/**
*
* @author imgps
*/
public class C {
public static void main(String args[]) throws Exception{
int A,B;
int ctr ... | import java.io.* ;
import java.text.DecimalFormat;
import java.util.*;
import static java.lang.Math.* ;
import static java.util.Arrays.* ;
public class C {
public static void main(String[] args) throws FileNotFoundException {
in = new Scanner(new InputStreamReader(new FileInputStream("c_in.txt")));
out = new... |
B21790 | B20787 | 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 com.codegem.zaidansari;
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;
import java.util.List;
import java.util.Scanner;
public class CodeGemUtil {
publi... |
A13029 | A11363 | 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.util.Scanner;
public class B {
static Scanner in = new Scanner(System.in);
int solve() {
int N = in.nextInt();
int S = in.nextInt();
int p = in.nextInt();
int yesLimit = p + 2 * Math.max(0, p-1);
int maybeLimit = p + 2 * Math.max(0, p-2);
int yes = 0;
int maybe = 0;
for (int i=0... |
B11327 | B12933 | 0 | package recycledNumbers;
public class OutputData {
private int[] Steps;
public int[] getSteps() {
return Steps;
}
public OutputData(int [] Steps){
this.Steps = Steps;
for(int i=0;i<this.Steps.length;i++){
System.out.println("Test "+(i+1)+": "+Steps[i]);
}
}
}
| package org.sooo;
import java.io.File;
import java.io.OutputStreamWriter;
import java.util.List;
import com.google.common.base.Charsets;
import com.google.common.base.Splitter;
import com.google.common.collect.Lists;
import com.google.common.io.CharStreams;
import com.google.common.io.Files;
import com.google.common.... |
A21557 | A20781 | 0 | import java.io.*;
import java.util.*;
public class DancingWithGooglers {
public static class Googlers {
public int T;
public int surp;
public boolean surprising;
public boolean pSurprising;
public boolean antiSurprising;
public boolean pAntiSurprising;
public Googlers(int T, int surp) ... | import java.util.*;
import java.math.*;
import java.io.*;
import static java.lang.System.*;
import static java.lang.Math.*;
import static java.lang.Integer.*;
import static java.lang.Double.*;
import static java.lang.Long.*;
public class QB {
static String[] parts(BufferedReader br) throws Exception {
Stri... |
A10568 | A11187 | 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.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
import javax.swing.JOptionPane;
public class GoogleDancers {
public static String rootDir = System.getProperty("user.dir")
+ File.separator;
public static String filesDir = ... |
B20006 | B21309 | 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.File;
import java.io.FileWriter;
import java.io.IOException;
public class FileOut {
/**
* ã³ã³ã¹ãã©ã¯ã¿.
* @param filename æ¸ãåºããã¡ã¤ã«å
* @param s æ¸ãåºãæåå
*/
public FileOut(String filename, String s) {
File f = new File(filename);
FileWriter fw = nul... |
A10699 | A11206 | 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.*;
import java.util.*;
import java.math.*;
public class Solution {
static int miracles=-1;
static int tresh=1000;
public static void main(String args[]) throws Exception {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for(int t = 0; t < T; t++) {
int N=sc.nextInt();
miracles=s... |
B10231 | B12474 | 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 codejam.common;
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 abstract class AbstractProblemSolver<P, S> {
public void solve(File input, File output) {
try (BufferedReader reader =... |
B20006 | B21754 | 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.File;
import java.lang.StringBuilder;
import java.util.Scanner;
import java.io.FileWriter;
public class RN {
public static void main(String[] args) throws Exception{
File input = new File("C-large.in");
File output = new File("output.out");
FileWriter fw = new FileWriter(output);
Scanner s = ... |
A22191 | A20238 | 0 | package com.example;
import java.io.IOException;
import java.util.List;
public class ProblemB {
enum Result {
INSUFFICIENT,
SUFFICIENT,
SUFFICIENT_WHEN_SURPRISING
}
public static void main(String[] a) throws IOException {
List<String> lines = FileUtil.getLines("/B-large.in");
int cases = Int... |
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.Reader;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.nio.CharBuffer;
imp... |
B10149 | B10040 | 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 =... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.*;
/**
*
* @author Joydeep
*/
public class J3 {
public static void main(String[] args) throws IOException{
String test = "150";
DataInputStream ds = new DataInputStream(new FileIn... |
B11327 | B10282 | 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]);
}
}
}
|
/**
* Shashank Gupta
*
* ****SinnerShanky****
*/
import java.io.*;
public class problem_C
{
void main()
{
try
{
FileReader fr=new FileReader("C:\\USERS\\SHASHANK GUPTA\\DOWNLOADS\\C-small-attempt0.in");
BufferedReader br=new BufferedReader(fr);
int n=Intege... |
B20734 | B20096 | 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.FileReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Main {
class Pair {
int a;
int b;
Pair(int a, int b) {
this.a = a;
this.b = b;
}
@Override
public int hashCode() {
... |
A22078 | A22617 | 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.util.List;
import java.util.Map;
public class Dwtg {
List<List<List<String>>> input;
public Dwtg(List<List<List<String>>> input){
this.input = input;
}
public void solve(){
int googlers;
int surprise;
int p;
int res;
int scoreOk;
int nbOk;
int potentialSurp;
int nbSurp;
for(... |
B12082 | B10014 | 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 googlejam3;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashMap;
public class Main3
{
static HashMap<String,String> pairsMap = new HashMap<String,String>();
protected static String resolveTestCase(S... |
A13029 | A11013 | 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 fixjava;
import java.util.Map;
import java.util.Map.Entry;
public class Join {
// TODO: write a join-of-joins (2D join) that joins lists-of-lists without the complexity of using a lambda.
public static <T> String join(Iterable<T> list, String delim) {
if (list == null)
return null;
StringBuilder ... |
B12115 | B11419 | 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.Arrays;
import java.util.Scanner;
public class C {
static Scanner in = new Scanner(System.in);
long solve() {
int A = in.nextInt();
int B = in.nextInt();
int digits = 1;
int mult = 1;
{
int t = A;
while (t>=10) {
t/=10;
++digits;
mult *= 10;
}
}
long ans = 0;
... |
A20261 | A20699 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package code;
/**
*
* @author Yogendra
*/
import java.io.*;
import java.util.Scanner;
public class second {
static int x,y,z;
public static void main(String[] args) throws IOException {
... |
B11361 | B10299 | 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.BufferedReader;
import java.io.DataInputStream;
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 Learn {
static void one(Object s) {
System.out.print("Obj... |
A12846 | A12079 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam.common;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Lance Chen
*/
public class CodeHelper {
private static String FILE_ROOT = "D:/workspace/googlecodejam/meta";
publi... | package com.renoux.gael.codejam.cj2012.qb;
import com.renoux.gael.codejam.fwk.Solver;
import com.renoux.gael.codejam.utils.ArrayUtils;
import com.renoux.gael.codejam.utils.Input;
import com.renoux.gael.codejam.utils.Output;
public class QB extends Solver {
public static void main(String... args) throws Exception {
... |
A22642 | A22859 | 0 | import java.util.*;
import java.io.*;
public class DancingWithTheGooglers
{
public DancingWithTheGooglers()
{
Scanner inFile = null;
try
{
inFile = new Scanner(new File("inputB.txt"));
}
catch(Exception e)
{
System.out.println("Problem ope... | package codejam;
public class Dancer extends CodeJam{
public Dancer() {
super("B-large");
}
public static void main(String[] args) {
new Dancer().run();
}
@Override
protected String solve() {
int n = scanner.nextInt();
int s = scanner.nextInt();
int p ... |
A20261 | A22239 | 0 | package com.gcj.parser;
public class MaxPoints {
public static int normal(int value){
int toReturn = 0;
switch (value) {
case 0 : toReturn = 0 ; break;
case 1 : toReturn = 1 ; break;
case 2 : toReturn = 1 ; break;
case 3 : toReturn = 1 ; break;
case 4 : toReturn = 2 ; break;
case 5 : toReturn = 2 ; b... | import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class B {
public static void main(String args[]) {
try {
String fileName = "C:\\Users... |
A22992 | A21360 | 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.FileNotFoundException;
import java.io.IOException;
import java.util.Scanner;
public class Triplets {
public static void main(String[] args) throws IOException {
new Triplets().run("B-large.in");
// new Triplets().run("problem.txt");
}
public void run(String fileName) throws ... |
B21752 | B21700 | 0 | package Main;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
/**
* Created with IntelliJ IDEA.
* User: arran
* Date: 14/04/12
* Time: 3:12 PM
* To change ... | package com.paupicas.year2012.codejam.qr;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
public class C {
public static void main(String[] args) throws Exception {
String filename = "C-large";
BufferedReader inputFile = new BufferedReader(new FileR... |
B20734 | B22246 | 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.util.LinkedList;
import java.util.Scanner;
public class Recycle {
private static int[] total(int r) {
int i=1, t=10;
while(r/t > 0) {
i++;
t*=10;
}
return new int[] {i,t/10};
}
private static int pow(int c) {
int t=1;
while(c-->0)
t*=10;
return t;
}
private static int recy... |
B20734 | B21743 | 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.util.Scanner;
import java.util.HashSet;
public class Recycle
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
int nums = in.nextInt();
for (int p = 0; p < nums; p++)
{
int a = in.nextInt();
int b = in.nextInt();
in... |
A10793 | A11450 | 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 de.hg.codejam.tasks.dance.service;
import de.hg.codejam.tasks.dance.domain.Case;
public abstract class Calculator {
public static int[] calculate(Case[] cases) {
int[] results = new int[cases.length];
for (int i = 0; i < cases.length; i++)
results[i] = calculate(cases[i]);
return results;
}
pu... |
B11421 | B12360 | 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... | package codejam.qualification;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(new File("input.txt"));
FileWriter out = new FileWriter("output.txt");
... |
A12273 | A12538 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Dancing
* Jason Bradley Nel
* 16287398
*/
import java.io.*;
public class Dancing {
public static void main(String[] args) {
In input = new In("input.txt");
int T = Integer.parseInt(input.... | package small;
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 javax.swing.plaf.basic.BasicInternalFrameTitlePane.MaximizeAction;
public class DancingGooglers {
private s... |
A20261 | A20347 | 0 | package com.gcj.parser;
public class MaxPoints {
public static int normal(int value){
int toReturn = 0;
switch (value) {
case 0 : toReturn = 0 ; break;
case 1 : toReturn = 1 ; break;
case 2 : toReturn = 1 ; break;
case 3 : toReturn = 1 ; break;
case 4 : toReturn = 2 ; break;
case 5 : toReturn = 2 ; b... | import java.io.*;
import java.util.*;
import java.math.*;
import java.awt.geom.*;
import static java.lang.Math.*;
public class Solution implements Runnable {
int sum1 []; // diff < 2
int sum2 []; // diff == 2
public void solve () throws Exception {
int tt = nextInt();
sum1 = new int [31];
sum2 = new i... |
B10245 | B11720 | 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 codejam.network172.com;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.LinkedList;
public class CodeJam {
public static void main(String[] args) {
try {
B... |
B12074 | B11637 | 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.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class CRecycled {
public static void main(String[] args) throws FileNotFoundException {
Scanner in = new Scanner(new File("C-small.in"));
... |
A22191 | A21187 | 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... | /**
* Copyright 2012 Christopher Schmitz. All Rights Reserved.
*/
package com.isotopeent.codejam.lib;
import java.io.File;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
public class Utils {
private static final String FILE_IN_EXTENSION = ".... |
A21010 | A23023 | 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... | /*
* 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;
public class CaseB... |
A11277 | A13213 | 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.*;
import java.util.*;
public class B {
public static BufferedReader in;
public static StringTokenizer st;
public static void main(String[] args) throws IOException{
in = new BufferedReader(new FileReader("B.in"));
PrintWriter out = new PrintWriter(new FileWriter("B.out"));
int test = rea... |
B21270 | B21321 | 0 | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
public class CopyOfCopyOfMain {
static int ndigits(int n) {
return (int) (Math.log10(n) + 1);
}
static i... | import java.io.*;
import java.util.*;
public class Main{
public static void main (String[] args) throws java.lang.Exception{
Scanner in = new Scanner(System.in);
int T=in.nextInt();
int res[]=new int[T];
for(int t=0;t<T;t++){
int A=in.nextInt();
int B=in.nextInt();
... |
A10793 | A12570 | 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 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... |
A22078 | A22871 | 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.*;
public class Main2 {
public static void main(String[] args) {
try {
String[] a;
FileInputStream fstream = new FileInputStream("B-large.in");
DataInputStream in = new DataInputStream(fstream);
FileWriter fst = new FileWriter("out.txt");
BufferedWriter out = new BufferedWriter(fst);
... |
B20734 | B21712 | 0 | package fixjava;
public class StringUtils {
/** Repeat the given string the requested number of times. */
public static String repeat(String str, int numTimes) {
StringBuilder buf = new StringBuilder(Math.max(0, str.length() * numTimes));
for (int i = 0; i < numTimes; i++)
buf.append(str);
return buf.toStr... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
public class CodeJamSolverRecycle {
public static HashMap<Integer,... |
A10568 | A12844 | 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 codejam.common;
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;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author chenling
*/
public... |
A12273 | A12219 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Dancing
* Jason Bradley Nel
* 16287398
*/
import java.io.*;
public class Dancing {
public static void main(String[] args) {
In input = new In("input.txt");
int T = Integer.parseInt(input.... | import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
public class Dancing_with_the_Googlers {
public static void main(String[] args) throws IOException
{
FileInputStream fis;
try {
fis = ... |
A20261 | A21705 | 0 | package com.gcj.parser;
public class MaxPoints {
public static int normal(int value){
int toReturn = 0;
switch (value) {
case 0 : toReturn = 0 ; break;
case 1 : toReturn = 1 ; break;
case 2 : toReturn = 1 ; break;
case 3 : toReturn = 1 ; break;
case 4 : toReturn = 2 ; break;
case 5 : toReturn = 2 ; b... | import java.text.*;
import java.io.*;
import java.util.*;
import java.lang.Math;
public class B
{
public static void main(String[] args) throws Exception
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int T = Integer.parseInt(br.readLine());
for(int t = 1; t <= T; t++) {
... |
B21270 | B21542 | 0 | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
public class CopyOfCopyOfMain {
static int ndigits(int n) {
return (int) (Math.log10(n) + 1);
}
static i... | import java.io.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 recycled {
static int f_recycled(String s_min,String s_max){
int num_recycled=0;
int min=Integer.par... |
A20730 | A20093 | 0 | import java.util.Scanner;
public class B {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int zz = 1; zz <= T;zz++){
int N = in.nextInt();
int S = in.nextInt();
int p = in.nextInt();
int x = 0;
for(int i = 0; i < N;i++){
int score = in.n... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package googlecodejam;
import java.io.FileNotFoundException;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;
/**
*
* @author Tobi
*/
public ... |
B12570 | B11614 | 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.IOException;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.Scanner;
public class leadingZero {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated method... |
B21049 | B22199 | 0 | package it.simone.google.code.jam2012;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumber implements GoogleCodeExercise {
int a = 0;
int b = 0;
Set<Couple> distinctCouple = null;
long maxTime = 0;
private class Couple {
int x = 0;
int y = 0;
public Couple(int x, int y) {
this... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
class IOSystem {
private String filePath;
private List<String> inputList = new ArrayList<String>... |
B12941 | B12835 | 0 | package com.menzus.gcj._2012.qualification.c;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class CProcessorFactory extends AbstractProcessorFactory<CInput, COutputEntry> {
public CProcessorFactory(Str... | import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Scanner;
public class E3 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = null;
sc = new Scanner(System... |
B11327 | B10948 | 0 | package recycledNumbers;
public class OutputData {
private int[] Steps;
public int[] getSteps() {
return Steps;
}
public OutputData(int [] Steps){
this.Steps = Steps;
for(int i=0;i<this.Steps.length;i++){
System.out.println("Test "+(i+1)+": "+Steps[i]);
}
}
}
| package qualification;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;
public class Recycled {
private static String fileName = "recycled-small";
private st... |
A20490 | A22986 | 0 | /**
*
*/
package hu.herba.codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io... | package com.irabin.google.codejam.problem2;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Scanner;
public class DanceWithGoogler {
class Score {
private Long score;
private Long firstJ... |
B20566 | B20770 | 0 | import java.util.Scanner;
import java.io.*;
import java.lang.Math;
public class C{
public static int recycle(String str){
String[] numbers = str.split(" ");
int min = Integer.parseInt(numbers[0]);
int max = Integer.parseInt(numbers[1]);
int ret = 0;
for(int i = min; i < max; i++){
String num = i + "";
... | import java.util.TreeSet;
public class SolveThread implements Runnable{
private TreeSet<Integer> nbs;
int pairs = 0, casenb;
private ThreadDispatcher td;
private int A, B;
public SolveThread(int A, int B, int casenb, ThreadDispatcher td){
nbs = new TreeSet<Integer>();
this.A = A;
this.B = B;
for(int ... |
A11135 | A11072 | 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.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.Scanner;
public class Problem2 {
public static void main(String[] args) throws FileNotFoundException {
Scanner input = new Scanner(new File("input.txt"));
PrintStream output =... |
A20934 | A20602 | 0 | import java.util.*;
public class B {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
B th = new B();
for (int i = 0; i < T; i++) {
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt()... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
public static File input;
public static FileR... |
B10899 | B11426 | 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.*;
public class RecycledNumbers {
static int A, B;
public static void main(String[] args) throws IOException {
Kattio io = new Kattio(System.in, new FileOutputStream("recycle.out"));
int T = io.getInt();
for (int test = 1; test <= T; test++) {
A = io.getInt();
B = io... |
A11135 | A10814 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Arrays;
import java.util.Scanner;
public class Scores
{
public static void main(String[] args) throws IOException
{
Scanner scan = new Scanner(new File("B-small-attempt0.in"));
FileWrite... |
A21396 | A21762 | 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 Q1;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
public class Dancing {
/**
* @param args
*/
public static void main(String[] args) {
//Open the file for reading
String this... |
B10899 | B11084 | 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 fixjava;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map.Entry;
import java.util.Set;
/**
* Simple multimap class. <code>
MultiMap<String, String> map = MultiMapKeyToList.make();
map.put("a",... |
B10155 | B12535 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam3;
import java.io.File;
import java.io.*;
import java.util.*;
/**
*
* @author saad
*/
public class Codejam3 {
/**
* @param args the command line arguments
*/
static int convert(Inte... |
B10361 | B11236 | 0 | package codejam;
import java.util.*;
import java.io.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("in.txt"));
PrintWriter out = new PrintWriter(new File("out.txt"));
int T = Integer.parseInt(in.readLine());... | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Hashtable;
public class RecycleNumber_1 {
/**
* @param args
*/
public static void main(S... |
A11201 | A12252 | 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.... | /*************************************************************************
* Compilation: javac StdOut.java
* Execution: java StdOut
*
* Writes data of various types to standard output.
*
*************************************************************************/
import java.io.OutputStreamWriter;
import j... |
B12082 | B12732 | 0 | package jp.funnything.competition.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.apache.commons.io.IOUtils;
public class QuestionReader {
pr... | import java.io.*;
public class googleJam3 {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
BufferedReader reader = null;
PrintWriter writer = null;
try{
reader = new BufferedReader(new FileReader("C-small-attempt0.in"));
writer = ne... |
B20424 | B22201 | 0 | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
// static int MAX = 10000;
static int MAX = 2000000;
static Object[] All = new Object[MAX+1];
static int size( int x ) {
if(x>999999) return 7;
if(x>99999) return 6;
if(x>9999) return 5;
if(x>999) retu... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
/**
*
*... |
A12273 | A10104 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Dancing
* Jason Bradley Nel
* 16287398
*/
import java.io.*;
public class Dancing {
public static void main(String[] args) {
In input = new In("input.txt");
int T = Integer.parseInt(input.... | import java.util.*;
public class Problem2 {
public Problem2(){
Scanner scan = new Scanner(System.in);
int inputs = scan.nextInt();
for(int i=1; i<=inputs; i++){
int googlers = scan.nextInt();
int sur = scan.nextInt();
int bResult = scan.nextInt();
int num = 0;
int[] results = new int[googlers];
... |
A11201 | A10031 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | import java.util.Scanner;
class DancingWithGooglers {
Scanner s = new Scanner(System.in);
public static void main(String args[]) {
DancingWithGooglers p = new DancingWithGooglers();
p.run();
}
void run() {
prepare();
int nCases = s.nextInt();
for (int i=0; i<nCases; i++) {
Syst... |
A10568 | A11583 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader (new... |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.Integer;
import java.util.ArrayList;
class jam1a {
public static void main(String[] args) {
BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));
try {
String s = ... |
A22378 | A22249 | 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... | /*
* 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... |
A10568 | A11834 | 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.IOException;
import java.util.Scanner;
public class B {
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(new File("B-small.in"));
FileWriter fw = new FileWriter("B-small.out");
int T = in.nextInt();
for... |
A20382 | A21762 | 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 Q1;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
public class Dancing {
/**
* @param args
*/
public static void main(String[] args) {
//Open the file for reading
String this... |
B21790 | B20685 | 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... | import java.util.*;
public class C {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
C th = new C();
for (int i = 0; i < T; i++) {
int A = sc.nextInt();
int B = sc.nextInt();
int c = th.getAnswer... |
B11696 | B11617 | 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.util.*;
public class permute
{
static LinkedList<Integer>[] build;
public static void Permute()
{
build = new LinkedList[1001];
for(int i=1 ; i<=1000 ; i++)
{
build[i] = new LinkedList();
String str = new String(i+"");
for(int j=0 ; j<str.length() ; j++)
{
char s2 = str.charAt(0);... |
B10245 | B11275 | 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.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
public class Ejercicio31 {
DataInputStream entrada;
ArrayList<String> datos;
public Ejercicio31() {
// TODO Auto-generated constructor stu
datos = new ... |
B20291 | B20169 | 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.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... |
B12570 | B13097 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | package actual;
import java.io.*;
import java.util.*;
public class C
{
String line;
StringTokenizer inputParser;
BufferedReader is;
FileInputStream fstream;
DataInputStream in;
void openInput(String file)
{
//is = new BufferedReader(new InputStreamReader(System.in));//stdin
try{
fstream = new FileInpu... |
A21396 | A22763 | 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.*;
import java.util.*;
public class googlers {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
Scanner fe = new Scanner(new FileInputStream(
"/home/gllera/Desktop/data.in"));
FileWriter fs = new FileWriter("/home/gllera/Desktop/dat... |
B11318 | B10126 | 0 | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
int casos=1, a, b, n, m, cont;
while(t!=0){
a=sc.nextInt();
b=sc.nextInt();
if(a>b){
int aux=a;
a=b;
b=aux;
}
System.out.printf("Case #%d: ",casos... | import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.FileWriter;
class Start{
BufferedInputStream bis=new BufferedInputStream(System.in);
PrintWriter out=new PrintWriter(System.out, true);
int i,j,k,l,m,n,o,p,q,r,s,t,w,x,y,z,ry,rz,rs;
long a,b,c;
double d,e,f,... |
B12074 | B10934 | 0 | package jp.funnything.competition.util;
import java.math.BigInteger;
/**
* Utility for BigInteger
*/
public class BI {
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger add( final BigInteger x , final BigInteger y ) {
return... | import java.io.*;
import java.util.Scanner;
public class Main3 {
public static void main(String args[]) throws FileNotFoundException
{
//String test = "123400";
//System.out.println(test.substring(2,4));
Scanner in = new Scanner(new FileReader("input.in"));
PrintWriter out = new PrintWriter("output.txt");
i... |
A20490 | A20156 | 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.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Collections;
public class crazysolution {
/**
... |
B11421 | B12391 | 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.*;
/**
* @author: Ignat Alexeyenko
* Date: 4/14/12
*/
public class RecycledNumbersMain {
public static final int MAX_LENGTH = 80;
public static void main(String[] args) {
RecycledNumbersMain main = new RecycledNumbersMain();
main.runConsoleApp(System.in, ... |
B21227 | B20258 | 0 | import java.util.HashSet;
import java.util.Scanner;
public class C {
static HashSet p = new HashSet();
static int low;
static int high;
int count = 0;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int no = sc.nextInt();
for (int i = 1; i <= no; i++) {
p.clear();
lo... | package codejam.recycled_numbers;
import java.io.IOException;
import java.util.ArrayList;
import codejam.filestuff.FileStuff;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
FileStuff fs = new FileStuff("C-large.in","C-large.out","recycled_numbers");
ArrayList<String>... |
B20734 | B22044 | 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 google.problems;
import google.loader.Challenge;
public abstract class AbstractChallenge implements Challenge{
private final int problemNumber;
private String result;
public AbstractChallenge(int i) {
this.problemNumber = i;
}
protected void setResult(String result){
this.result = result;
}
... |
B21049 | B21035 | 0 | package it.simone.google.code.jam2012;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumber implements GoogleCodeExercise {
int a = 0;
int b = 0;
Set<Couple> distinctCouple = null;
long maxTime = 0;
private class Couple {
int x = 0;
int y = 0;
public Couple(int x, int y) {
this... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
public class Main
{
public static HashMap<Character,Character> mapp = new HashMap<Character,Character>();
public static void mai... |
A11135 | A10692 | 0 | /**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/3/12
* Time: 11:00 AM
* To change this template use File | Settings | File Templates.
*/
import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;
import java.io.*;
import java.util.*;
import java.uti... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.StringReader;
public class Dancing {
public static void main(String [] args) throws NumberFormatException, IOException
{
BufferedReader in = new BufferedReader(new StringReader(args[0]));
int rows = Integer.parseInt(in.readLine());
f... |
B12762 | B11729 | 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 ... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package speaking;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.LinkedList;
/**
*
* @author Marisol
*/
public class clsArchivo{
private LinkedList<String> li... |
A22360 | A22180 | 0 | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Scanner;
public class Dancing_With_the_Googlers {
/**
* The first line of the input gives the ... | import java.io.*;
import java.util.*;
public class Java{
public static void main(String[] args) {
try {
BufferedReader in = new BufferedReader(new FileReader("B-large.in"));
int cases = Integer.parseInt(in.readLine());
for (int i = 1; i <= cases; i ++){
String[] temp = (in.readLine()).split(" ");
... |
A20382 | A22763 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... | import java.io.*;
import java.util.*;
public class googlers {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
Scanner fe = new Scanner(new FileInputStream(
"/home/gllera/Desktop/data.in"));
FileWriter fs = new FileWriter("/home/gllera/Desktop/dat... |
A11277 | A12251 | 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 year2012.qualification.b;
import java.io.File;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;
public class DancingWithTheGooglers {
public static void main(String[] args) throws Exception{
/... |
B20023 | B20114 | 0 | 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.Set;
public class GoogleC {
public String szamol(String input){
String result="";
String... | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Scanner;
public class RecycledNumbers {
/**
* @param args
* @throws FileNotFoundException
*/
... |
A12113 | A13182 | 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"... |
/**
* @(#)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) {
/... |
B11696 | B11525 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recycled;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
public class Main {
/**
* @param arg... |
B10231 | B13166 | 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... | //input file must be in.txt in this directory
//output file will be out.txt
import java.io.*;
import java.util.*;
public class C
{
public static Scanner in;
public static PrintStream out;
public static void main(String [] args) throws Throwable
{
in = new Scanner(new File("in.txt"));
int cases = in.nextInt();
... |
A11502 | A10410 | 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 codeJamB;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
public class PgmTemplate {
/**
* @param args
*/
public static String delims = "[ ]+";
public static PrintStream ps;
public static vo... |
A12113 | A11957 | 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 prg2;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;
/**
* @author Brijesh Mistry
*
*/
public class GooglerDance {
public static void main(String[] args) {
... |
A12113 | A12222 | 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.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class DancingWithGooglers {
public static void main(String[] args) throws IOException{
String path = "C:\\Users\\Rapol Tongchenchitt... |
B10899 | B11461 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Scanner;
public class C {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter("c.txt")));
/... |
A12113 | A11017 | 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 fixjava;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import java.util.Map.Entry;
public class HashMapDualKey<K1, K2, V> extends HashMap<K1, HashMap<K2, V>> {
private static final long serialVersionUID = 1L;
/** Returns whether the dual map contains ... |
A10793 | A10948 | 0 | import java.io.*;
import java.math.*;
import java.util.*;
import java.text.*;
public class b {
public static void main(String[] args) {
Scanner sc = new Scanner(new BufferedInputStream(System.in));
int T = sc.nextInt();
for (int casenumber = 1; casenumber <= T; ++casenumber) {
... | import java.io.*;
import java.util.Scanner;
import java.util.*;
public class trie
{
public static void main(String[] args) throws IOException
{
int i,j,nog,nos,p,n,count;
int[] t=new int[10];
String s1="",p1="",m1="";
solver h1=new solver();
Scanner fin=new Scanner(new F... |
B12085 | B12650 | 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... | //lukewillson
import java.io.PrintStream;
import java.io.File;
import java.util.Scanner;
public class C {
public static void main(String[] args) throws Exception {
new DoC();
}
}
class DoC {
public DoC() throws Exception {
//long time=System.currentTimeMillis();
System.setOut(... |
B10702 | B11533 | 0 | import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Recycle {
private static HashMap<Integer, HashSet<Integer>> map = new HashMap<Integer, HashSet<Integer>>();
private static HashSet<Integer> toSkip = new HashSet<Integer>();
/**
* @param args
*/
public static void main(S... | package com.google.jam.eaque.stub;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
public class InputFileManager {
private BufferedReader br;
public InputFileManager(String filePath) throws NumberFormatException,
IOException {
br = new BufferedReader(new FileReader(fileP... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.