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.io.*; | |
import java.util.*; | |
public class word_lazy_swap | |
{ | |
public static HashSet<String>dict; | |
public static void main(String[] args) throws Exception | |
{ | |
InputReader sc=new InputReader(new FileInputStream(args[0])); | |
dict=new HashSet<String>(); | |
while(!sc.isExhausted()) dict.add(sc.readLine()); |
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 its_raining_anagrams | |
{ | |
public static short[]profile(String s) | |
{ | |
int i,n=s.length(); | |
short arr[]=new short[26]; | |
for(i=0;i<n;i++) | |
arr[s.charAt(i)-'A']++; |
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
// For java, make sure the main class name is sum_it_3 | |
import java.io.*; | |
import java.util.*; | |
public class sum_it_3 { | |
public static void main(String[] args) throws Exception { | |
InputReader sc=new InputReader(new FileInputStream(args[0])); | |
int i=0,j,k,l,max=-1,sum=0; | |
int a[]=new int[10000000]; | |
while(!sc.isExhausted()) | |
a[i++]=sc.readInt(); |
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.io.*; | |
import java.util.*; | |
public class word_twist | |
{ | |
private static final int ALPHABET = 26; | |
public static int[] profile(String s) { | |
int[] cnt = new int[ALPHABET]; | |
for (int i = 0; i < s.length(); i++) | |
++cnt[s.charAt(i)-'A']; |
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
// For java, make sure the main class name is sum_it_4 | |
import java.io.*; | |
import java.util.*; | |
public class sum_it_4 | |
{ | |
public static void main(String[] args) throws Exception { | |
Scanner sc=new Scanner(new File(args[0])); | |
Vector <Integer>v=new Vector<Integer>(); | |
int i=0,j,k; | |
while(Boolean.TRUE) |
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.io.*; | |
import java.util.*; | |
public class bits_manipulation | |
{ | |
public static void main(String[] args) throws Exception | |
{ | |
Scanner sc=new Scanner(new File(args[0])); | |
long a,res=0;int x,i=0; | |
while(sc.hasNext()) | |
{ |
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 coin_changes | |
{ | |
public static void main (String[] args) throws Exception | |
{ | |
int max=-1,i,j; | |
Scanner sc=new Scanner(new File(args[0])); | |
Vector <Integer>v=new Vector<Integer>(); | |
while(sc.hasNext()) |
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.*; | |
class Node { | |
char content; | |
boolean marker; | |
Collection<Node> child; | |
public Node(char c){ | |
child = new LinkedList<Node>(); | |
marker = false; | |
content = c; |
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 AddAGram{ | |
public static Vector<String>dic[]; | |
public static Stack<String>s; | |
public static HashSet<String>vis=new HashSet<String>(); | |
public static boolean check(char []l,char []s){ | |
int i,j,len=l.length; | |
for(i=0;i<s.length;i++) | |
for(j=0;j<l.length;j++) |
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.io.*; | |
import java.util.*; | |
public class levenshtein_distance{ | |
public static HashSet[]h=new HashSet[25]; | |
public static Stack<String>st=new Stack<String>(); | |
public static HashSet<String>fnl=new HashSet<String>(); | |
public static void main(String args[]) throws Exception{ | |
long aa=System.currentTimeMillis(); | |
InputReader sc=new InputReader(new FileInputStream("in.txt")); | |
int i,j; |
OlderNewer