Skip to content

Instantly share code, notes, and snippets.

View OmarJH's full-sized avatar

Omar alJubbah OmarJH

View GitHub Profile
@OmarJH
OmarJH / ACM-Just The Facts
Last active August 29, 2015 14:14
ACM - 568 - Just the Facts -UVa Online Judge
#include <iostream>
#include<string>
using namespace std;
int main()
{
int N,Ans=1,Temp,i,f;
while (cin >> N)
{
Ans = 1;
@OmarJH
OmarJH / 150. Fibo
Created January 30, 2015 12:56
ACM _ 150. Fibo .....problem link : http://a2oj.com/p.jsp?ID=150
#include <iostream>
using namespace std;
int main()
{
int a[100002];
int N, t1 = 0, t2 = 1;
a[0] = 0;
a[1] = 1;
@OmarJH
OmarJH / 483 --Word Scramble
Last active August 29, 2015 14:16
ACM- 483 - Word Scramble - UVA Online Judge
#include<iostream>
#include<sstream>
#include<string>
using namespace std;
int main()
{
string line;
stringstream ss; // put the line into these stream to input words from it intead of cin
string word;
while (getline(cin, line)){
@OmarJH
OmarJH / TEX Quotes
Created February 25, 2015 14:39
ACM - 272 - TEX Quotes - UVA Online Judge
#include <iostream>
#include <string>
using namespace std;
int main()
{
string line;
bool counte=false;
int size;
while (getline(cin, line))
{
@OmarJH
OmarJH / A. Design Tutorial: Learn from Math
Created February 25, 2015 15:35
ACM _A. Design Tutorial: Learn from Math _CodeForces
#include <iostream>
using namespace std;
bool composite(int x)
{
for (int i = x / 2; i > 1; i--)
{
if (x%i == 0)
return true;
}
return false;
#include <iostream>
using namespace std;
int main()
{
int a[1009], b[1009],n,x,count=0;
bool fou = false;
a[0] = 0;
a[1] = 1;
cin >> n;
for (int i = 2; i < 1009; i++)
@OmarJH
OmarJH / 376A - Lever
Last active August 29, 2015 14:16
ACM - 376A - Lever - CodeForces
#include <iostream>
#include <string>
using namespace std;
int main()
{
string line;
char a;
bool rl=false;
int s1, s2, z1 = 0, z2 = 0, size;
__int64 f1 = 0, f2 = 0;
@OmarJH
OmarJH / 10921 -Find the Telephone
Created February 27, 2015 12:09
ACM - 10921 -Find the Telephone _UVA Online Judge
#include <iostream>
#include <string>
using namespace std;
int main()
{
string line;
int size;
while (getline(cin, line))
{
size=line.size();
@OmarJH
OmarJH / 10921 -Find the Telephone
Created February 27, 2015 12:20
ACM_4736 - Probability One
#include <iostream>
using namespace std;
int main()
{
int x,i=0,f;
while (true)
{
cin >> x;
if (x == 0)
break;
@OmarJH
OmarJH / 386A - Second-Price Auction
Created February 27, 2015 13:11
ACM_386A - Second-Price Auction _codeforces
#include <iostream>
using namespace std;
int main()
{
int n,a1,maxcount,max=0,premax=0;
while (cin >> n)
{
premax = 0; max = 0; maxcount = 0;
for (int i = 0; i < n; i++)
{