Skip to content

Instantly share code, notes, and snippets.


Deepak yadav yDeepak1889

View GitHub Profile
yDeepak1889 / gcd1_sparseTable.cpp
Created Feb 24, 2017
number of (l, r) such that 0<=l <= r <= n-1 and gcd(arr[l], arr[l+1] . . . arr[r]) = 1 using sparse table
View gcd1_sparseTable.cpp
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pint pair<int, int>
#define pll pair<ll, ll>
#define mk(a, b) make_pair(a, b)
#define pr(n) printf("%d\n", n)
#define sc(n) scanf ("%d", &n)
View DigitalOcean_NoVNC_Paste.js
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split("");
function f() {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1
You can’t perform that action at this time.