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 <vector> | |
#include <stack> | |
#include <string> | |
#include <cmath> | |
using namespace std; | |
vector<pair<string, long long>> commands; | |
bool isPossible = true; | |
long long doit(long long x){ | |
stack<long long> st; |
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 <string> | |
using namespace std; | |
string map[51]; | |
int n,m; | |
bool visited[51][51]; | |
int dx[4] = {0,0,1,-1}; | |
int dy[4] = {1,-1,0,0}; | |
int dp[51][51]={}; | |
int dfs(int x, int y){ |
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 <vector> | |
#include <algorithm> | |
using namespace std; | |
int n, per; | |
int recommend[101]; | |
vector<int> res; | |
int main() { | |
cin>>n>>per; | |
for(int i=0; i<per; i++) { |
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 <vector> | |
#include <string> | |
using namespace std; | |
vector<char> vec; | |
string arr[50]; | |
int n,k; | |
bool character[26]; | |
bool isTeached[26]; | |
int maxi=0; |
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 <queue> | |
#include <vector> | |
#include <cmath> | |
#include <algorithm> | |
using namespace std; | |
int n,m; | |
vector<pair<int, int>> chicken, house; | |
long mins=9999999999; | |
void dfs(int x, vector<pair<int, int>> v){ |
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 <vector> | |
using namespace std; | |
int map[10][10]; | |
vector<pair<int,int>> vec; | |
bool check_v(int y,int num){ | |
for(int i=0; i<9; i++) { | |
if(num==map[i][y]) | |
return false; | |
} |
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> | |
using namespace std; | |
int n,map[16]; | |
int res=0; | |
bool isPossible(int x){ | |
for(int i=1; i<x; i++) { | |
if(map[x]==map[i] || abs(x-i) == abs(map[x]-map[i])) { | |
return false; | |
} | |
} |
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 <queue> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
int m,n,k; | |
bool map[101][101]; | |
queue<pair<int, int>> qu; | |
int dx[4]={1,-1,0,0}; | |
int dy[4]={0,0,1,-1}; |
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 <vector> | |
using namespace std; | |
int t,v,e; | |
vector<int> vec[20001]; | |
char check[20001]; | |
bool possible=true; | |
void dfs(int x,char t,int cnt){ | |
if(check[x]!='\0') { | |
return; |
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 <vector> | |
using namespace std; | |
int n; | |
vector<pair<char, char>> vec[26]; | |
void preorder(int x){ | |
cout<<char(x+65); | |
if(vec[x][0].first!='.') { | |
preorder(int(vec[x][0].first)-65); | |
} |
NewerOlder