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; | |
#define rep(i,a,b) for(i=a;i<b;i++) | |
#define rrep(i,b,a) for(i=b;i>=a;i--) | |
#define ld long double | |
#define ll long long | |
#define umapi unordered_map<int,int> | |
#define pii pair<int,int> | |
#define pll pair<ll,ll> | |
#define vi vector<int> |
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<string.h> | |
using namespace std; | |
int main(){ | |
int t; | |
cin>>t; | |
// cin.ignore(); | |
while(t--){ | |
string s; |
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
node *reverse(struct node *head, int k) | |
{ | |
node* curr=head, *prev=NULL, *last=NULL; | |
while(curr){ | |
int count=0; | |
node *h = curr; | |
// h->next=NULL; | |
while(curr && count<k){ | |
node* next = curr->next; | |
curr->next = prev; |
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> | |
using namespace std; | |
int main() { | |
long int t; | |
cin>>t; | |
while(t--){ | |
long int n,m,q; | |
cin>>n>>m>>q; |
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
vector<pair<int,int>> offset{{0,1},{0,-1},{1,0},{-1,0},{1,1},{-1,1},{-1,-1},{1,-1}}; | |
bool isSafe(int i, int j){ | |
if(i>=0 && j>=0 && i<SIZE && j<SIZE) | |
return true; | |
return false; | |
} | |
void dfs(int i, int j, int g[SIZE][SIZE], bool vis[SIZE][SIZE], int *count){ | |
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 <bits/stdc++.h> | |
using namespace std; | |
// Function to find number of subarrays such that | |
// XOR of one half is equal to the other | |
int findSubarrCnt(int arr[], int n) | |
{ | |
// Variable to store current XOR's |
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 <bits/stdc++.h> | |
using namespace std; | |
int main() | |
{ | |
int T,N; | |
cin>>T; |
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 <bits/stdc++.h> | |
using namespace std; | |
int findSubarrCnt(int arr[], int n) | |
{ | |
int ans = 0, XOR = 0; | |
// Array to store prefix XOR's |
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
long long Queries (vector<int> A, int K) { | |
// Write your code here | |
int n=A.size(); | |
int maxPrefixSum=0,maxPrefixLen=0; | |
long long sum=0; | |
for(int i=0;i<A.size();i++){ | |
int prefixSum=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
You just need to add some URLs to the dependency_links argument to setup(). | |
The URLs must be either: | |
direct download URLs, | |
the URLs of web pages that contain direct download links, or | |
the repository’s URL |
NewerOlder