Skip to content

Instantly share code, notes, and snippets.

View OmarJH's full-sized avatar

Omar alJubbah OmarJH

View GitHub Profile
@OmarJH
OmarJH / Dreamoon and Stairs
Created February 25, 2015 16:07
ACM - 476A - Dreamoon and Stairs - CodeForces
#include <iostream>
using namespace std;
int main()
{
int x, n, m;
while (cin >> n >> m)
{
if (m > n)
x = -1;
else
@OmarJH
OmarJH / Sudoku solver.cpp
Last active December 21, 2015 14:59
Sudoku solver on c++ via console
#include <iostream>
#include <string>
using namespace std;
#include <windows.h>
HANDLE outcon = GetStdHandle(STD_OUTPUT_HANDLE);
bool end22 = false;
bool solved = false;
void gotoxy(short x, short y)
{
@OmarJH
OmarJH / List
Last active December 21, 2015 14:59
Simple List code (pointers)
#include <iostream>
using namespace std ;
void main ()
{
int *temp,start,*return_to_a ;
bool first= true;
cout<<"Please start entering numbers"<<endl;
while(1)
{
@OmarJH
OmarJH / F. Door Lock
Created September 26, 2015 12:50
Syrian Collegiate Programming Contest
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
long double sec(long double a, long double b, long double c)
{
long double del = b*b - 4 * a *c;
long double x1 = (-sqrt(del) - b) / 2*a;
long double x2 = (sqrt(del) - b) / 2*a;
if (x1 > 0 && x1 < 0)
#include <iostream>
#include <vector>
using namespace std;
int main()
{
double h=0;
double p1, p2, p3;
int n;
cin >> p1;
@OmarJH
OmarJH / edited
Created May 12, 2015 12:48
edited
#include <iostream>
#include <vector>
using namespace std;
int main()
{
double h=0;
double p1, p2, p3;
int n;
cin >> p1;
@OmarJH
OmarJH / Board.cpp
Last active August 29, 2015 14:21
Board HakerRank
#include <iostream>
#include <vector>
using namespace std;
int main()
{
char m;
int xs, ys,n1,n2,tx,ty,coun=0;
vector < vector <int> > a;
@OmarJH
OmarJH / Sunset
Created May 12, 2015 12:33
Sunset
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector <int> a;
vector <int> ans;
int n,maxx=0,t;
cin >> t;
while (t--)
@OmarJH
OmarJH / B. Unlucky Ticket
Created May 2, 2015 21:20
ACM - B. Unlucky Ticket - CodeForces
#include <iostream >
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
int main()
{
vector <int> a1, a2;
int n,tempp;
string x;
@OmarJH
OmarJH / 315. Meeting Point
Created May 2, 2015 21:13
ACM - 315. Meeting Point - A2OJ
#include <iostream>
#include <vector>
using namespace std;
vector <vector <char> > a;
int count(int x,int y)
{
int coux=0, couy=0;
for (int i = 0; i < a[x].size(); i++)
{
if (a[x][i] == 'H')