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> | |
using namespace std; | |
#define size 1001 | |
int primes[size]; | |
void seive() | |
{ | |
memset(primes,1,sizeof(primes)); | |
for(int i=2;i<size;i++){ | |
if(primes[i]){ | |
for(int j=2*i;j<size;j+=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<bits/stdc++.h> | |
using namespace std; | |
long long dp[10001]; | |
int coin[]={1,8,27,64,125,216,343,512,729,1000,1331,1728,2197,2744,3375,4096,4913,5832,6859,8000,9261}; | |
int main() | |
{ | |
int n; | |
while(scanf("%d",&n)==1){ | |
memset(dp, 0, sizeof dp); dp[0] = 1; | |
for(int i = 0; i < 21; 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<bits/stdc++.h> | |
using namespace std; | |
int main() | |
{ | |
int test,num,b,x,y; | |
cin>>test; | |
for(int p=1;p<=test;p++){ | |
cin>>num>>b>>x>>y; | |
int sum=0; | |
int c=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<bits/stdc++.h> | |
using namespace std; | |
int bitTree[100002]; | |
struct contestRank | |
{ | |
int c1,c2,c3; | |
}; | |
bool cmp(const contestRank &a,const contestRank &b) | |
{ | |
return a.c1<b.c1; |
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> | |
using namespace std; | |
map<string,string> parent; | |
struct Data | |
{ | |
string u,v; | |
int w; | |
}; | |
bool cmp(Data a,Data b) | |
{ |
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> | |
using namespace std; | |
#define MAX 102 | |
#define INF 1000000 | |
int arr[MAX][MAX]; | |
int main() | |
{ | |
int u,v,cot=0; | |
while(true){ | |
scanf("%d %d",&u,&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<bits/stdc++.h> | |
using namespace std; | |
#define MAX 100005 | |
int arr[MAX]; | |
int tree[3*MAX]; | |
int lazy[3*MAX]; | |
void build_tree(int node,int a,int b) | |
{ |
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> | |
using namespace std; | |
vector<long long >lis[100000]; | |
map<long long,int> check; | |
map<long long,int> diff; | |
map<long long,int> visit; | |
queue<long long> jis; | |
int bfs(int start,int dist) | |
{ |
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> | |
using namespace std; | |
#define getint(a) scanf("%d", &a) | |
map<string,int> pos; | |
vector<string> str; | |
int arr[101]; | |
list<int> *adj; | |
int main() | |
{ | |
int number,relate,a,b; |
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> | |
using namespace std; | |
#define ll long long | |
int prime[]={2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47}; | |
ll n,number,divisor; | |
void dfs(int pos,ll num,int div, int limit) | |
{ | |
if(div>divisor || (div==divisor && num<number)){ |
NewerOlder