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
def multiply(a,b): | |
result = [[0,0],[0,0]] | |
for i in range(2): | |
for j in range(2): | |
summ = 0 | |
for k in range(2): | |
summ += a[i][k]*b[k][j] | |
result[i][j] = summ%(1000000007) | |
return result |
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
#include<iostream> | |
#include<cstdio> | |
#include<string> | |
#include<vector> | |
#include<algorithm> | |
#include<cmath> | |
#include<map> | |
using namespace std; | |
struct TrieNode | |
{ |
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
#include<bits/stdc++.h> | |
#define all(a) a.begin(),a.end() | |
#define ll long long | |
#define inp(a) scanf("%d",&a) | |
#define out(a) printf("%d\n",a) | |
#define inp2(a) scanf("%lld",&a) | |
#define out2(a) printf("%lld\n",a) | |
#define arrinput(a,n) for(int i=0;i<n;i++) scanf("%d",&a[i]); | |
#define pii pair<int,int> | |
#define piii pair<int,pair<int,int> > |
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
m,n,k = map(int,raw_input().split()) | |
matrix = [] | |
for _ in xrange(m): | |
matrix.append(map(int,raw_input().split())) | |
row,col = 0,0 | |
for _ in xrange(min(m,n)/2): | |
peel = [] | |
for i in range(col,n-col): |
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
#include<bits/stdc++.h> | |
#define all(a) a.begin(),a.end() | |
#define ll long long | |
#define inp(a) scanf("%d",&a) | |
#define out(a) printf("%d\n",a) | |
#define inp2(a) scanf("%lld",&a) | |
#define out2(a) printf("%lld\n",a) | |
#define arrinput(a,n) for(int i=0;i<n;i++) scanf("%d",&a[i]); | |
#define pii pair<int,int> | |
#define piii pair<int,pair<int,int> > |
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
import time | |
print "Welcome" | |
for i in range(5): | |
print "Wait for",5-i,"seconds" | |
time.sleep(1) | |
print "Done" |
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
message = """ | |
<p> THIS IS MY MESSAGE </p> | |
""" | |
# email_addresses = [] | |
# with open("emails.txt") as f: | |
# for line in f: | |
# email_addresses = line.strip().split(",") | |
import sendgrid | |
sg = sendgrid.SendGridAPIClient(apikey="") # API KEY INSIDE QUOTES |
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
class minmax | |
{ | |
int n; | |
void input() { | |
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | |
this.n = Integer.parseInt(br.readLine()); | |
} | |
int findSum() { | |
int max_value = 1, min_value = 9; |
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
class printPattern { | |
public static void main(String args[]) { | |
for(int i=0; i<4; i++) { // yeh loop 4 baar chalega | |
//for loop to print spaces | |
for(int j=0; j<i; j++) { | |
System.out.print(" "); | |
} | |
//for loop to print numbers |