Skip to content

Instantly share code, notes, and snippets.

View OmarJH's full-sized avatar

Omar alJubbah OmarJH

View GitHub Profile
@OmarJH
OmarJH / B. T-primes
Created May 2, 2015 21:21
ACM - B. T-primes -CodeForces
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
using namespace std;
const int MAX_N = 1000000;
vector <int> primes;
int Bsearche(int f, int e, int tar)
{
if (f > e)
@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 / 160. Commandos
Created May 2, 2015 21:18
ACM - 160. Commandos - A2OJ
#include<iostream>
#include <vector>
using namespace std;
int comp(int a, int b ,int c)
{
if (a >= b)
{
if (a >= c)
return a;
else
@OmarJH
OmarJH / 168. Parentheses
Created May 2, 2015 21:17
ACM - 168. Parentheses -A2OJ
#include <iostream>
#include <vector>
using namespace std;
void checkprint(vector <bool>a)
{
int tempp = 0;
for (int i = a.size()-1; i >= 0; i--)
{
if (a[i])
tempp++;
@OmarJH
OmarJH / 308. Enter The Contest
Created May 2, 2015 21:15
ACM - 308. Enter The Contest - A2OJ
#include <iostream>
#include <string>
#include <vector>
using namespace std;
vector <vector <int> > a;
vector < int > al;
void makearr()
{
a.resize(5);
int tt = 2,t2;
@OmarJH
OmarJH / 316. Medals for the winning teams
Created May 2, 2015 21:14
ACM - 316. Medals for the winning teams - A2OJ
#include <iostream>
#include <string>
using namespace std;
int main()
{
int t;
double d,x,y;
cin >> t;
int i = 1;
@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')
@OmarJH
OmarJH / Linked List
Created April 25, 2015 22:59
Linked List
#include <iostream>
using namespace std;
class rec
{
int Length;
int width;
public:
// This add a new value for rec
void add(int a,int b)
{
@OmarJH
OmarJH / 131. Triangles
Created April 24, 2015 14:33
ACM - 131. Triangles - A2OJ
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int m = 0;
vector <long long > a(64001);
a[0] = 0;
for (int i = 1; i < 64001; i++)
{
@OmarJH
OmarJH / 136. Time Jumper (Hard)
Created April 24, 2015 14:06
ACM - 136. Time Jumper (Hard) - A2OJ
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void allsubset(vector<int>a,int y)
{
vector <int>all;
vector <bool> sumset;
vector <bool> Tsumset;
sort(a.begin(), a.end());