Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
/* | |
* @author rohit jangid | |
* @data Apr 16, 2013 | |
* @file-name FoxAndMp3.java | |
* @license this code is licensed under WTFPL V-2.0 | |
* @details Topcoder SRM 571 Div I problem 250 | |
*/ | |
import java.util.Arrays; |
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
fuel = map(lambda x:int(x), raw_input().split()) | |
distance = map(lambda x:int(x), raw_input().split()) | |
# takes the standard input as space separated integers in two lines. | |
diff = [b-a for b,a in zip(fuel, distance)] # creates the diff array | |
diff = diff + diff # to account for cyclic array | |
start = 0 # let say we start from 0 the position | |
end = 0 |
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
#include <stdarg.h> | |
#include <stdio.h> | |
#include <string.h> | |
#define P_SIZE 7 | |
int F[P_SIZE] ; | |
void prefix(char* p, int m) { | |
int i = 1, j = 0; |
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
#include <stdio.h> | |
#include <string.h> | |
#include <math.h> | |
#include <stdlib.h> | |
struct node { | |
int data; | |
int frequency; | |
struct node* left; | |
struct node* right; |
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
#include<stdio.h> | |
int n; | |
void print(char *pattern,int index,int open,int close); | |
int main() | |
{ | |
printf("enter the number of parantheses"); | |
scanf("%d",&n); | |
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
//quick sort | |
#include<stdio.h> | |
void quicksort(int*arr,int left, int right); | |
int partition(int *arr,int left,int right); | |
int main() | |
{ | |
int arr[6]={5,4,1,2,8,3}; | |
int i; |
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
//selection sort | |
#include<stdio.h> | |
int main() | |
{ | |
int arr[5]={5,4,3,2,1}; | |
int i,j,smallest,t; | |
int n = sizeof(arr)/sizeof(int); | |
for(i=0;i<n-1;i++) | |
{ |
NewerOlder