F1 stringlengths 6 6 | F2 stringlengths 6 6 | label stringclasses 2
values | text_1 stringlengths 149 20.2k | text_2 stringlengths 48 42.7k |
|---|---|---|---|---|
B12669 | B12899 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package year_2012.qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.... | package com.bchetty.gcj2012;
import java.io.*;
import java.util.ArrayList;
import java.util.HashSet;
/**
*
* @author Babji Prashanth, Chetty
*/
public class RecycledNumbers {
public static void main(String[] args) {
RecycledNumbers recycledNums = new RecycledNumbers();
LineNumberReader lineNumb... |
A11135 | A12003 | 0 | /**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/3/12
* Time: 11:00 AM
* To change this template use File | Settings | File Templates.
*/
import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;
import java.io.*;
import java.util.*;
import java.uti... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.*;
public class Main
{
public static void main(String[] args)
throws Exception
{
BufferedReader in = new BufferedReader(new FileReader(args[0]));
FileWriter out = new FileWriter(arg... |
A22992 | A20881 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author dannocz
*/
public class InputReader {
public static Input r... | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
public class Main {
public static void main(String args[]) throws NumberFormatException, IOException {
BufferedReader in = new Buff... |
A21396 | A21634 | 0 | import java.util.*;
public class Test {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int i = 1; i<=T; i++) {
int n = in.nextInt();
int s = in.nextInt();
int p = in.nextInt();
int result = 0;
for(int j = 0; j<n; j++){
... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.*;
/*
* Problem A. Speaking in Tongues
*/
public class B {
static BufferedReader _in = new BufferedReader(new InputStreamReader(System.in));
static String _string;
static Stri... |
A22191 | A20750 | 0 | package com.example;
import java.io.IOException;
import java.util.List;
public class ProblemB {
enum Result {
INSUFFICIENT,
SUFFICIENT,
SUFFICIENT_WHEN_SURPRISING
}
public static void main(String[] a) throws IOException {
List<String> lines = FileUtil.getLines("/B-large.in");
int cases = Int... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class Dance {
private static final String inFile = "B-large.in";
private static... |
A10699 | A11379 | 0 | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class Dancing {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) ... | import java.io.*;
public class mains {
public static void main(String[] args) {
BufferedReader input;
BufferedWriter output;
try {
input = new BufferedReader(new FileReader("B-small-attempt2.in"));
output = new BufferedWriter(new FileWriter("output.out"));
int caseCount = Integer.parseInt(input.... |
A10996 | A11326 | 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 codejam2012.r0;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.StringTokenizer;
/**
* @author julian
*/
public class B {
public static final void main(String[] args) throws IOException {
(ne... |
A10568 | A10896 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam.y12.round0;
import utils.Jam;
import utils.JamCase;
/**
*
* @author fabien
*/
public class DancingGooglers extends Jam {
public DancingGooglers(String filename) {
super(filename);
}
@Over... |
A20261 | A21694 | 0 | package com.gcj.parser;
public class MaxPoints {
public static int normal(int value){
int toReturn = 0;
switch (value) {
case 0 : toReturn = 0 ; break;
case 1 : toReturn = 1 ; break;
case 2 : toReturn = 1 ; break;
case 3 : toReturn = 1 ; break;
case 4 : toReturn = 2 ; break;
case 5 : toReturn = 2 ; b... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class Dancing {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStrea... |
A12846 | A11351 | 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.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class Dancing {
public static void main(String[] args) throws IOException
{
File file = new File("B-small-attempt0.in");
Scanner s... |
B12115 | B11238 | 0 | package qual;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) {
new RecycledNumbers().run();
}
private void run() {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int A = sc.nextInt();
int B = sc.nextInt();
... | import java.util.Scanner;
import java.io.File;
public class RecycledNumbers {
public static void main(String[] args) {
Scanner input = null;
boolean[][] counted;
try {
input = new Scanner(new File(args[0]));
} catch (Exception e) {
System.out.println("Please pass a correct filename as... |
A22771 | A20609 | 0 | package com.menzus.gcj._2012.qualification.b;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class BProcessorFactory extends AbstractProcessorFactory<BInput, BOutputEntry> {
public BProcessorFactory(Str... | import java.awt.Container;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
import javax.swing.JFrame;
import javax.swing.JTextArea;
public class Dancing extends JFrame
{
private final int WIDTH = 800;
private final int HEIGHT = 400;
... |
A20382 | A21634 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.*;
/*
* Problem A. Speaking in Tongues
*/
public class B {
static BufferedReader _in = new BufferedReader(new InputStreamReader(System.in));
static String _string;
static Stri... |
B20566 | B20953 | 0 | import java.util.Scanner;
import java.io.*;
import java.lang.Math;
public class C{
public static int recycle(String str){
String[] numbers = str.split(" ");
int min = Integer.parseInt(numbers[0]);
int max = Integer.parseInt(numbers[1]);
int ret = 0;
for(int i = min; i < max; i++){
String num = i + "";
... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package qualc;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
/**
*
* @author marcin
*/
public class QualC {
/**
* @param args the command line arguments
*/
public stati... |
A12570 | A12199 | 0 | package util.graph;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Set;
public class DynDjikstra {
public static State FindShortest(Node start, Node target) {
PriorityQueue<Node> openSet = new PriorityQueue<>();
Set<Node> closedSet = new HashSet<>();
openSet.add... | package round1;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;
public class Dancing {
private int noCases;
private ArrayList<Case> cases = new ArrayList<Case>();
private void readFile(String filepath) {
try {
S... |
B11696 | B11431 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recycled;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util... | import java.io.*;
import java.util.*;
class p3
{
public static void main(String s[])
{
int startingnum;
int endingnum;
int totalcases;
int pairs;
try{
File f = new File("C-small-attempt0.in");
File o = new File("Output.out");
String strLine=null;
int first=1;
BufferedReader br = new Buffere... |
B20734 | B21572 | 0 | package fixjava;
public class StringUtils {
/** Repeat the given string the requested number of times. */
public static String repeat(String str, int numTimes) {
StringBuilder buf = new StringBuilder(Math.max(0, str.length() * numTimes));
for (int i = 0; i < numTimes; i++)
buf.append(str);
return buf.toStr... | import java.util.*;
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... |
A11135 | A11894 | 0 | /**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/3/12
* Time: 11:00 AM
* To change this template use File | Settings | File Templates.
*/
import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;
import java.io.*;
import java.util.*;
import java.uti... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
public class testC {
public static void main(String args[]){
int arrayInt[];
String str="";
int numbersOfGooglers=0;
int S=0;
int P=0;
int index=0;
int count=0;
... |
B21270 | B20591 | 0 | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
public class CopyOfCopyOfMain {
static int ndigits(int n) {
return (int) (Math.log10(n) + 1);
}
static i... | package be.mokarea.gcj.common;
public abstract class TestCase {
private final int caseNumber;
protected TestCase(int caseNumber) {
this.caseNumber = caseNumber;
}
public int getCaseNumber() {
return caseNumber;
}
}
|
B20291 | B20225 | 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[]... | package bsevero.codejam.qualification;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
public class IOUtils {
public static L... |
A12846 | A10348 | 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.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;
public class prob2sol {
public static void main(String[] args) {
BufferedReader in;
String li... |
A20119 | A22130 | 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.File;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class B {
public static void main(String args[]) throws Exception {
final String PATH = "/home/goalboy/software installation/codejam-commandline-1.0-beta4/source/";
final String FILE = "B-la... |
A20490 | A21552 | 0 | /**
*
*/
package hu.herba.codejam;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io... | /**
*
*/
package com.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 | A22659 | 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.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
HashMap<Integer,Integer> nonsurprising=new HashMap<Integer, Integer>();
HashMap<Integer,Integer> surprising=new Ha... |
A10996 | A12433 | 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 codejam.dancingwiththegooglers;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;
import codejam.common.AbstractProblemSolver;
public class DancingScoresProblemSolver extends
AbstractProblemSolver<DancingScores, Integer> {
@Override
public Dan... |
A11201 | A12758 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | import java.io.*;
import java.util.*;
public class B {
final static boolean DEBUG = true;
public Object solve () throws IOException {
int N = sc.nextInt();
int S = sc.nextInt();
int P = sc.nextInt();
int [] T = new int [N];
for (int i = 0; i < N; ++i)
T[i] = sc.nextInt();
if (P == 0)
retur... |
A13029 | A12447 | 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.FileReader;
import java.io.IOException;
import java.util.Arrays;
public class Bsmall {
private static int[] triplet(int total, boolean special) {
int[] scores = {0, 0, 0};
for (int i = 10; i != -1; --i) {
for (in... |
B20291 | B20745 | 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[]... | package fixjava;
/**
* Convenience class for declaring a method inside a method, so as to avoid code duplication without having to declare a new method
* in the class. This also keeps functions closer to where they are applied. It's butt-ugly but it's about the best you can do in
* Java.
*/
public interface Lambd... |
A21010 | A20252 | 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 files;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
public class Googler3 {
public static void main(String[] args) {
try
{
//BufferedReader br = new BufferedReader(new FileReader("/Users/Sush/Documents/works... |
A11917 | A11308 | 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 google_code_jam;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Scanner;
public class Dancing {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
Scanner scanner = new Scanner(new FileInputStream("data/dancers.txt"))... |
B12085 | B12741 | 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.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;
public class CodeJamC
{
public static void main(String args[]) throws Exception
{
Scanner in = new Scanner(new File("in.txt"));
BufferedWriter out = new B... |
B11327 | B12274 | 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 year2012.qualification.c;
import java.io.File;
import java.io.PrintWriter;
import java.util.Scanner;
public class RecycledNumbers {
public static void main(String[] args) throws Exception{
//GCJå
±é
String filename = "src/year2012/qualification/c/C-small-attempt0";
PrintWriter out = new PrintWriter(n... |
A20934 | A20570 | 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 ProblemSolvers;
import CaseSolvers.WiresCase;
public class Wires extends ProblemSolver {
public Wires(String filePath) {
super(filePath);
}
@Override
public void process() {
cases = io.readInt();
for (int i = 1; i <= cases; i++) {
new WiresCase(i, io.readInt(), io).process().printSolution();
... |
B10245 | B10200 | 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.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Q3 {
public static void main (String[] args)
{
Scanner s = new Scanner(System.in);
int numTests = s.nextInt();
for (int test = 0; test < numTests; test++)
{
int a = s.nextInt();
int b = s.nextInt();
int count = ... |
A20382 | A22659 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... | import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
HashMap<Integer,Integer> nonsurprising=new HashMap<Integer, Integer>();
HashMap<Integer,Integer> surprising=new Ha... |
B11327 | B10129 | 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 codejam;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class RecycledNumbers {
/**
* @param args
*/
public boolean isRecycled(char[] f, char[] s) {
// f... |
A20119 | A22966 | 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,... | /*
PROG: ProbB
2012 Google CodeJam Qualification Round
Problem B
*/
import java.io.*;
import java.util.*;
public class Prob1B{
public static void main(String [] args) throws IOException {
//long start = System.currentTimeMillis();
BufferedReader f = new BufferedReader(new FileReader("Prob1B.in"));
PrintWriter... |
A11502 | A11230 | 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 codejam2012;
import java.io.File;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class DancingWithTheGooglers {
public static int testGoal(int value, int goal) {
int modResult = value % 3;
int divResult = value / 3;
/*
* x%3=0:(NS)x/3,(S)x/3+1;x%3=1:(NS)x/3+1,... |
A22642 | A22661 | 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 year2012;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class q2 {
public static void main(String[] args) throws Exception {
q2 a = new q2();
a.go();
}
int solve(int N... |
B20566 | B20271 | 0 | import java.util.Scanner;
import java.io.*;
import java.lang.Math;
public class C{
public static int recycle(String str){
String[] numbers = str.split(" ");
int min = Integer.parseInt(numbers[0]);
int max = Integer.parseInt(numbers[1]);
int ret = 0;
for(int i = min; i < max; i++){
String num = i + "";
... | package com.codejam.practice;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;
public class RecycledNumbers {
public static void main(String[] args... |
A22642 | A22143 | 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... |
public class Dancing
{
public static void main(String[] args)
{
int T = StdIn.readInt();
for (int tr = 1; tr <= T; tr++)
{
int N = StdIn.readInt();
int S = StdIn.readInt();
int p = StdIn.readInt();
int numP = 0;
int numS = 0;
for (int i = 0; i < N; i++)
{
int tripSum = StdIn.readInt... |
B11318 | B12272 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author binny
*/
import java.io.*;
import java.util.ArrayList;
public class RecycledNumber {
public static void main(String args[]) throws Exception {
String inputPath = "//C-small-attempt0.in... |
B21049 | B21474 | 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.io.Writer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
public class RecycledNumbers {
public static ... |
A11135 | A11420 | 0 | /**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/3/12
* Time: 11:00 AM
* To change this template use File | Settings | File Templates.
*/
import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;
import java.io.*;
import java.util.*;
import java.uti... | import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Scanner;
public class Triplets {
public static void main(String[] args) throws IOException {
new Triplets().run("B-small-attempt0.in");
// new Triplets().run("problem.txt");
}
public void run(String fileName... |
A10793 | A10101 | 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.util.*;
public class Main
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
Integer numCases = Integer.parseInt(in.nextLine());
for (int i = 0; i < numCases; i++)
{
int num = in.nextInt();
int[] dancers = new int[num];
int surp = in.nextIn... |
A11502 | A11436 | 0 | package template;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
public class TestCase {
private boolean isSolved;
private Object solution;
private Map<String, Integer> intProperties;
private Map<String, ArrayList<Integer>> intArrayProperties;
private Map<String, Arra... | import java.io.*;
import java.util.Scanner;
public class dance {
private static int T,S,p,N,current,upper,lower, count;
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
PrintWriter out = new PrintWriter(new FileWriter("B-small-attempt0.out"));
T = sc.nextI... |
B12085 | B13127 | 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... | package com.nbarraille.gcj;
import java.io.IOException;
public class GCJ extends GCJHelper {
protected static final String TEST_CASE = "C-small"; // CHANGE THIS WHEN CHANGING PROBLEM
protected static final boolean RUN_ALL_CASES = true;
protected static final boolean DEBUG = true;
// DO WHATEVER TO SOLVE THE CAS... |
B10245 | B12940 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package recyclednumbers;
import java.util.HashSet;
/**
*
* @author vandit
*/
public class RecycleNumbers {
private HashSet<String> numbers = new HashSet<String>();
private HashSet<String> initialTempNumbers... | package com.menzus.gcj._2012.qualification.c;
import com.menzus.gcj.common.Input;
public class CInput implements Input {
private int upperLimit;
private int lowerLimit;
public int getUpperLimit() {
return upperLimit;
}
public void setUpperLimit(int upperLimit) {
this.upperLimit = upperLimit;
... |
B12941 | B11412 | 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.IOException;
import java.io.InputStreamReader;
public class RecycledNumbers {
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int cases = Integer.parseInt... |
A22992 | A21162 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package IO;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
/**
*
* @author dannocz
*/
public class InputReader {
public static Input r... | import java.util.Scanner;
public class Dancing {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int caseCount = sc.nextInt();
for (int i = 1; i <= caseCount; i++) {
int N = sc.nextInt();
int numSuprise = sc.nextInt();
int p = sc.nextInt();
int bestN = 0;
for (int j... |
A11201 | A10132 | 0 | package CodeJam.c2012.clasificacion;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/**
* Problem
*
* You're watching a show where Googlers (employees of Google) dance, and then
* each dancer is given a triplet of scores by three judges.... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class main3 {
/**
* @param args
* @throws IOException
* @throws NumberFormatException
*/
public static void main(String[] args) throws NumberFormatException, IOException {
Buf... |
B11318 | B12136 | 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.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class recycle {
public static void main(String[] args) {
recycle rec = new recycle();
rec.readFile("test.txt");
}
publ... |
B10231 | B11080 | 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 fixjava;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class IOUtils {
public static void writeLinesToFile(List<String> lineList, File outputFile) {
try {
PrintWriter writer = new PrintWriter(outputFile);... |
A11135 | A12363 | 0 | /**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 3/3/12
* Time: 11:00 AM
* To change this template use File | Settings | File Templates.
*/
import SRMLib.MathLibrary;
import SRMLib.TestSRMLib;
import com.sun.org.apache.bcel.internal.generic.F2D;
import java.io.*;
import java.util.*;
import java.uti... | import java.util.*;
public class DancingWithTheGooglers
{
static Scanner sc = new Scanner(System.in);
public static void main(String[] args)
{
int T = sc.nextInt();
for(int i=1;i<=T;i++)
{
System.out.println("Case #"+i+": "+solveCase());
}
}
static String solveCase()
{
int N = sc.nextInt(); int S = ... |
B21049 | B22264 | 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.*;
import java.io.*;
public class C {
int numLen(int n) {
int ans = 0;
while(n>0) {
ans++;
n/=10;
}
return ans;
}
int shift(int n, int pow) {
int tmp = n%10;
return n/10 + tmp*pow;
}
public C(Scanner in, PrintWriter out) {
int T = in.nextInt();
in.nextLine();
for (int t=0; ... |
A20119 | A20859 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | package utils;
/**
*
* @author Fabien Renaud
*/
public abstract class Jam implements Runnable, JamParser {
protected final String[] lines;
protected final JamCase[] cases;
protected final int t;
private final String filenameInput;
private final String filenameOutput;
private final String[] output;
pr... |
A10996 | A11806 | 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 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)
{
... |
A20934 | A21892 | 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.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... |
B12085 | B10505 | 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.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Writer;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Recyc... |
B10245 | B12439 | 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.FileWriter;
import java.io.PrintWriter;
import java.util.Scanner;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Eunice
*/
public class Recycled_Numbers {
static Scanner scanner = new Scanner(System.in);
static PrintWrite... |
A21557 | A22813 | 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.*;
import java.util.*;
public class b {
public static void main(String[] args) {
Scanner fin = new Scanner(System.in);
int numCases = fin.nextInt();
for (int loop=1; loop<=numCases; loop++) {
int numPeople = fin.nextInt();
int numSurprise = fin.nextInt();
int threshold = fin.nextInt... |
A20119 | A20133 | 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 ProblemB {
public static void main(String[]args) {
Scanner f = new Scanner(System.in);
int T = f.nextInt();
for(int set=0;set<T;set++) {
int N = f.nextInt(), S = f.nextInt(), p = f.nextInt();
int[] t = new int[N];
int result = 0;
for(int c... |
A20382 | A21315 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... | import java.io.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;
import java.util.Scanner;
public class B {
/**
* @param args
* @throws IOException
*/
public static void main(Str... |
A12273 | A13068 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* Dancing
* Jason Bradley Nel
* 16287398
*/
import java.io.*;
public class Dancing {
public static void main(String[] args) {
In input = new In("input.txt");
int T = Integer.parseInt(input.... | import java.io.BufferedWriter;
import java.io.FileWriter;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Scanner;
public class GCJ3 {
/**
* @param args
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] hold = new int[n];
f... |
A10793 | A11288 | 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) {
... | public class Surprising {
public static void main(String[] args) {
int T = StdIn.readInt();
for (int i = 1; i <= T; i++) {
int N = StdIn.readInt();
int S = StdIn.readInt();
int P = StdIn.readInt();
int count = 0;
int sCount = 0;
... |
A21010 | A22008 | 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.List;
public class ProblemSample implements Problem {
private Integer solution;
private List<Integer> scores;
private int S;
private int p;
@Override
public void solve() {
solution = 0;
int equit = 3 * p;
for (Integer score : scores) {
if (score >= p) {
int diff = equit - score... |
A22771 | A22233 | 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 com.bd.codejam.y2012;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
class B {
public void solve() throws IOException {
Scanner in = new Scanner(new File(getClass().getSimpleName() + ".in.txt"));
PrintWriter out = new PrintWriter(new File(getClass()... |
B11318 | B10823 | 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.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.StringTokenizer;
public class jamc {
public static boolean b=false;
public static Scanner in;
public static PrintWriter out;
static boolean recycle(int i,int j)
{
String n=""+i+"";
... |
B21270 | B21185 | 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.*;
import java.awt.*;
import static java.lang.System.*;
public class C {
public static void main (String [] args) throws IOException {new C().run();}
public void run() throws IOException{
Scanner file = new Scanner(new File("C-large.in"));
PrintWriter out = new PrintWriter(new ... |
B20856 | B22031 | 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 static java.lang.Math.*;
import static java.util.Arrays.*;
import java.io.*;
import java.util.*;
public class C {
Scanner sc = new Scanner(System.in);
int A, B;
void read() {
A = sc.nextInt();
B = sc.nextInt();
}
void solve() {
long res = 0;
for (int i = A; i <= B; i++) {
int t = i;
int... |
B10485 | B11995 | 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 test.com;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Stack;
public class QualC {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
FileInputStream fos = new FileInputStream("c... |
B12085 | B12664 | 0 | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author daniele
*/
public class GCJ_C {
public static void main(String[] args) thro... | import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class C {
public static void main(String[] args) throws Exception{
new C().solve(args[0]);
}
private void solve(String file) throws Exception {
Scanner s = new Scanner(new File(file));
int x=s.nextInt()... |
A21557 | A20403 | 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) ... | package qualification.taskC;
import Parser.MyReader;
import Parser.MyWriter;
public class Main {
private final static int n = 20000001;
public static void main(String[] args) {
MyReader myReader = new MyReader(
"/Users/shami13/Downloads/C-small-attempt0.in");
MyWriter myWriter = new MyWriter(
"/Users/s... |
B12085 | B11906 | 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.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
public class Utils {
public static ArrayList<String> readFile(String filename){
//replace local file with remote file from peerInfo address
ArrayList<String> ret= new ArrayList<String... |
A21396 | A22917 | 0 | import java.util.*;
public class Test {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for(int i = 1; i<=T; i++) {
int n = in.nextInt();
int s = in.nextInt();
int p = in.nextInt();
int result = 0;
for(int j = 0; j<n; j++){
... |
import java.io.*;
import java.util.*;
public class Dancing {
public enum Category {containsHighNotSupprising, containsHighOnlyIfSupprising, doesNotContainHigh};
public class Score {
public Score(int p, int score) {
this.score = score;
this.category = getCategoryFo... |
A22642 | A22540 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam.prparation;
import java.io.*;
import java.util.*;
/**
*
* @author HP
*/
public class DancingWithGooglers{
/**
* @param args the command line arguments
*/
static int getLargest... |
B12941 | B12175 | 0 | package com.menzus.gcj._2012.qualification.c;
import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;
public class CProcessorFactory extends AbstractProcessorFactory<CInput, COutputEntry> {
public CProcessorFactory(Str... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package codejam;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
/**
*
* @author Aymen
*/
public class main {
... |
A10793 | A11722 | 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.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
public class CodeJamTextInputReader {
private final BufferedReader reader;
private final int numberOfTestCases;
private int lastReadTestCase = 0;
public CodeJamTextInputReader(File inputFile) throws IOExce... |
B11318 | B12417 | 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.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Scanner;
public class abc {
public static void main(String args[])
{
int x ,y,j,k,ans=0;
int tcount =0;
try{
// Create file
FileWr... |
A20382 | A22917 | 0 | package dancinggooglers;
import java.io.File;
import java.util.Scanner;
public class DanceScoreCalculator {
public static void main(String[] args) {
if(args.length <= 0 || args[0] == null) {
System.out.println("You must enter a file to read");
System.out.println("Usage: blah <fil... |
import java.io.*;
import java.util.*;
public class Dancing {
public enum Category {containsHighNotSupprising, containsHighOnlyIfSupprising, doesNotContainHigh};
public class Score {
public Score(int p, int score) {
this.score = score;
this.category = getCategoryFo... |
B20424 | B22257 | 0 | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
// static int MAX = 10000;
static int MAX = 2000000;
static Object[] All = new Object[MAX+1];
static int size( int x ) {
if(x>999999) return 7;
if(x>99999) return 6;
if(x>9999) return 5;
if(x>999) retu... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.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... |
B11421 | B10391 | 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... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gcj2012.qualification_round;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Scanne... |
B10899 | B12986 | 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 static java.lang.System.*;
import java.util.*;
import java.io.*;
public class jellyfish {
public static void one()throws IOException{
TreeMap<String,String>t=new TreeMap<String,String>();
Scanner keyb=new Scanner(new File("A-small-attempt2.in"));
t.put("a","y");
t.put("o","e");
t.put("z","q");
t.put... |
A12211 | A10774 | 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.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... |
B10231 | B11066 | 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 fixjava;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import fixjava.ParallelWorkQueue.CallableFactory;
public class ArrayStats {
public final double[][] data;
public final int n, k;
private double[][] centered;
private double[] mean;
private double[][] cov;
private double... |
B21270 | B20841 | 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.File;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
public class RecycledNumbersLar... |
A22642 | A21878 | 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.util.*;
import java.io.*;
import java.lang.*;
public class RQQ2 {
public static void main(String[] args)
{
try
{
HashMap<Character,Character> map = new HashMap<Character,Character>();
Scanner s = new Scanner(new File("B-large.in"));
FileWriter o = new FileWriter(new File("out.txt"));
... |
B21227 | B21468 | 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.renoux.gael.codejam.fwk;
import java.io.File;
import com.renoux.gael.codejam.utils.FluxUtils;
import com.renoux.gael.codejam.utils.Input;
import com.renoux.gael.codejam.utils.Output;
import com.renoux.gael.codejam.utils.Timer;
public abstract class Solver {
public void run() {
Timer.start();
if (!d... |
B10155 | B10170 | 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.*;
import java.util.*;
public class RecycledNumbers {
public static void main(String[] args) {
Scanner sc = null;
PrintWriter fout = null;
int t = 0;
try {
sc = new Scanner(new File(args[0]));
fout = new PrintWriter(new BufferedWriter(new FileWriter("result.txt")));
t = sc.nextInt()... |
A20119 | A21973 | 0 | package code12.qualification;
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class B {
public static String solve(int N, int S, int p, int[] t) {
// 3a -> (a, a, a), *(a - 1, a, a + 1)
// 3a + 1 -> (a, a, a + 1), *(a - 1, a + 1, a + 1)
// 3a + 2 -> (a, a + 1, a + 1), *(a,... | package com.renoux.gael.codejam.utils;
/**
* Pour tests unitaires
*
* @author renouxg
*/
public final class ArrayUtils {
public static int[] parseInts(String[] strings) {
int[] res = new int[strings.length];
int i = 0;
for (String s : strings) {
res[i++] = Integer.parse... |
B21752 | B20423 | 0 | package Main;
import com.sun.deploy.util.ArrayUtil;
import org.apache.commons.lang3.ArrayUtils;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
/**
* Created with IntelliJ IDEA.
* User: arran
* Date: 14/04/12
* Time: 3:12 PM
* To change ... | package codejam2012.qualification.c;
import java.io.PrintStream;
import java.util.HashSet;
import java.util.Scanner;
import com.google.common.base.Charsets;
import com.google.common.io.Resources;
public final class GoC {
public static void main(String[] args) throws Exception {
String name = args[0];
... |
A13029 | A12686 | 0 | import java.util.List;
public class Case implements Runnable {
private int id;
private String output;
private int n;
private int s;
private int p;
private List<Integer> g;
public Case(int id) {
this.id = id;
}
public Case(int id, int n, int s, int p, List<Integer> g) {
super();
this.id = id;
this... | package ab.gcj;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Surprising {
public static void main(String args[])
{
Surprising s = new Surprising();
}
public Surprising()
{
try{
BufferedReader reader = new BufferedReader(new InputStrea... |
A11277 | A13087 | 0 | package googlers;
import java.util.Scanner;
import java.util.PriorityQueue;
import java.util.Comparator;
public class Googlers {
public static void main(String[] args) {
int n,s,p,count=0,t;
Scanner sin=new Scanner(System.in);
t=Integer.parseInt(sin.nextLine());
int result[]=new int[t];
int ... | import java.io.*;
import java.util.*;
class Triplet
{
public static void main (String [] args) throws IOException
{
BufferedReader in = new BufferedReader(new FileReader("B-small-attempt0.in"));
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("B-small-attempt0.out")));
StringTokenizer s... |
A10996 | A13012 | 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.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
public c... |
B12115 | B12852 | 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
public class Main {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new File... |
B13196 | B12714 | 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 ejera;
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException{
String Lista1="abcdefghijklmnopqrstuvwxyz";
String Lista2="yhesocvxduiglbkrztnwjpfmaq";
char[] SourceList=Lista1.toCharArray();
Arrays.sort(SourceLis... |
B10149 | B11979 | 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 recycledNumbers;
import java.util.ArrayList;
public class MainClass
{
public static void main(String[] z)throws Exception
{
String string ="";
ArrayList<String> list = new InputFile().readFile();
int caseNumber =1;
ArrayList<String> output = new ArrayList<String>();
for(int i=0 ;i<list.size();i... |
A11917 | A12645 | 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 util.Runner;
public class DancingWithTheGooglers extends Runner{
@Override
public String dealWithCase(String line) {
String[] splits = line.split(" ", -1);
int noOfDancers = Integer.parseInt(splits[0]);
int noOfSurprises = Integer.parseInt(splits[1]);
int minimumScore = Integer.parseInt(splits[2]);
... |
A10568 | A12455 | 0 | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class DancingWithTheGooglers {
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader (new... | import java.io.*;
import java.util.*;
/**
* @author OleGG
*/
public class QualTaskB {
public static void main(String[] args) throws Throwable {
//StreamTokenizer st = new StreamTokenizer(new BufferedReader(new FileReader("B-small-attempt0.in.txt")));
PrintWriter pw = new PrintWriter(new FileWrite... |
B12074 | B11481 | 0 | package jp.funnything.competition.util;
import java.math.BigInteger;
/**
* Utility for BigInteger
*/
public class BI {
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger add( final BigInteger x , final BigInteger y ) {
return... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
public class ProblemaC {
private final static String RUTA="C:/Users/Rafael/Docume... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.