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 long long lint; | |
typedef long double llf; | |
typedef pair<lint, lint> pi; | |
struct node{ | |
int max, snd, cnt; | |
lint sum; | |
}tree[2100000]; |
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> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <assert.h> | |
#include <limits.h> | |
#include <math.h> | |
#include <time.h> | |
#include <iostream> | |
#include <functional> | |
#include <numeric> |
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> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <math.h> | |
#include <limits.h> | |
#include <stack> | |
#include <queue> | |
#include <map> | |
#include <set> | |
#include <algorithm> |
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 <cstdio> | |
#include <cstring> | |
#include <cstdlib> | |
#include <algorithm> | |
using namespace std; | |
int a[1000005],n; | |
int b[1000005]; | |
int sol(){ |
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
void dfs(int x, int p){ | |
dfn[x] = low[x] = ++piv; | |
par[x] = p; | |
for(int i=0; i<graph[x].size(); i++){ | |
int w = graph[x][i]; | |
if(w == p) continue; | |
if(!dfn[w]){ | |
dfs(w, x); | |
low[x] = min(low[x], low[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
void dfs(int x, int p){ | |
dfn[x] = low[x] = ++piv; | |
par[x] = p; | |
for(int i=0; i<graph[x].size(); i++){ | |
int w = graph[x][i]; | |
if(w == p) continue; | |
if(!dfn[w]){ | |
dfs(w, x); | |
low[x] = min(low[x], low[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
int low[2505], dfn[2505], par[2505], piv; | |
int cpiv, vis[2505], pcc[2505]; | |
vector<int> bcc[2505]; | |
void dfs(int x, int p){ | |
dfn[x] = low[x] = ++piv; | |
par[x] = p; | |
for(int i=0; i<graph[x].size(); i++){ | |
int w = graph[x][i]; |
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> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <math.h> | |
#include <limits.h> | |
#include <stack> | |
#include <queue> | |
#include <map> | |
#include <set> | |
#include <algorithm> |
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> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <math.h> | |
#include <limits.h> | |
#include <stack> | |
#include <queue> | |
#include <map> | |
#include <set> | |
#include <algorithm> |
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> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <math.h> | |
#include <limits.h> | |
#include <stack> | |
#include <queue> | |
#include <map> | |
#include <set> | |
#include <algorithm> |