Skip to content

Instantly share code, notes, and snippets.

View chermehdi's full-sized avatar
💭
My opinions are my own.

Mehdi Cheracher chermehdi

💭
My opinions are my own.
View GitHub Profile
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#define INF 9999999
#define MAX 1000000
typedef long long ll;
@chermehdi
chermehdi / bfs.cpp
Created September 28, 2016 12:09
a bfs implementation using cpp
#include <iostream>
#include <queue>
#include <vector>
#include <string.h>
vector<vector<int> > graph;
void bfs(int src){
bool visited[1000];
@chermehdi
chermehdi / TheBestPlayer.java
Created October 1, 2016 19:28
hackerearth the best player solution
/**
* @Author Mehdi Maick
*
*/
import java.util.*;
import java.io.*;
public class TheBestPlayer{
static class Fan implements Comparable<Fan>{
@chermehdi
chermehdi / DexterAndMandrak.java
Created October 3, 2016 21:51
Solution to hackerEarth Dexter
package com.algorithms;
/**
* @Author Mehdi Maick
* Created on 03/10/2016.
*/
import java.util.*;
import java.io.*;
@chermehdi
chermehdi / FooAndExams.java
Created October 11, 2016 11:58
HackerEarth Foo And Exams Solution
package com.algorithms;
/**
* @Author Mehdi Maick
* Created on 29/09/2016.
*/
import java.util.*;
import java.io.*;
@chermehdi
chermehdi / Blast.java
Created October 14, 2016 22:21
Spoj Blast Solution
package com.problems;
/**
* @Author Mehdi Maick
*
*/
import java.io.*;
import java.util.Arrays;
@chermehdi
chermehdi / scorifyb.cpp
Created October 19, 2016 21:25
solution to problem b of mcpc2015
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
@chermehdi
chermehdi / scorifyC.java
Created October 30, 2016 19:54
Acpc2014 problem C Solution
package problems;
/**
* @Author Mehdi Maick
* Created on 30/10/2016.
*/
import java.util.*;
import java.io.*;
@chermehdi
chermehdi / LinkedList.cpp
Created October 31, 2016 18:25
simple implementation of likedlist
//
// LinkedList.cpp.cpp
// McpcTraining
//
// Created by mehdi MAC on 23/09/2016.
// Copyright © 2016 mehdi MAC. All rights reserved.
//
#include <iostream>
#include <string>
#include <vector>
String a = "MyString";
String b = "MyOtherString";
a = a + b; // a new String has been created here
String s = a.substring(1); // the "a" string is not modified a new String Object is created every single time
// we do this kind of operations