F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
B20291 | B22243 | 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.Arrays;
import java.util.Scanner;
/**
* @author Dmitry Levshunov (levshunov.d@gmail.com)
*/
public class TaskC {
private static boolean[] used = new boolean[2000001];
private static int length;
private static int pow;
public static void main(String[] args) throws Exception {
... |
A20261 | A20032 | 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.*;
public class GoogleDancing {
public static void main(String[] args) throws IOException {
BufferedReader read = new BufferedReader(new FileReader("B-large.in.txt"));
int T = Integer.parseInt(read.readLine());
for(int i = 1; i <= T; i++){
StringTokenizer st = new StringToke... |
B11696 | B11502 | 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.FileReader;
import java.io.IOException;
public class problem {
public static void main(String[] args) throws IOException{
final String filein = "C:\\Users\\BYTE\\Downloads\\C-small-attempt0.in";
//final String filein = "C:\\Users\\byte\\Downloads\\NewFolder\\C-smal... |
A22078 | A21871 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author DEV
*/
import java.util.*;
import java.io.*;
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code appl... |
A10793 | A12838 | 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 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 = ... |
A22078 | A20926 | 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.*;
import java.io.*;
public class B{
void solve() throws FileNotFoundException{
File fin = new File("data.in");
File fout = new File("data.out");
Scanner cin = new Scanner(fin);
PrintWriter cout = new PrintWriter(fout);
int T, n, s, p;
T = cin.nextInt();
for(int k = 0; k < T; k++){
... |
B12085 | B10288 | 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.*;
import java.util.*;
public class Recycled {
public static class Pair {
private int a;
private int b;
public Pair(int a, int b) {
this.a = a;
this.b = b;
}
@Override
public boolean equals(Object o) {
if (this == ... |
B10702 | B13055 | 0 | import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Recycle {
private static HashMap<Integer, HashSet<Integer>> map = new HashMap<Integer, HashSet<Integer>>();
private static HashSet<Integer> toSkip = new HashSet<Integer>();
/**
* @param args
*/
public static void main(S... | import java.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 = ... |
B10858 | B11863 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class QualificationQ3 {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
FileWriter ... |
B10858 | B10122 | 0 | package be.mokarea.gcj.common;
public abstract class TestCaseReader<T extends TestCase> {
public abstract T nextCase() throws Exception;
public abstract int getMaxCaseNumber();
}
| import com.sun.xml.internal.messaging.saaj.packaging.mime.util.LineInputStream;
import sun.tools.tree.ReturnStatement;
import javax.swing.*;
import java.io.*;
import java.util.ArrayList;
/**
* Date: 14/4/12
* Time: 9:19 AM
*/
public class GoogleFileStream {
public static ArrayList<String> getInput() throws IOE... |
B21790 | B22257 | 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.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.HashSet;
public class ProblemB {
static HashSet<String> pairs = new HashSet<String>();
public static void main(S... |
A20261 | A22339 | 0 | package com.gcj.parser;
public class MaxPoints {
public static int normal(int value){
int toReturn = 0;
switch (value) {
case 0 : toReturn = 0 ; break;
case 1 : toReturn = 1 ; break;
case 2 : toReturn = 1 ; break;
case 3 : toReturn = 1 ; break;
case 4 : toReturn = 2 ; break;
case 5 : toReturn = 2 ; b... | package qualifier;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Map;
import java.util.Scanner;
public class TB {
private Map<Character, Character> translate = null;
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
PrintWr... |
B12082 | B11675 | 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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Calendar;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class C {
private static CodeJamIO io = new CodeJamIO();
/**
* @param args
*/
public... |
A11502 | A10489 | 0 | package template;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
public class TestCase {
private boolean isSolved;
private Object solution;
private Map<String, Integer> intProperties;
private Map<String, ArrayList<Integer>> intArrayProperties;
private Map<String, Arra... | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Iterator;
public class GCIFileWriter {
public GCIFileWriter (File file) throws IOException {
mBufferedWriter = new BufferedWriter(new FileWriter(file));
mFile = file;
}
public void wri... |
A12846 | A10549 | 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 gcj2012;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.StringTokenizer;
/**
* Google Code Jam 2012 B - Dancing With the Googlers
*
* @author Ruli Manurung (maruli@cs.ui.ac.id)
*/
public class QB
{
public stati... |
B10899 | B10145 | 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.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
/*
* Google Code Jam 2012
* Qualification 2012
* raguenets@gmail.com
* Usage : java RecycledN... |
B10485 | B13042 | 0 |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class Recycle
{
public static void main(String[] args)
{
/* Set<Integer> perms = getPermutations(123456);
for(Integer i: p... | import java.io.*;
class Recycle{
public static void main(String arg[])throws Exception
{
File f=new File("C-small-attempt0.in");
FileInputStream fin=new FileInputStream(f);
File f2=new File("bo.txt");
FileOutputStream fout=new FileOutputStream(f2);
BufferedWriter bwr=new BufferedWriter(new OutputStreamWriter(fout));
B... |
A20261 | A21983 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class B {
static PrintWriter out;
public static void main(String[] args) throws IOException {
String name = "B-large";
Scanner s = new Scanner(n... |
B21227 | B20245 | 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... |
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Scanner;
import java.util.Set;
... |
A12211 | A10319 | 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;
public class TestTwoSolver extends SolverModule {
public StringBuilder process(BufferedReader in, StringBuilder builder)
throws IOException {
in.readLine();
String line = in.readLine();
int count = 1;
while (line != null) {
line = processline(l... |
B20734 | B20598 | 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 student;
import java.io.*;
import java.util.*;
public class test {
public static int getShift(String t, int pos)
{
int len = t.length()/2;
return Integer.parseInt(t.substring(pos,pos+len));
}
public static void main(String[] args) throws IOException
{
Scanner fin = new Scanner(new File("C-la... |
B13196 | B12863 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Q3M {
public static void main(String[] args) throws Exception {
compute();
}
private ... | package google.codejam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class Main {
private static boolean debug = false;
public static void mai... |
B10231 | B10857 | 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 be.mokarea.gcj.common;
public abstract class TestCase {
private final int caseNumber;
protected TestCase(int caseNumber) {
this.caseNumber = caseNumber;
}
public int getCaseNumber() {
return caseNumber;
}
}
|
A20490 | A21124 | 0 | /**
*
*/
package hu.herba.codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io... | import java.util.Scanner;
public class Googlers {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int cases = sc.nextInt();
for (int x = 0; x < cases; x++) {
sc.nextLine();
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt();
int posibles = 0;
for (i... |
A10793 | A10694 | 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;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.RandomAccessFile;
public class B {
public static void main(String[] args) throws IOException {
RandomAccessFile raf = new RandomA... |
B20856 | B22256 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Happy;
import java.io.*;
import java.math.*;
import java.lang.*;
import java.util.*;
import java.util.Arrays.*;
import java.io.BufferedReader;
//import java.io.IOException;
//import java.io.InputStreamReader;
//... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
public class recycle {
static int lim,start;
static HashMap<String,HashSet<String>> set ;
/**
* @... |
B12570 | B12736 | 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.util.Scanner;
public class C_RecycledNumbers {
static int[] bases = {0, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000};
static int digits(int value) {
int i = 0;
for (; i < bases.length && value >= bases[i]; i++);
return i;
}
static int shift(int value, int len) {
i... |
B21049 | B21385 | 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.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
class Case {
public int A;
public int B;
public Case(int a, int b)
{
A = a;
... |
B20291 | B20855 | 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.Scanner;
public class RecycledNumbers {
static int recycle(int n, int B) {
String nString = String.valueOf(n);
int out = 0;
for (int i = 0; i < nString.length(); i++) {
int cut = nString.length() - (i + 1);
String temp = nString.substring(cut) + nString.substring(0, cut);
in... |
B10155 | B11667 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
/**
*
* @author eblanco
*/
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
impo... | import java.io.*;
public class Recycled{
public static void main(String args[])
{
try{
File myFile = new File("C-small-attempt0.in");
FileReader fileReader = new FileReader(myFile);
BufferedReader reader = new BufferedReader(fileReader);
FileWriter fileWriter = new FileWriter("C-small-attempt0.out");
BufferedWriter w... |
B21227 | B21366 | 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 com.sam.googlecodejam.recyclenumbers;
import java.util.HashSet;
import java.util.Set;
import com.sam.googlecodejam.helper.InputReader;
public class RecycleNumbers {
long pairCount;
public void getPairCount(long a, long b) {
int length = Long.toString(a).length();
long power = 1;
for (int i = 1; i <... |
B12762 | B11394 | 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 Problem3;
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.St... |
B10485 | B11630 | 0 |
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.io.BufferedWriter;
public class Recycle
{
public static void main(String[] args)
{
/* Set<Integer> perms = getPermutations(123456);
for(Integer i: p... | import java.util.ArrayList;
import java.util.Scanner;
public class DancingWithTheGooglers {
public static void main(String[] args){
Scanner keyin=new Scanner(System.in);
int T=keyin.nextInt();
keyin.nextLine();
int caseCount=0;
while ((T--)!=0){
int A=keyin.nextInt();
int B=keyin.nextInt();
int ... |
B12085 | B11724 | 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.awt.datatransfer.*;
import java.awt.Toolkit;
public class Repeat
{
private static String inp;
public Repeat()
{
}
public static void main(String[] args)
{
Transferable temp = (Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null));
try {
... |
B10231 | B10323 | 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.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.StringTokenizer;
/**
*
*/
/**
* @author Bageshwar
*
*/
public class Recycle {
/**
* @param args
* @throws IOException
*/
public static void main(Strin... |
A12113 | A11959 | 0 | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class B {
static int[][] memo;
static int[] nums;
static int p;
public static void main(String[] args)throws IOException
{
Scanner br=new Scanner(new File("B-small-attempt0.in"... | import java.io.*;
import java.sql.SQLOutput;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class ProblemB {
int[][] resultset = new int[3][3];
int googlersCount = 3;
int surprising = 1;
int winners=0;
int count = 0;
int p = 0;
FileWriter fstream;
... |
A22078 | A21122 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package leider.ken;
import java.io.*;
import java.util.*;
import java.util.concurrent.*;
/**
*
* @author ken
*/
public class CommandLine {
public static void main(String args[]) throws Exception {
Parse... |
A22360 | A20216 | 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.*;
class code3
{
public static void main(String args[]) throws Exception
{
File ii = new File ("B-large.in");
FileInputStream fis = new FileInputStream(ii);
BufferedReader br = new BufferedReader(new InputStreamReader (fis));
int cases = Integer.parseInt(br.readLine());
FileOutputStream fo... |
B22190 | B20832 | 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;
/**
* User: Sasha
* Date: 09.04.12
* Time: 19:13
*/
public class Main {
private Scanner sc;
private PrintWriter wr;
private HashSet<String> set;
private void prepare() throws Exception {
s... |
A22078 | A22976 | 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... | //input file must be in.txt in this directory
//output file will be out.txt
import java.io.*;
import java.util.*;
public class B
{
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();
... |
A12544 | A10971 | 0 | package problem1;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Arrays;
public class Problem1 {
public static void main(String[] args) throws FileNotFoundException, IOException{
try {
TextIO... | import java.io.*;
import java.util.*;
public class dancing {
static String next() {
if (st == null || !st.hasMoreTokens())
nextLine();
return st.nextToken();
}
static int nextInt() {
return Integer.parseInt(next());
}
static void nextLine() {
try {
st = new StringTokenizer(f.readLine());
} catch... |
B21270 | B20853 | 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.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... |
A13029 | A10562 | 0 | import java.util.List;
public class Case implements Runnable {
private int id;
private String output;
private int n;
private int s;
private int p;
private List<Integer> g;
public Case(int id) {
this.id = id;
}
public Case(int id, int n, int s, int p, List<Integer> g) {
super();
this.id = id;
this... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Googlers {
public static void main(String[] args) throws IOException {
BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(read.readLine());
for (int i = 1; ... |
B11421 | B13088 | 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.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Scanner;
import javax.management.RuntimeErrorException;
public class C {
public static void main(String[] args) throws FileNotFoundException {... |
A22992 | A21779 | 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.*;
import java.util.*;
public class Main{
public static void main (String[] args) throws java.lang.Exception{
BufferedReader bfr=new BufferedReader(new InputStreamReader(System.in));
int T=Integer.parseInt(bfr.readLine());
int res[]=new int[T];
Arrays.fill(res,0);
for(in... |
B12941 | B10009 | 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.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Recycled {
private static final String fileInName = "file.in";
private static final String... |
A11201 | A12339 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | package google.codejam2012.awanish;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;
import java.util.StringTokenizer;
public class GooglersDance {
private static int count = 0;
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
... |
A12846 | A10374 | 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.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
public class BQ {
public static void main(String[] args) {
BufferedReader reader = null;
... |
B12941 | B12320 | 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.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Set;
public class C {
PrintWriter out;
public void read() throws IOException {
BufferedReader br = new BufferedReader(new FileRe... |
B12941 | B12470 | 0 | package com.menzus.gcj._2012.qualification.c;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class CProcessorFactory extends AbstractProcessorFactory<CInput, COutputEntry> {
public CProcessorFactory(Str... | import java.util.List;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.Set;
import java.util.HashSet;
import java.io.*;
public class Rec {
public static void main(String args[]) throws IOException {
//Scanner in = new Scanner(System.in);
//int n = in.nextInt();
//in.nextLine();
Buffe... |
A22642 | A21724 | 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 org.mikeyin;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Scanner;
/**
* @author yincrash
*
*/
public class DancingWithGooglers
{
/**
* @param args
*/
public static void main(String[] args)
{
... |
B10899 | B10515 | 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.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class GCIFileReader {
public GCIFileReader(File file) throws FileNotFoundException {
mBufferedReader = new BufferedReader(new FileReader(file));
mFile = file;
... |
B10155 | B11562 | 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... | package codejam.is;
/**
* Created with IntelliJ IDEA.
* User: ofer
* Date: 4/13/12
* Time: 8:47 PM
* To change this template use File | Settings | File Templates.
*/
public interface Test {
/** Runs the test on the given input */
public void run(String input);
/** Returns the output of the test */
... |
B13196 | B11116 | 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 solution;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Enumeration;
import java.util.H... |
B12570 | B10412 | 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 com.google.codjam.utils;
import com.google.codjam.problems.ProblemInterface;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
public class FileLoader {
public static void processFi... |
A22992 | A21277 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Problem2;
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.St... |
B20424 | B20682 | 0 | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
// static int MAX = 10000;
static int MAX = 2000000;
static Object[] All = new Object[MAX+1];
static int size( int x ) {
if(x>999999) return 7;
if(x>99999) return 6;
if(x>9999) return 5;
if(x>999) retu... | import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Recycle {
/**
* @param args
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int i = 1; i <= T; i++) {
int A = sc.nextInt();
int B = sc.nextInt();
int... |
A12846 | A10254 | 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.io.BufferedReader;
import java.io.File;
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 DancingGooglers {
private String[] m_testInput;
private String[] m_testOutput;
private in... |
B22190 | B21944 | 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.util.HashMap;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for (int i = 1; i <= T; i++) {
int A = in.nextInt();
int B = in.nextInt();
int numberOfRecycledPairs = findNumb... |
B20006 | B21674 | 0 | import java.io.*;
import java.math.BigInteger;
import java.util.*;
import org.jfree.data.function.PowerFunction2D;
public class r2a
{
Map numMap = new HashMap();
int output = 0;
/**
* @param args
*/
public static void main(String[] args)
{
r2a mk = new r2a();
try {
... | import java.io.*;
import java.util.*;
public class CodeJamCLarge {
public static void main (String[] args) throws IOException {
int i, j, k;
long startTime = System.currentTimeMillis();
File inFile = new File("C-large.in"); // File to read from
File outFile = new File("C-large.out");
BufferedReader rea... |
A11502 | A12361 | 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 dancingwiththegooglers;
import inout.In;
import inout.Out;
import java.util.ArrayList;
import java.util.Collections;
public class Main {
public static void main(String[] args) throws Exception {
String[] strings = In.read("B-small-attempt3.in", 1);
int cont = 1;
for (String str : ... |
A20490 | A22160 | 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... | /*************************************************************************
* Compilation: javac In.java
* Execution: java In
*
* Reads in data of various types from: stdin, file, URL.
*
* % java In
*
* Remarks
* -------
* - isEmpty() returns true if there is no more input or
* it is all whi... |
B12762 | B10027 | 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.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... |
A11135 | A11569 | 0 | /**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/3/12
* Time: 11:00 AM
* To change this template use File | Settings | File Templates.
*/
import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;
import java.io.*;
import java.util.*;
import java.uti... | package dancingwiththegooglers;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.Writer;
import java.util.ArrayList;
import java.util.List;
pub... |
B10361 | B11904 | 0 | package codejam;
import java.util.*;
import java.io.*;
public class RecycledNumbers {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new FileReader("in.txt"));
PrintWriter out = new PrintWriter(new File("out.txt"));
int T = Integer.parseInt(in.readLine());... | package googleJam;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.HashSet;
import java.util.Scanner;
public class RecycledNumbers
{
public static void main(String[] args)
{
Scanner scan = null;
try
{
scan = new Scanner(new File(args[0]));
}
catch (FileNotFoundException e... |
A12544 | A10301 | 0 | package problem1;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Arrays;
public class Problem1 {
public static void main(String[] args) throws FileNotFoundException, IOException{
try {
TextIO... | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
public class B_DancingWiththeGooglers {
public static void main(String[] args) throws FileNotFoundException {
Scanner sc = new Scanner(new File("file1.in"));
PrintWriter writer = new PrintWriter(new Fi... |
A22360 | A20749 | 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 ... | public class Scores implements Comparable<Scores>{
private int first;
private int second;
private int third;
public Scores(int total) {
first = second = third = total / 3;
if( (total % 3) == 1 ) {
first += 1;
}
else if( (total % 3) == 2 ) {
first... |
A21010 | A22364 | 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.
*/
import java.util.Scanner;
/**
*
* @author leonardo
*/
public class Dance {
static boolean canBeSurprising(int x1, int x2, int x3) {
if (x1 > 10 || x2 > 10 || x3 > 10)
ret... |
B10149 | B12436 | 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.ArrayList;
import java.util.Scanner;
import java.io.*;
/**
*
*/
/**
* @author Daniel
*
*/
public class Recycled {
public static ArrayList<Integer> generateRecycled(int seed){
String seeds = Integer.toString(seed);
ArrayList<Integer> recycled = new ArrayList<Integer>();
Integer temp;
... |
A22771 | A21355 | 0 | package com.menzus.gcj._2012.qualification.b;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class BProcessorFactory extends AbstractProcessorFactory<BInput, BOutputEntry> {
public BProcessorFactory(Str... | package qualification;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import common.FileTranslatorBasis;
public class B {
int allOkLine;
int surprisingOkLine;
int allOkcount = 0;
int surprisingOkcount = 0;
int s;
public void setS(int s){
this.s = s;
}
public v... |
A11917 | A12211 | 0 | package com.silverduner.codejam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
public class Dancing {
public static void main(String[] args) throws Exception {
File input = new File("B-small-attempt... | import java.io.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... |
A21396 | A21552 | 0 | import java.util.*;
public class Test {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int i = 1; i<=T; i++) {
int n = in.nextInt();
int s = in.nextInt();
int p = in.nextInt();
int result = 0;
for(int j = 0; j<n; j++){
... | /**
*
*/
package com.sakthi.demo;
import java.io.File;
import java.util.Scanner;
/**
* @author Balaji
*
*/
public class GooglersDance {
/**
* @param args
*/
public static void main(String[] args) throws Exception{
// TODO Auto-generated method stub
// System.out.println("check");
Scanner in = new Sc... |
B12762 | B10317 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
import java.util.TreeMap;
import java.util.TreeSet;
public class Recycled {
private File file = new File("D:\\Sources\\GoogleCodeJam\\files\\C-small-attempt0.in");
private File outFile = new File("D:\\Sources\\G... |
A20261 | A21787 | 0 | package com.gcj.parser;
public class MaxPoints {
public static int normal(int value){
int toReturn = 0;
switch (value) {
case 0 : toReturn = 0 ; break;
case 1 : toReturn = 1 ; break;
case 2 : toReturn = 1 ; break;
case 3 : toReturn = 1 ; break;
case 4 : toReturn = 2 ; break;
case 5 : toReturn = 2 ; b... | package dancers;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.Arrays;
public class DancerEvaluation {
private final int numberOfGooglers;
private int surpriseCount;
private final int bestSc... |
B10245 | B10490 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
public class RecycledNumbers {
static HashSet<String> set = new HashSet<String>();
public static void main(String[] args) throws IOException{
... |
A22078 | A21158 | 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 com.google.codejam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
public class Utils {
static final Strin... |
A22992 | A20840 | 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... | /**
* Created by IntelliJ IDEA.
* User: Manish
* Date: 4/14/12
* Time: 9:30 PM
* To change this template use File | Settings | File Templates.
*/
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
public class CodeJamProblemB {
public static void main(String args[]) throws Exception {
... |
B11361 | B11953 | 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... | package cs224n.gcj;
import java.io.IOException;
import java.util.HashSet;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.FileInputStream;
import java.io.PrintWriter;
import java.io.FileWriter;
import java.io.File;
public class ProbC {
static int getNRecycledPair(int b, int B){
... |
B21752 | B20197 | 0 | package Main;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
/**
* Created with IntelliJ IDEA.
* User: arran
* Date: 14/04/12
* Time: 3:12 PM
* To change ... |
import java.util.HashSet;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Formatter;
import java.util.Scanner;
import static java.lang.Math.*;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author milen.chechev
*/
public clas... |
B21790 | B20870 | 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.HashMap;
import java.util.Scanner;
public class RecycledNumbers {
/**
* @param args
*/
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
//number of case tests
int n;
int a, b;
n = s.nextInt();
s.nextLine();
for(int t=1; t<= n; t++){
a = s.nex... |
B21207 | B22061 | 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) ... | public class A {
public static void main(String[] a) {
//System.out.println(a(1,9));
//System.out.println(a(10,40));
//System.out.println(a(100,500));
//System.out.println(a(1111,2222));
java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(Syste... |
B21968 | B21744 | 0 | import java.util.*;
import java.io.*;
public class recycled_numbers {
public static void main(String[]a) throws Exception{
Scanner f = new Scanner(new File(a[0]));
int result=0;
int A,B;
String n,m;
HashSet<String> s=new HashSet<String>();
int T=f.nextInt(); //T total case count
for (int t=1; t<=T... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package RecycledNumbers;
import java.io.*;
import java.util.ArrayList;
/**
*
* @author Himeshi
*/
public class RecycledNumbers {
public static void main(String[] args) {
int A, B, N, pairs;
Str... |
B20023 | B21170 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package uk.co.epii.codejam.recyclednumbers;
import java.util.TreeSet;
import uk.co.epii.codejam.common.AbstractProcessor;
/**
*
* @author jim
*/
public class RecycledNumbersProcessor extends AbstractProcessor {
... |
B12570 | B12322 | 0 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class RecycledNumbers{
int getcount(int small,int large){
int count = 0;
for(int currnum = small; currnum < large; currnum++){
int permut = currnum;
int no_of_digits = 0;
while(permut > 0){
permut... | import java.io.*;
import java.util.*;
public class rfin {
public static void main(String args[]){
try{
FileInputStream fstream = new FileInputStream("C-small-attempt2.in");
// Get the object of DataInputStream
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new I... |
B21752 | B20767 | 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.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
public class PC {
private static int[] div = {10, 100, 1000, 10000, 100000, 1000000, 10000000};
public static void main(String[] args) throws FileNotFoundException {
if (args.length != 1)... |
A20382 | A21552 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... | /**
*
*/
package com.sakthi.demo;
import java.io.File;
import java.util.Scanner;
/**
* @author Balaji
*
*/
public class GooglersDance {
/**
* @param args
*/
public static void main(String[] args) throws Exception{
// TODO Auto-generated method stub
// System.out.println("check");
Scanner in = new Sc... |
A21396 | A20031 | 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;
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... |
A11917 | A10368 | 0 | package com.silverduner.codejam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashMap;
public class Dancing {
public static void main(String[] args) throws Exception {
File input = new File("B-small-attempt... | package jam2012;
import java.io.*;
import java.util.*;
// Marian G Olteanu
public class QB
{
public static void main(String[] args)
throws Exception
{
BufferedReader inputFile = new BufferedReader(new InputStreamReader(new FileInputStream(args[0])));
int cases = Integer.parseInt(inputFile.readLine());
Prin... |
B12669 | B12297 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package year_2012.qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Recycling (Numbers)
* Jason Bradley Nel
* 16287398
*/
import java.util.*;
public class Recycling {
public static void main(String[] args) {
In input = new In("input.txt");
in... |
B10155 | B12266 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
/**
*
* @author eblanco
*/
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
impo... | import java.io.*;
public class RecycledNumbers {
public RecycledNumbers() {}
public Integer count(String num, int A, int B) {
int count = 0;
Integer numS = new Integer(num);
for (int i = 1; i < num.length(); i++) {
Integer newNum = new Integer(num.substring(i) + num.substring(0, i));
if (newNum <... |
A11201 | A11715 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
import java.io.*;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author user
*/
public class CodeJam {
/**
* @param args the command line arguments
*/
p... |
A22378 | A21314 | 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.io.IOException;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Scanner;
public class B {
private static final String INPUTFILE = "./B-large.in";
private static f... |
B10485 | B12873 | 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 br.com.luan;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
public class C {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
... |
A21396 | A22836 | 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.Arrays;
public class Main{
public static void main(String[] args) throws Exception {
int t = Integer.parseInt(finB.readLine());
int test = 1;
while(test <= t){
int n = fnextInt();
int s = fnextInt();
int p = fnextInt();
int[] a = new int[n];
for(int i = 0; i <... |
B10361 | B11935 | 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.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class testC {
public static void main(String args[]){
int count=0;
int A=1111;
int B=2222;
String str="";
Stri... |
A22360 | A21233 | 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 codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.PrintWriter;
public class CodeJamRunner {
private PrintWriter pw = null;
/**
* Override this to do the real stuff.
* @param inputLine
*/
protected void process( int lineNr, String inputLine )
{
... |
B10149 | B11223 | 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 =... |
public class Methode {
public boolean text(String n,String m)
{
n=n.trim();
m=m.trim();
boolean bool=false;
for(int j=1;j<n.length();j++)
{
String str=n.substring(j, n.length())+n.substring(0, j);
if(m.equals(str))
{
bool=true;
break;
}
}
return bool;
}
}
|
A20934 | A21865 | 0 | import java.util.*;
public class B {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
B th = new B();
for (int i = 0; i < T; i++) {
int n = sc.nextInt();
int s = sc.nextInt();
int p = sc.nextInt()... | package myPackage;
import java.io.File;
import java.io.FileWriter;
import java.util.Arrays;
import java.util.Scanner;
import java.util.TreeSet;
import java.util.TreeMap;
import java.util.*;
import java.math.*;
public class GooglersDance {
/**
* @param args
*/
public static void main(String[] args) {
// TODO A... |
B10245 | B11371 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | import java.util.Scanner;
public class C {
int A = 0;
int B = 0;
int cnt = 0;
public int getDig(int x){
int temp = x;
int dig = 0;
while(temp>0){
dig++;
temp/=10;
}
return dig;
}
public int flip(int x, int time){
int temp = x;
int base = 1;
for(int i = 1; i<=time;i++) base*=10... |
A20490 | A21632 | 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 codejam;
import java.io.*;
import java.util.Arrays;
/**
* @author Dmitry Korolev
*/
public class Task2 {
public static void main(String[] args) throws IOException {
Reader inputReader = /*new InputStreamReader(System.in);*/ new FileReader("B-large.in");
Writer outputWriter = /*new Outpu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.