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 | B12172 | 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.FileInputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Scanner;
public class Runner {
class ll {
public lln f;
public lln l;
}
class lln {
public Object v;
public lln n;
}
private static Scanner sc;
public static int gi() {
return Integer.parseInt(s... |
B13196 | B11810 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Q3M {
public static void main(String[] args) throws Exception {
compute();
}
private ... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejamc;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Iterator;
/**
*
* @author strigazi
*/
public class TextFile implements Iterable<String> {
/... |
B13196 | B10116 | 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[] arg)
{
Scanner in = new Scanner(System.in);
int trials = in.nextInt();
int tt = 0;
while(tt < trials)
{
int ret = 0;
int A = in.nextInt();
int B = in.nextInt();
for(int i=A; i<B; ++i)
{
String num = Integer.toString... |
A21557 | A22848 | 0 | import java.io.*;
import java.util.*;
public class DancingWithGooglers {
public static class Googlers {
public int T;
public int surp;
public boolean surprising;
public boolean pSurprising;
public boolean antiSurprising;
public boolean pAntiSurprising;
public Googlers(int T, int surp) ... | import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class Dancing {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(new FileReader("dancing.in"));
PrintWriter out = new PrintWriter(new ... |
B21207 | B20133 | 0 | /*
* Problem C. Recycled Numbers
*
* Do you ever become frustrated with television because you keep seeing the
* same things, recycled over and over again? Well I personally don't care about
* television, but I do sometimes feel that way about numbers.
*
* Let's say a pair of distinct positive integers (n, m) ... | import java.util.*;
import java.io.*;
class Recycled_Numbers
{
public static void main(String arg [])
{
int check =-456;
String m="";
int counter =0;
int calculate =0;
String sub="";
int mi =0;
int ma=0;
String path;
String first,second;
int numberOfLoops=0;
Scanner ... |
A10996 | A11169 | 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);
... | package codezam.exercise.WR1B2012;
import java.util.ArrayList;
import java.util.List;
public class TripletSet {
List<Triplet> tripletList = new ArrayList<Triplet>();
//SumÀ» ³ÖÀ¸¸é °¡´ÉÇÑ Valid Triplet Á¶ÇÕÀ» »ý¼ºÇÑ´Ù.
public TripletSet(long numberSum) {
double numberSumDouble = (double) numberSum;
long minV... |
A22191 | A20242 | 0 | package com.example;
import java.io.IOException;
import java.util.List;
public class ProblemB {
enum Result {
INSUFFICIENT,
SUFFICIENT,
SUFFICIENT_WHEN_SURPRISING
}
public static void main(String[] a) throws IOException {
List<String> lines = FileUtil.getLines("/B-large.in");
int cases = Int... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj2012;
/**
*
* @author allegea
*/
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintW... |
A21010 | A21642 | 0 | package codejam;
import fixjava.Pair;
public class Utils {
public static long minLong(long firstVal, long... otherVals) {
long minVal = firstVal;
for (int i = 0; i < otherVals.length; i++)
minVal = Math.min(firstVal, otherVals[i]);
return minVal;
}
public static int minInt(int firstVal, int... otherVals... | import java.util.Scanner;
/**
*
* @author Nur Endah Safitri
*/
public class D2 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int x = in.nextInt();
for (int i = 1; i <= x; i++) {
int res = 0;
int a = in.nextInt();
int ... |
A21010 | A21234 | 0 | package codejam;
import fixjava.Pair;
public class Utils {
public static long minLong(long firstVal, long... otherVals) {
long minVal = firstVal;
for (int i = 0; i < otherVals.length; i++)
minVal = Math.min(firstVal, otherVals[i]);
return minVal;
}
public static int minInt(int firstVal, int... otherVals... | package codejam;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import com.google.common.base.Splitter;
public class ProblemB extends CodeJamRunner {
private int nrOfCases;
private int testCaseIndex;
int numberOfGooglers;
int surprisingTriplets;
int personalBestBar;
int maxAbo... |
B11318 | B10949 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Q3 {
public static Problem[] probs;
static class Problem {
public int A;
public int B;
}
public static void ma... |
A10793 | A10317 | 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.PrintStream;
import java.util.Scanner;
public class B {
public static void main(String[] args) throws Exception {
System.setOut(new PrintStream("out"));
Scanner s = new Scanner(System.in);
int T = s.nextInt();
for (int t = 1; t <= T; t++) {
int N = s.nextInt();
int S = s.nextInt();
i... |
B10485 | B10446 | 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... | package qualification.taskC;
import Parser.MyReader;
import Parser.MyWriter;
public class Main {
private final static int n = 1001;
public static void main(String[] args) {
MyReader myReader = new MyReader(
"/Users/shami13/Downloads/C-small-attempt0.in");
MyWriter myWriter = new MyWriter(
"/Users/shami... |
B10245 | B10418 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | import java.io.File;
import java.io.FileWriter;
import java.util.Arrays;
import java.util.Scanner;
/**
* Author: Andriy Gusyev
* Date: 14.04.12
*/
public class Task2 {
static private int[] multiplers = {0, 0, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 10000000};
static private int cases;
static... |
B12085 | B10063 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | import java.util.*;
import java.io.*;
public class recycled {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(new File("input"));
int size = sc.nextInt();
for (int x = 0; x < size; x++) {
TreeSet<String> set = new TreeSet<String>();
TreeSet<String> set1 = new TreeSet<S... |
A10996 | A11472 | 0 | import java.util.Scanner;
import java.io.*;
class dance
{
public static void main (String[] args) throws IOException
{
File inputData = new File("B-small-attempt0.in");
File outputData= new File("Boutput.txt");
Scanner scan = new Scanner( inputData );
PrintStream print= new PrintStream(outputData);
... | import java.io.*;
import java.awt.*;
import java.lang.*;
import java.util.*;
public class SolutionTwo {
public static void main(String[] args) {
String fileName = null;
if (args.length > 0) {
fileName = args[0];
}
File file = null;
Scanner fileScanner = null;
Scanner lineScanner;
try {
file = new ... |
A20119 | A21898 | 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.Scanner;
import java.io.*;
public class Dancing {
public static void main(String [ ] args) throws Exception{
Scanner in = new Scanner(new File(args[0]));
PrintStream Output = new PrintStream(new FileOutputStream("soluzione.txt"));
int n = in.nextInt();
for(int i = 1; i <= n; i++){
int tot,... |
B20291 | B21575 | 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.util.*;
import static java.lang.Math.*;
import java.io.*;
public class C {
public static void main(String[] args) throws IOException {
/*BufferedReader in = new BufferedReader(new FileReader("C:/Users/Disha/Desktop/codejam/C-small.in"));
FileWriter fw = new FileWriter("C:/Users/Disha/Desktop/codejam... |
B20023 | B22032 | 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... | package com.menzus.gcj._2012.qualification.c;
import com.menzus.gcj.common.Processor;
public class CMain {
private static String LARGE_FILE_NAME = "src/main/resources/com/menzus/gcj/_2012/qualification/c/C-large.in.txt";
public static void main(String[] args) throws Exception {
Processor largeFileProcessor... |
A10568 | A11027 | 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 fixjava;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map.Entry;
import java.util.Set;
/**
* Simple multimap class. <code>
MultiMap<String, String> map = MultiMapKeyToSet.make();
map.put("a", ... |
A22360 | A20374 | 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 Main {
Scanner in;
PrintWriter out;
static final String problemName = "B";
static void asserT(boolean e) {
if (!e) {
throw new Error();
}
}
static class Triple {
int a;
int b;
int c;
int max;
int min;
Triple(int a, int b, int c... |
B11327 | B11453 | 0 | package recycledNumbers;
public class OutputData {
private int[] Steps;
public int[] getSteps() {
return Steps;
}
public OutputData(int [] Steps){
this.Steps = Steps;
for(int i=0;i<this.Steps.length;i++){
System.out.println("Test "+(i+1)+": "+Steps[i]);
}
}
}
| import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
class CodeJamTools
// http://snippets.dzone.com/posts/show/1335
{
public static String readFileAsString(String filePath) {
byte[] buffer = new byte[(int) new File(filePath).length()];
Buffere... |
B20006 | B22144 | 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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class C {
public static void main(String[] args) {
try {
int num;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = null;
str = br.readLine();
num = Integer.parseI... |
B12074 | B11692 | 0 | package jp.funnything.competition.util;
import java.math.BigInteger;
/**
* Utility for BigInteger
*/
public class BI {
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger add( final BigInteger x , final BigInteger y ) {
return... | import java.util.*;
import java.io.*;
public class Recycled {
public static void main(String[] args) {
Recycled d = new Recycled();
d.run();
}
public Recycled() {}
public boolean isRecyclable(int n, int m) {
boolean result = false;
String mStr = m + "";
String nStr = n + "";
if (mS... |
B10858 | B12278 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| import java.util.*;
public class C {
public static void main (String [] arg) {
int [][] store = new int [2000010][7];
for (int i = 1; i<store.length; ++i) {
int ptr = 0;
int j = rotate(i);
while (j != i) {
if (j > i) store[i][ptr++] = j;
j = rotate(j);
}
}
Scanner sc = new Scanner(System... |
B21752 | B20149 | 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 javaapplication3;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.Scanner;
/**
*
* @author yondaime
*/
public class JavaApplicat... |
B11696 | B13072 | 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.*;
import java.io.*;
public class Recycler{
//Vector<int> possibilities = new Vector<int>(0,0);
private static int[] slider;
private static String numString;
private static int rotCounter;
private static int pairCount;
private static String elements, toPrint;
private static int testNum;
priva... |
B10899 | B10357 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
public class ReadFile {
public static void main(... | package com.dten.cj.qual;
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
public class C {
public static int distinctPairs(int start, int end) {
int count = 0;
for (int i = start; i <= end; i++)
for (int j = start; j <= end; j++)
if (i < j && isPair(i, j))
... |
A12211 | A10029 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class Dancing_improved {
static int f_Superan_limites(String params){
int superan_limite=0;
String[] para... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
public class DancingWithGooglers {
static class Googler implements Comparable<Googler>{
int averageScore;
int remainder;
Googler(int averageScore, int remainder) {
this.averageScore = ave... |
A20261 | A20102 | 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.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];
... |
A10996 | A12202 | 0 | import java.util.Scanner;
import java.io.*;
class dance
{
public static void main (String[] args) throws IOException
{
File inputData = new File("B-small-attempt0.in");
File outputData= new File("Boutput.txt");
Scanner scan = new Scanner( inputData );
PrintStream print= new PrintStream(outputData);
... |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
/**
*
* @author Westy92
*/
public class Dancing
{
private BufferedReader stdin;
/**
* This method reads lines of input and sends them to a process method.
* @throws IOExce... |
B21207 | B21543 | 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) ... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package googlerecyclenum;
import java.util.*;
import java.io.*;
/**
*
* @author Aaron
*/
public class GoogleRecycleNum {
/**
* @param args the command line arguments
*/
public static void main(Str... |
A20934 | A21945 | 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.*;
import java.util.*;
public class B
{
public static void main(String[] args) throws Exception
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int numCases = Integer.parseInt(br.readLine());
for(int i = 0; i < numCases; i++) {
solveCase(i+1, br.readLine());
... |
A10568 | A11688 | 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.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class QuestionA extends Question{
private static Map<Character, Character> translationMap;
private static boolean isInit;
private StringBuilder sb;
public QuestionA(Result result, Counter counter)
{
super(result, counter);
if... |
B12085 | B13024 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... |
import java.util.*;
import java.io.*;
public class template {
private StringBuilder result = new StringBuilder();
public static void main(String[] args) {
new template().go();
}
public void go() {
File inputFile = new File("/Users/amornchaikanokpullwad/Documents/input.in");
... |
A13029 | A12793 | 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 Surprising {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int cases = scan.nextInt();
for (int trial = 1; trial <= cases; trial++) {
System.out.print("Case #" + trial + ": ");
int googlers = scan.nextInt();
int surprising = scan.... |
B11421 | B12981 | 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 ReNum {
static BufferedReader br;
static PrintWriter pw;
public static void main(String args[]) {
try {
br = new BufferedReader(new FileReader("C-small-attempt1.in"));
pw = new PrintWriter(new File("ReNumAns.out"));
String no = br.re... |
B21968 | B21581 | 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.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
public class Recycled {
/**
* @param args
*/
public static void main(String[] args) {
try {
System.setIn(new FileInputStream("../C-large.in"));
} catch (FileNotFoundExce... |
A12211 | A12688 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class Dancing_improved {
static int f_Superan_limites(String params){
int superan_limite=0;
String[] para... | import java.io.*;
public class googleJam2 {
/**
* @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("B-small-attempt1.in"));
int numInpu... |
B21968 | B20516 | 0 | import java.util.*;
import java.io.*;
public class recycled_numbers {
public static void main(String[]a) throws Exception{
Scanner f = new Scanner(new File(a[0]));
int result=0;
int A,B;
String n,m;
HashSet<String> s=new HashSet<String>();
int T=f.nextInt(); //T total case count
for (int t=1; t<=T... | import java.io.*;
import java.util.*;
import java.lang.*;
public class Recycled {
public static int cases = 0;
public static int min[] = new int[50];
public static int max[] = new int[50];
public static int answer[] = new int[50];
public static ArrayList<Integer> results = new ArrayList<Integer>();
public stati... |
B22190 | B21924 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
public class Recycled {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.par... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class ProblemC {
public static void main(String[] args){
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
try{
String line = in.readLine();
in... |
B21373 | B20923 | 0 | import java.io.*;
import java.util.*;
import java.awt.Point;
class Case{
int num0;
long num1,num2;
String result="";
public Case(File aFile) {
try{
StringBuilder contents = new StringBuilder();
BufferedReader input = new BufferedReader(new FileReader(aFile));
String line = input.readLine();
num0 ... | package Qualification_2012;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
public class RecycledNumbers {
static BufferedReader in;
static int A, B;
static boolean[][] v;
static HashSet<String> hash;
private static int ... |
A22378 | A22595 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class CodeJam {
// public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt";
public static final String INP... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.Scanner;
public class Dancing {
public static void main(String args[]) {
try{
BufferedReader in = new BufferedReader(new FileReader("B-large.in"));
BufferedWriter out = new... |
A10793 | A12296 | 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.*;
public class Solution {
public static void main(String[] args) throws IOException {
StreamTokenizer in = new StreamTokenizer(new BufferedReader (new FileReader("input.in")));
PrintWriter out = new PrintWriter(new File("output.out"));
in.nextToken();
int t = (int)in.nval;
for (int i = 0;... |
B21049 | B22115 | 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.util.*;
public class RecycledNumbers {
void run(){
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for(int c=1 ; c<=T ; c++){
Integer res = 0;
int A = sc.nextInt();
int B = sc.nextInt();
for(int i=A ; i<=B ; i++){
String s = String.valueOf(i);
HashSet<Integer> used = ... |
B10231 | B11824 | 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.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
String inputName = "C-small-attempt0";
FileRead... |
A22992 | A20748 | 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... |
public class Triplet {
private int total;
public Triplet(int totalScore){
total = totalScore;
}
int getTotal() {
return total;
}
boolean isSuprisable() {
if (total < 2 || total > 28) {
return false;
} else {
return true;
}
}
int getBest(boolean suprising) {
int extra = total%3;
int mean... |
A20934 | A21330 | 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()... |
public class Googler implements Comparable<Googler> {
int score1;
int score2;
int score3;
int total;
int id;
int modulus;
int added;
public Googler(int id,int totalArg){
this.id = id;
total = totalArg;
score1=score2=score3=total/3;
modulus = total%3;
if(modulus>0){
score1++;
modulus--;
}
... |
B12074 | B10463 | 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 se.pathed.codejam.practice.recycled;
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.util.HashMap;
public class RecycledNumbers {
public static void main(String[] args) th... |
A22642 | A21496 | 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.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
public class B {
public static int b(String str){
int retVal = 0;
String arr[] = str.split(" ");
int N = Integer.parseInt(arr[0]);
... |
A22191 | A22822 | 0 | package com.example;
import java.io.IOException;
import java.util.List;
public class ProblemB {
enum Result {
INSUFFICIENT,
SUFFICIENT,
SUFFICIENT_WHEN_SURPRISING
}
public static void main(String[] a) throws IOException {
List<String> lines = FileUtil.getLines("/B-large.in");
int cases = Int... | package mgg.utils;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
/**
* @author manolo
* @date 13/04/12
*/
public class CombinatoryUtils {
public static List<Integer> findAddingCombination(int total,
List<Integer> listOfNumbers) {
ArrayList<Integer> solution = new ArrayList<I... |
A10996 | A12012 | 0 | import java.util.Scanner;
import java.io.*;
class dance
{
public static void main (String[] args) throws IOException
{
File inputData = new File("B-small-attempt0.in");
File outputData= new File("Boutput.txt");
Scanner scan = new Scanner( inputData );
PrintStream print= new PrintStream(outputData);
... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.PrintStream;
import java.util.StringTokenizer;
public class B {
private B() {
}
public static void main(final String[] args) throws Exception {
final B a = new B();
a.solve();
}
public v... |
B21049 | B21279 | 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.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
public class RecycledNumbers {
public RecycledNumbers() { }
public int solve(String str) {
Strin... |
A22360 | A21881 | 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.util.Scanner;
public class Scoring {
/**
* @param args
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int numLines = sc.nextInt();
int lineCount = 1;
while (numLines > 0) {
int numGoogler = sc.nextInt();
int numSurprisingScores = sc.nextInt();
i... |
A22191 | A21995 | 0 | package com.example;
import java.io.IOException;
import java.util.List;
public class ProblemB {
enum Result {
INSUFFICIENT,
SUFFICIENT,
SUFFICIENT_WHEN_SURPRISING
}
public static void main(String[] a) throws IOException {
List<String> lines = FileUtil.getLines("/B-large.in");
int cases = Int... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package dancingwithgooglers;
import java.util.Scanner;
/**
*
* @author topik
*/
public class DancingWithGooglers
{
/**
* @param args the command line arguments
*/
public static void main(String[] ... |
B11327 | B11418 | 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 problem.c;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Set;
import org.apache.commons.io.FileUtils;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
public class RecycledNumbers {
private static final String INPUT_FILE = "C-small-a... |
B21207 | B21326 | 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) ... | /**
* Created by IntelliJ IDEA.
* User: ashevenkov
* Date: 14.04.12
* Time: 11:17
*/
package codejam.codejam2012;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
* @author ash... |
B21968 | B21465 | 0 | import java.util.*;
import java.io.*;
public class recycled_numbers {
public static void main(String[]a) throws Exception{
Scanner f = new Scanner(new File(a[0]));
int result=0;
int A,B;
String n,m;
HashSet<String> s=new HashSet<String>();
int T=f.nextInt(); //T total case count
for (int t=1; t<=T... | package com.renoux.gael.codejam.utils;
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
public class Input implements Closeable {
BufferedReader reader;
private Input(BufferedReader reader) {
this.reader ... |
A12211 | A11914 | 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 gcj12_dancinggooglers;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.List;
public class GCJ12_DancingGooglers {
publi... |
A22078 | A20882 | 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... | package google.codejam;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Scanner;
public class Stark_B {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
Scanner sc = new Scanner(new FileReade... |
B10702 | B12541 | 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 CJ2;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.StringTokenizer;
public class Recycle {
static LinkedList<LinkedList<Integer>> db2 = n... |
A11135 | A12816 | 0 | /**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/3/12
* Time: 11:00 AM
* To change this template use File | Settings | File Templates.
*/
import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;
import java.io.*;
import java.util.*;
import java.uti... | import java.io.*;
import java.util.*;
public class dancing {
public static void main(String[] args)throws Exception{
Scanner f = new Scanner(new File(args[0]));
int count=0;//# tuples >= limit
int res=0; //mult result
int rem=0; //remainder
int N=0; //# tuples
int S=0; //# surprising tuples (t%r==2)
int... |
B21207 | B20314 | 0 | /*
* Problem C. Recycled Numbers
*
* Do you ever become frustrated with television because you keep seeing the
* same things, recycled over and over again? Well I personally don't care about
* television, but I do sometimes feel that way about numbers.
*
* Let's say a pair of distinct positive integers (n, m) ... | import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.util.Scanner;
public class EjercicioA {
public static boolean prueba = false;
public static void main(String args[]){
try {
FileOutputStream fos = new FileOutputStream(new File("solucion.txt"));
OutputS... |
B21752 | B21670 | 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.*;
public class ProblemC {
public class Case {
int a, b;
public void solve(int caseIndex) {
int length = Integer.toString(a).length();
int numPairs = 0;
for (int n = a; n <= b; n++) {
String ns = Integer.toString(n);
LinkedHashSet<Integer> distinctMs = new... |
A22378 | A21594 | 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... |
public class kickClass {
public static void main(String[] args){
//testGraph.run();
//testCollection.run();
solutionRunner t1 = new solutionRunner();
}
}
|
B11318 | B13162 | 0 | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
int casos=1, a, b, n, m, cont;
while(t!=0){
a=sc.nextInt();
b=sc.nextInt();
if(a>b){
int aux=a;
a=b;
b=aux;
}
System.out.printf("Case #%d: ",casos... | package org.weiwei.recyclenumber;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
/**
* Created with IntelliJ IDEA.
* User: ding
* Date: 12-4-14
* Time: ä¸å1:03
* To change this template use File | Settings | File Templates.
*/
public class RecyleBin {
int lower;
int higher;
... |
A12846 | A11991 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam.common;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Lance Chen
*/
public class CodeHelper {
private static String FILE_ROOT = "D:/workspace/googlecodejam/meta";
publi... | import java.util.*;
import java.io.*;
public class Main {
final static String FNAME = "A-small-practice";
public BufferedReader in;
public PrintWriter out;
static char[][] map = new char[2][26];
void open() throws IOException {
in = new BufferedReader( new FileReader( new File( FNAME + ".in" ) ) );
ou... |
B20734 | B22250 | 0 | package fixjava;
public class StringUtils {
/** Repeat the given string the requested number of times. */
public static String repeat(String str, int numTimes) {
StringBuilder buf = new StringBuilder(Math.max(0, str.length() * numTimes));
for (int i = 0; i < numTimes; i++)
buf.append(str);
return buf.toStr... | import java.io.*;
import java.nio.charset.Charset;
import java.nio.file.Path;
import java.util.ArrayList;
public class ReadWriter
{
public ArrayList<String> readFile(String path){
File file = new File(path);
ArrayList<String> strings = new ArrayList<String>();
BufferedReader reader = null;
... |
B21270 | B21694 | 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 C {
public static void main(String[] args) throws IOException {
//variable initialization
String inFile = args[0];
String outFile = inFile.split("\\.")[0] + ".out";
//file reading...
BufferedReader r... |
B21207 | B20392 | 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 com.googlerese.file;
import java.io.*;
import java.util.HashMap;
import java.util.Map;
public class FileRead {
private static FileRead instance = new FileRead();
private FileRead() {
}
public static FileRead getInstance() {
return instance;
}
public Map<Integer, String[]> r... |
A21396 | A22430 | 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.Scanner;
/**
*
* @author krishna
*/
public class Dance {
public static void main(String [] args)
{
Program();
}
public static void Program()
{
Scanner inp=new Scanner(System.in);
String patt[];
int count;
String line;
// Syst... |
A20261 | A22104 | 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 dancewithgoogle;
import java.util.*;
import java.io.*;
/**
*
* @author Aaron
*/
public class DanceWithGoogle {
/**
* @param args the command line arguments
*/
public static void main(Stri... |
A22191 | A20259 | 0 | package com.example;
import java.io.IOException;
import java.util.List;
public class ProblemB {
enum Result {
INSUFFICIENT,
SUFFICIENT,
SUFFICIENT_WHEN_SURPRISING
}
public static void main(String[] a) throws IOException {
List<String> lines = FileUtil.getLines("/B-large.in");
int cases = Int... | import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class B {
static ArrayList<Triplet> surprising = new ArrayList<Triplet>();
static ArrayList<Triplet> nonSurprising = new ArrayList<Triplet>();
pub... |
B20424 | B20754 | 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 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",... |
A22191 | A22864 | 0 | package com.example;
import java.io.IOException;
import java.util.List;
public class ProblemB {
enum Result {
INSUFFICIENT,
SUFFICIENT,
SUFFICIENT_WHEN_SURPRISING
}
public static void main(String[] a) throws IOException {
List<String> lines = FileUtil.getLines("/B-large.in");
int cases = Int... | import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class B {
public static void main(String[] args) throws IOException {
/*BufferedReader in = new BufferedReader(new FileReader("C:/Users/Farnoosh/Desktop/B-small.in"));
FileWriter fw = new FileWriter("C:/Users/Farnoosh/Desktop/B-small.out... |
B10155 | B12588 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
/**
*
* @author eblanco
*/
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
impo... | import java.util.*;
import java.io.*;
public class Recycled {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int cases = in.nextInt();
for (int i = 1; i<=cases; i++) {
int n = in.nextInt();
int m = in.nextInt();
int count = 0;
for (int b = m; b>n; b--) {
for (int... |
A22360 | A22702 | 0 | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Scanner;
public class Dancing_With_the_Googlers {
/**
* The first line of the input gives the ... | package jpt.codejam;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Codejam2012 {
static void solve_Qual_B() throws Exception {
Scanner in = new Scanner(System.in);
PrintStream out = System.out;
int cases = in.nextInt();
for (int nCase = ... |
A20119 | A23012 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... |
import java.io.*;
import java.util.*;
public class CodeJam2012_Q_B {
public int calc(int N, int S, int p, int[] score) {
int cnt=0;
for(int i=0; i<N; i++) {
if(score[i] >= p+Math.max(p-1, 0)*2) {
cnt++;
} else if(score[i]>=p+Math.max(p-2, 0)*2 && S>0) {
cnt++;
S--;
}
}
return cnt;
}... |
B12115 | B13207 | 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.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class ProblemC {
static Scanner kb = null;
static FileWriter fw = null;
public static void main(String []... |
A10793 | A12545 | 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 codejam2012.q;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Scanner;
public class B
{
static public void solveOne(int caseNo, Scanner in, PrintStream out)
{
int n = in.nextInt();
int s = in.nextInt();
int p = in.nextInt();
int norm = 0;
... |
B10155 | B11193 | 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 problem.c;
import java.util.Scanner;
import java.io.*;
/**
*
* @author Jason
*/
public class ProblemC {
/**
* @param args the command line arguments
*/
public static void main(String[] args... |
B10149 | B11283 | 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;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.Scanner;
public class C {
static int pow(int b)
{
return (int)Math.pow(10,b);
}
public static void main(String args[]) throws FileNotFoundException
{
Scanner sin=new Scanner(new Fil... |
B12074 | B11255 | 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... | /*
* Copyright 2012 Bill Bejeck
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
B20856 | B21723 | 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.*;
class Recycled
{
public static void main(String[] args) throws IOException
{
Scanner s = new Scanner(new File(args[0]));
int numTests = s.nextInt();
for (int i = 1; i <= numTests; i++)
{
// Clear the trailing newline on this li... |
B21227 | B21725 | 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 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 RecycledNumbers {... |
A22078 | A21438 | 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... | package template;
import java.io.*;
import java.util.ArrayList;
import java.util.Random;
public class Utils {
static String logfile = "";
public static BufferedWriter newBufferedWriter(String filename, boolean append) {
BufferedWriter bw = null;
try {
bw = new BufferedWriter(new ... |
B12085 | B13205 | 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... | // Google Code Jam 2011
// lid
package Real;
import java.io.*;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.InputMismatchException;
import org.apache.commons.lang.ArrayUtils;
@SuppressWarnings("unused")
class ... |
A22378 | A21116 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class CodeJam {
// public static final String INPUT_FILE_PATH = "D://CodeJamInput.txt";
public static final String INP... |
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.logging.Level;
import java.util.logging.Logger;
... |
B21207 | B20097 | 0 | /*
* Problem C. Recycled Numbers
*
* Do you ever become frustrated with television because you keep seeing the
* same things, recycled over and over again? Well I personally don't care about
* television, but I do sometimes feel that way about numbers.
*
* Let's say a pair of distinct positive integers (n, m) ... | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class main2 {
/**
* @param args
* @throws IOException
* @throws NumberFormatException
*/
public static void main(String[] args) throws Numb... |
B10245 | B10809 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | import java.io.File;
import java.util.HashSet;
import java.util.Scanner;
public class C {
public static void main(String[] args) throws Exception {
Scanner in = new Scanner(new File("C-small-attempt0.bin"));
// Scanner in = new Scanner(new File("test.in"));
int T = in.nextInt();
for (int zz = 1; zz <= T; ++zz... |
A12460 | A10774 | 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.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
public class Dance {
/* Returns pair (max if not surprising, max if surprising */
private static int[] max(int score) {
int max, maxsurpr;
if(score == 0) {
max = 0;
maxsurpr = 0;
} else... |
B12085 | B10479 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import javax.security.auth.x500.X500Principal;
public class Recycl... |
B11318 | B11936 | 0 | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
int casos=1, a, b, n, m, cont;
while(t!=0){
a=sc.nextInt();
b=sc.nextInt();
if(a>b){
int aux=a;
a=b;
b=aux;
}
System.out.printf("Case #%d: ",casos... | package code.google.codejam2k12.qualfication;
import java.io.BufferedReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokeni... |
B10149 | B10735 | 0 | import java.io.FileInputStream;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeSet;
// Recycled Numbers
// https://code.google.com/codejam/contest/1460488/dashboard#s=p2
public class C {
private static String process(Scanner in) {
int A = in.nextInt();
int B = in.nextInt();
int res =... | import java.util.Scanner;
import java.io.*;
public class Tolu
{
static String out="",output="";
public static void main(String[] args)
{
try
{
Scanner in = new Scanner(new File("input.in"));
int n = in.nextInt(); ... |
A22078 | A22465 | 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.IOException;
import java.util.List;
public class StoreCredit extends JamProblem {
public static void main(String[] args) throws IOException {
StoreCredit problem= new StoreCredit();
problem.go();
}
@Override
String solveCase(JamCase jamCase) {
StoreCreditCase cas... |
B11696 | B12659 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recycled;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util... | package com.kiwien.google;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.A... |
B22190 | B21563 | 0 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
public class Recycled {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.par... |
import java.io.File;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
public class C {
public static void main(String args[]) throws Exception {
final String PATH = "/home/goalboy/software installation/codejam-commandline-1.0-beta4/source/";
final String FILE = "C-l... |
B11421 | B10482 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class Recycled {
public static void main(String[] args) throws Exception{
String inputFile = "C-small-attempt0.in... | import java.util.HashSet;
import java.util.Set;
public class RecycledNumbers {
private static int doit(int n, int low) {
Set<Integer> result = new HashSet<Integer>();
String val = "" + n;
int tmpN;
for (int i = 1; i < val.length(); i++) {
tmpN = Integer.parseInt(val.substring(i) + val.substring(0, i));... |
A22360 | A22259 | 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.*;
public class DancingGooglers {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int T = 0;
int N = 0;
int S = 0;
int p = 0;
int ptr = 0;
int maxCount = 0;
int scoreSum = 0;
int score1 = 0;
int score2 = 0;
int score3 = 0;
... |
A20934 | A20811 | 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.IOException;
import java.io.InputStreamReader;
public class Dancing {
public static void main(String[] args) {
int numTestCases;
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
try {
numTestCases = Integer.parseInt(in.readLine());
... |
A11277 | A11884 | 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.File;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.Scanner;
public class Dance implements Runnable {
public void run(){
try {
Scanner in = new Scanner(new File("B-small-attempt0.in"));
PrintWriter out = new Pri... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.