This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package code; | |
import java.util.*; | |
public class problem1 { | |
static int max = 10000000; | |
static Queue queue = new Queue(max); | |
static int count; | |
static Scanner sc = new Scanner(System.in); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package code; | |
import java.util.Arrays; | |
import java.util.Scanner; | |
public class problemA { | |
public static void main(String[] args) { | |
String[] result = {"X won","O won","Draw","Game has not completed"}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package code; | |
import java.io.BufferedReader; | |
import java.io.BufferedWriter; | |
import java.io.FileReader; | |
import java.io.FileWriter; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
public class problemB { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package code; | |
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.Arrays; | |
import java.util.Scanner; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
import java.util.Arrays; | |
import java.io.*; | |
///Users/lxze/Desktop/ | |
public class codejam1{ | |
public static void main(String[] args) throws IOException { | |
Scanner sc = new Scanner(new FileReader("A-small-attempt1.in")); | |
BufferedWriter write = new BufferedWriter(new FileWriter("output.txt")); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.io.*; | |
import java.text.*; | |
public class codejam2{ | |
public static void main(String[] args) throws IOException{ | |
Scanner sc = new Scanner(new FileReader("B-large.in")); | |
BufferedWriter write = new BufferedWriter(new FileWriter("output.txt")); | |
int caseN = sc.nextInt(); | |
sc.nextLine(); | |
String[] allCase = new String[caseN]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.io.*; | |
public class codejam4{ | |
public static void main(String[] args) throws IOException{ | |
Scanner sc = new Scanner(new FileReader("D-large.in")); | |
BufferedWriter write = new BufferedWriter(new FileWriter("output.txt")); | |
int caseN = sc.nextInt(); | |
sc.nextLine(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
f = open("A-large.in","r") | |
w = open("output_aLarge.txt","w") | |
num = f.readline() | |
for i in range(0,int(num)): | |
res = 0 | |
smax,aud = [str(l) for l in f.readline().split()] | |
clap = int(aud[0]) | |
for j,nSi in enumerate([int(x) for x in aud]): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from fractions import gcd | |
def lcm(numbers): | |
return reduce(lambda x, y: (x*y)/gcd(x,y), numbers, 1) | |
f = open("B-large.in","r") | |
w = open("output_blarge.txt","w") | |
num = f.readline() | |
for i in range(0,int(num)): | |
barber,atN = [long(l) for l in f.readline().split()] | |
speed = [int(l) for l in f.readline().split()] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import * | |
def powerset(iterable): | |
s = list(iterable) | |
return chain.from_iterable(combinations(s, r) for r in range(len(s)+1)) | |
f = open("interstellar_input.txt","r") | |
# f = open("in.in","r") | |
w = open("output.txt","w") | |
num = f.readline() |
OlderNewer