Skip to content

Instantly share code, notes, and snippets.

View axayjha's full-sized avatar
🚀
work hard, play hard

Akshay Anand axayjha

🚀
work hard, play hard
View GitHub Profile
#define decode(s,t,u,m,p,e,d) \
m ## s ## u ## t
#define begin decode(a,n,i,m,a,t,e)
#define execute decode(I, E, L, F, U, C, K)
#define encode(b,y,t,e,c,o,d) \
b ## c ## t ## e ## d
#define ouput encode(w, a, i, l, h, y, e)
#define encrypt encode(f,a,p,e,o,n,n)
#include <stdio.h>
@axayjha
axayjha / proj.c
Last active September 24, 2016 17:22
#include <stdio.h>
int diff(int a,int b)
{
int c=a-b;
if(c>=0)
return c;
else
return -c;
}
employee = {}
employee["Name"] = ("Akshay","Anand", "Jha")
employee["Address"] = ["36C", "DH Road", "Kolkata"]
employee["Contact"] = {"number": "+91-9483873647", "email": "[email protected]"}
employee["Job"] = "Developer"
employee["Salary"] = 50000
# 1
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
#define CITY_ALLOWANCE 5000
#define HILL_ALLOWANCE 3000
#define H_D_ALLOWANCE 2000
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
#define CITY_ALLOWANCE 5000
#define HILL_ALLOWANCE 3000
#define H_D_ALLOWANCE 2000
#include <stdio.h>
int find(int, int);
int main()
{
int n, k;
scanf("%d %d", &n, &k);
int c = find(n,k);
printf("%d\n", c);
}
a=[(2,3), (1,2), (3,1), (1,3), (3,2), (2,4), (4,1)]
##answer= [(1,2), (1,3), (1,4), (2,1), (3,2), (3,4), (4,2), (4,3)]
b=[(2,3), (1,2)]
c=[(1,2),(3,4), (5,6)]
def onehop(pairs):
res=[]
for i in range(len(pairs)):
for j in range(len(pairs)):
if pairs[i][1]==pairs[j][0] and pairs[i][0]!=pairs[j][1]:
res.append((pairs[i][0], pairs[j][1]))
#include <stdio.h>
int fact(int n)
{
if(n<=1) return 1;
else return n*fact(n-1);
}
int main()
{
int n;
scanf("%d", &n);
#include <stdio.h>
#define WORD 1
#define PUNC 0
int is_punc(char c)
{
if(c==' ' || c==',' || c=='\t' || c==';' || c=='.')
return 1;
return 0;
}
int main()
@axayjha
axayjha / graph.c
Last active August 27, 2017 16:58
Prim's algo. Debugged
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#define SIZE 128
#define INF 99999
#define MAX 20
struct link
{