Skip to content

Instantly share code, notes, and snippets.

View 08vivek08's full-sized avatar

Vivekanand 08vivek08

  • Maharaja Agrasen Institute Of Technology
View GitHub Profile
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll large=1000000007;
bool distinct(ll i,ll k)
{
set<ll>s;
while(i>0)
{
/* 1. Randomly generate any code of four digit no with
unit as a fibboniccai no & prime no
tenth & hundred place difference as 2
hundred & thousand place difference as 2
*/
#include <bits/stdc++.h>
using namespace std;
int arr[]={2,3,5};
/* 2. Randomly generate all code of four digit no with
unit as a fibboniccai no & prime no
tenth & hundred place difference as 2
*/
#include <bits/stdc++.h>
using namespace std;
int arr[]={2,3,5};
void code_gen(){
@08vivek08
08vivek08 / eid.cpp
Last active September 1, 2019 09:08
#include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int a[3],c[3];
// input
for(int i=0;i<3;i++){
#include<bits/stdc++.h>
using namespace std;
set<vector<string>>s;
void distinct(string arr[],int n){
vector<string>v;
for(int i=0;i<n;i++){
v.push_back(arr[i]);
}
s.insert(v);
}
// AVL Implemented
#include<bits/stdc++.h>
using namespace std;
struct Node
{
int data, height;
Node *left, *right;
Node(int x)
{
#include <bits/stdc++.h>
using namespace std;
struct node{
int data;
node *next;
node(int d)
{
data=d;
next=NULL;
#include <bits/stdc++.h>
using namespace std;
void max_heapify(vector<int>&arr,int i,int N){
if(i==0 || N==0){
return;
}
int largest,left=2*i,right=2*i+1;
if(left<=N && arr[left]>=arr[i]){
largest=left;
// Undirected & non weighted GRAPH
// O(n+m) time complexity
// vertices start from 1 onwards
#include <bits/stdc++.h>
using namespace std;
class Graph{
int vertices;
vector<int>*adj;
bool *visited;
// DIJKSTRA on weighted GRAPH
// O(n+mlog(m)) time complexity
// vertices start from 1 onwards
// can't work in case of negative edges
#include <bits/stdc++.h>
using namespace std;
const int INF=1e7;
class Graph{
int vertices;