Skip to content

Instantly share code, notes, and snippets.

View garganshul108's full-sized avatar

Anshul Garg garganshul108

View GitHub Profile
@garganshul108
garganshul108 / CONSADD.cpp
Last active March 19, 2021 02:23
Solution for CONSADD | March Long Challenge 2021
#include<bits/stdc++.h>
using namespace std;
#define ll long long
void NO() { cout << "No\n"; return; }
void YES() { cout << "Yes\n"; return; }
int r, c; ll k;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int check_authentication(char* password)
{
int auth_flag = 0;
char password_buffer[30];
strcpy(password_buffer, password);
@garganshul108
garganshul108 / WASoln.cpp
Created April 18, 2019 22:24
Correctsol.cpp
#define ll long long
#define fr(v,s,n) for(int v=s;((s<n)?v<n:v>n);((s<n)?v++:v--))
#define debug(p) cout<<#p<<' '<<p<<'\n';
#define debuga(a,i) cout<<#a<<"["<<i<<"]"<<" "<<a[i]<<"\n";
#define debugal(a) for(int v=0;v<(sizeof(a)/sizeof(a[0]));v++) cout<<#a<<"["<<v<<"]"<<" "<<a[v]<<"\n";
#define debugm(a,i,j) cout<<#a<<"["<<i<<"]["<<j<<"]"<<" "<<a[i][j]<<"\n";
#define pb push_back
#define mp make_pair
#define vii vector<pair<int,int>>
#define vi vector<int>
@garganshul108
garganshul108 / ACSoln.cpp
Last active April 18, 2019 22:20
Incorrect Soln
#define ll long long
#define fr(v,s,n) for(int v=s;((s<n)?v<n:v>n);((s<n)?v++:v--))
#define debug(p) cout<<#p<<' '<<p<<'\n';
#define debuga(a,i) cout<<#a<<"["<<i<<"]"<<" "<<a[i]<<"\n";
#define debugal(a) for(int v=0;v<(sizeof(a)/sizeof(a[0]));v++) cout<<#a<<"["<<v<<"]"<<" "<<a[v]<<"\n";
#define debugm(a,i,j) cout<<#a<<"["<<i<<"]["<<j<<"]"<<" "<<a[i][j]<<"\n";
#define pb push_back
#define mp make_pair
#define vii vector<pair<int,int>>
#define vi vector<int>
////https://www.spoj.com/problems/JULKA/
/*
*
* 1. strings ko endpoint ni mil rha tha
* explicitly add '\0' at end of each char array like 112 => 112\0
* 2. index out of bound possible
* garbage return hora tha
*