show dbs
This file contains hidden or 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
// coded and assembled by adist98 | |
const fs = require('fs'); | |
const readline = require('readline'); | |
const {google} = require('googleapis'); | |
const { fileURLToPath } = require('url'); | |
// If modifying these scopes, delete token.json. | |
const SCOPES = ['https://www.googleapis.com/auth/spreadsheets.readonly']; | |
// The file token.json stores the user's access and refresh tokens, and is | |
// created automatically when the authorization flow completes for the first |
This file contains hidden or 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> | |
using namespace std; | |
typedef unsigned long long int ll; | |
const int mx=1e4+1; | |
vector<int>v[mx]; | |
int cont=0; |
This file contains hidden or 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
// coder : adist98 | |
// Given two long long integers a and b. The task is to prlong long int | |
// sum of all the digits appearing in the | |
// long long integers between a and b | |
#include "bits/stdc++.h" | |
using namespace std; | |
// Memoization for the state results | |
long long int dp[52][50][50][50][2]; |
This file contains hidden or 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
// DigitDP variation for calculating the sum of digits - CPCRC1C on SPOJ | |
// Code inspired by GeeksforGeeks - coded by adist98 | |
// Given two integers a and b. The task is to print | |
// sum of all the digits appearing in the | |
// integers between a and b | |
#include "bits/stdc++.h" | |
using namespace std; | |
// Memoization for the state results | |
long long int dp[20][180][2]; |
This file contains hidden or 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
// coder : adist98 | |
// dynamic RangeSumQuery using segment trees and lazy propagation// | |
#include<bits/stdc++.h> | |
using namespace std; | |
void updateSegTreelazy(long long int segTree[], long long int lazy[], long long int startRange, long long int endRange, long long int delta, long long int low, long long int high, long long int pos){ | |
if(low > high){ | |
return; |
This file contains hidden or 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
// static RangeSumQuery using segment trees // | |
#include<bits/stdc++.h> | |
using namespace std; | |
void ConstructTree(long long int input[], long long int segTree[],long long int low,long long int high,long long int pos){ | |
if(low == high){ | |
segTree[pos] = input[low]; | |
return; | |
} |
This file contains hidden or 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 <cstdlib> | |
#include <cmath> | |
#include <cstring> | |
#include <numeric> | |
#include <algorithm> | |
#include <functional> | |
#include <vector> | |
#include <queue> |
This file contains hidden or 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
// general implementation of matrix exponentiation .. .. | |
// implementation code by adist98 | |
#include<bits/stdc++.h> | |
using namespace std; | |
int main() | |
{ | |
unsigned long long int w; | |
cin >> w; |
This file contains hidden or 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 <stdio.h> | |
void multiply(int F[2][2], int M[2][2]); // function to multiply two 2x2 matrices | |
void power(int F[2][2], int n); // function to calculate the power | |
/* function that returns nth Fibonacci number */ | |
int fib(int n) | |
{ | |
int F[2][2] = {{1,1},{1,0}}; |
NewerOlder