-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
602f00d
commit 77e52bc
Showing
655 changed files
with
9,043 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include <bits/stdc++.h> | ||
using namespace std; | ||
|
||
int main(){ | ||
|
||
cout<<"Yes"<<endl; | ||
} |
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include <bits/stdc++.h> | ||
using namespace std; | ||
|
||
|
||
int n=50; | ||
bool prime[n+1]; | ||
|
||
|
||
void primeGen() | ||
{ | ||
|
||
memset(prime, true, sizeof(prime)); | ||
|
||
for (int p=2; p*p<=n; p++) | ||
{ | ||
if (prime[p] == true) | ||
{ | ||
for (int i=p*2; i<=n; i += p) | ||
prime[i] = false; | ||
} | ||
} | ||
|
||
/* for (int p=2; p<=n; p++) | ||
if (prime[p]) | ||
cout << p << " ";*/ | ||
} | ||
|
||
|
||
int main(){ | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Program to print all combination of size r in an array of size n | ||
#include <stdio.h> | ||
void combinationUtil(int arr[], int data[], int start, int end, | ||
int index, int r); | ||
|
||
// The main function that prints all combinations of size r | ||
// in arr[] of size n. This function mainly uses combinationUtil() | ||
void printCombination(int arr[], int n, int r) | ||
{ | ||
// A temporary array to store all combination one by one | ||
int data[r]; | ||
|
||
// Print all combination using temprary array 'data[]' | ||
combinationUtil(arr, data, 0, n, 0, r); | ||
} | ||
|
||
/* arr[] ---> Input Array | ||
data[] ---> Temporary array to store current combination | ||
start & end ---> Staring and Ending indexes in arr[] | ||
index ---> Current index in data[] | ||
r ---> Size of a combination to be printed */ | ||
void combinationUtil(int arr[], int data[], int start, int end, | ||
int index, int r) | ||
{ | ||
// Current combination is ready to be printed, print it | ||
if (index == r) | ||
{ | ||
for (int j=0; j<r; j++) | ||
printf("%d ", data[j]); | ||
printf("\n"); | ||
return; | ||
} | ||
|
||
// replace index with all possible elements. The condition | ||
// "end-i+1 >= r-index" makes sure that including one element | ||
// at index will make a combination with remaining elements | ||
// at remaining positions | ||
for (int i=start; i<end && end-i >= r-index; i++) | ||
{ | ||
data[index] = arr[i]; | ||
combinationUtil(arr, data, i+1, end, index+1, r); | ||
} | ||
} | ||
|
||
// Driver program to test above functions | ||
int main() | ||
{ | ||
int arr[] = {1, 2, 3, 4, 5}; | ||
int r = 3; | ||
int n = sizeof(arr)/sizeof(arr[0]); | ||
printCombination(arr, n, r); | ||
} | ||
ayhumar.yakup@gmail.com humargul516 |
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
inputf.in |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Yes |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include <iostream> | ||
#include <cstdio> | ||
using namespace std; | ||
|
||
int main(){ | ||
double sum=0; | ||
for(int i=0;i<12;i++){ | ||
double t; | ||
cin>>t; | ||
sum+=t; | ||
} | ||
printf("$%.2f\n",sum/12.0); | ||
} |
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main(){ | ||
double sum=0,ex[279]; | ||
for(int i=2;i<279;i++){ | ||
sum+=1.0/i; | ||
ex[i-1]=sum; | ||
} | ||
double c; | ||
cin>>c; | ||
while(c!=0){ | ||
for(int i=1;i<279;i++){ | ||
if(ex[i]>=c){ | ||
cout<<i<<" card(s)"<<endl;break; | ||
} | ||
} | ||
cin>>c; | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include <iostream> | ||
#include <vector> | ||
#include <utility> | ||
#include <algorithm> | ||
using namespace std; | ||
|
||
int value(string ex){ | ||
int val=0; | ||
for(int i=0;i<ex.length()-1;i++){ | ||
for(int j=i+1;j<ex.length();j++){ | ||
if(ex[j]<ex[i]) | ||
val++; | ||
} | ||
} | ||
return val; | ||
} | ||
|
||
bool cmp (const pair<string,int> &a, const pair<string,int> &b ){ | ||
return a.second <= b.second; | ||
} | ||
|
||
int main(){ | ||
|
||
int n,m; | ||
cin>>n>>m; | ||
vector< pair<string,int> > fx; | ||
for(int i=0;i<m;i++){ | ||
string ex; | ||
cin>>ex; | ||
fx.push_back(make_pair(ex,value(ex))); | ||
} | ||
sort(fx.begin(),fx.end(),cmp); | ||
for(int i=0;i<m;i++){ | ||
cout<<fx[i].first<<endl; | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <bits/stdc++.h> | ||
using namespace std; | ||
|
||
int main(){ | ||
int n; | ||
cin>>n; | ||
int ar[n]; | ||
for(int i=0;i<n;i++) | ||
{ | ||
cin>>ar[i]; | ||
} | ||
sort(ar,ar+n); | ||
cout<<ar[n-1]<<" "<<ar[0]<<endl; | ||
|
||
} |
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include <bits/stdc++.h> | ||
using namespace std; | ||
|
||
int main(){ | ||
int n; | ||
cin>>n; | ||
int arr[n]; | ||
for(int i=0;i<n;i++) | ||
{ | ||
cin>>arr[i]; | ||
} | ||
sort(arr,arr+n); | ||
for(int i=n-1;i>=0;i--) | ||
cout<<arr[i]<<" "; | ||
cout<<endl; | ||
|
||
} |
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include <bits/stdc++.h> | ||
using namespace std; | ||
|
||
int main(){ | ||
int n; | ||
cin>>n; | ||
stack<int> ex[n]; | ||
for(int i=0;i<n;i++){ | ||
int t,m; | ||
cin>>t; | ||
ex[i].push(i+1); | ||
while(t--){ | ||
cin>>m; | ||
ex[i].push(m); | ||
} | ||
} | ||
int k; | ||
cin>>k; | ||
int route[k]; | ||
for(int i=0;i<k;i++) | ||
cin>>route[i]; | ||
for(int i=0;i<k-1;i++){ | ||
int r=route[i]-1; | ||
stack<int> tm=ex[r]; | ||
bool b=true; | ||
while(!tm.empty()){ | ||
if(tm.top()==route[i+1]){ | ||
b=false; | ||
break; | ||
} | ||
tm.pop(); | ||
} | ||
if(b){ | ||
cout<<"This instruction will lead you astray"<<endl;return 0; | ||
} | ||
} | ||
cout<<"Instruction is OK"<<endl; | ||
|
||
} |
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <bits/stdc++.h> | ||
using namespace std; | ||
|
||
int main(){ | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <bits/stdc++.h> | ||
using namespace std; | ||
|
||
int sol(int s){ | ||
|
||
return sol(s-1)+sol(s-2); | ||
} | ||
|
||
int main(){ | ||
int t; | ||
cin>>t | ||
while(t--){ | ||
int s; | ||
cin>>s | ||
int ans=0; | ||
while(--s){ | ||
int x=1; | ||
|
||
} | ||
} | ||
} |
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <bits/stdc++.h> | ||
using namespace std; | ||
|
||
int main(){ | ||
|
||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <bits/stdc++.h> | ||
using namespace std; | ||
|
||
int main(){ | ||
int n; | ||
cin>>n; | ||
while(n--){ | ||
int sum=0,s; | ||
for(int i=0;i<8;i++){ | ||
cin>>s; | ||
sum+=s; | ||
} | ||
printf("%.2f\n",sum/4.0); | ||
|
||
} | ||
} |
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
2 | ||
5 5 | ||
10 10 | ||
5 10 | ||
10 5 | ||
5 5 | ||
10 10 | ||
5 10 | ||
10 5 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include <bits/stdc++.h> | ||
using namespace std; | ||
|
||
int count(string ex){ | ||
int c=0; | ||
for(int i=0;i<ex.length();i++){ | ||
if(isspace(ex[i])) | ||
c++; | ||
} | ||
return c; | ||
} | ||
int main(){ | ||
int n; | ||
cin>>n; | ||
cin.ignore(); | ||
while(n--){ | ||
string ex,fx,a,b; | ||
getline(cin,ex); | ||
getline(cin,fx); | ||
if(count(ex)>=count(fx)) | ||
cout<<ex<<endl; | ||
else | ||
cout<<fx<<endl; | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
1 | ||
Muhammad Amirul Ashraf | ||
Amjad A seini k k | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
2 | ||
dfggrgrgrgAmjad Alhouseini | ||
Muhammad Amirul Ashraf | ||
mjad Alhouseini | ||
Muhammad Amirul Ashraf |
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#include <bits/stdc++.h> | ||
using namespace std; | ||
|
||
int main(){ | ||
//freopen("input","r",stdin); | ||
int r,c; | ||
cin>>r>>c; | ||
while(r!=0 && c!=0){ | ||
string ex[r]; | ||
for(int i=0;i<r;i++){ | ||
cin>>ex[i]; | ||
} | ||
bool flag[r][c]; | ||
memset(flag,0,sizeof(flag)); | ||
int count=0; | ||
for(int i=0;i<r;i++){ | ||
for(int j=0;j<c;j++){ | ||
if(ex[i][j]=='X' && !flag[i][j]){ | ||
count++; | ||
// cout<<i<<" "<<j<<endl; | ||
stack<pair<int,int> > stat; | ||
stat.push(make_pair(i,j)); | ||
flag[i][j]=true; | ||
while(!stat.empty()){ | ||
pair<int,int> tm=stat.top(); | ||
stat.pop(); | ||
//cout<<tm.first<<" tm " <<tm.second<<endl; | ||
for(int x=-1;x<2;x++){ | ||
for(int y=-1;y<2;y++){ | ||
if(x==0 && y==0) | ||
continue; | ||
int nx=tm.first+x,ny=tm.second+y; | ||
if(nx>=0 && nx<r && ny>=0 && ny<c ){ | ||
if(ex[nx][ny]=='X' && !flag[nx][ny]){ | ||
flag[nx][ny]=true; | ||
stat.push(make_pair(nx,ny)); | ||
// cout<<nx<<", "<<ny<<"pushed"<<endl; | ||
} | ||
|
||
} | ||
} | ||
} | ||
} | ||
//cout<<endl; | ||
} | ||
} | ||
} | ||
cout<<count<<endl; | ||
cin>>r>>c; | ||
} | ||
|
||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.