#include <bits/stdc++.h>
#define fr(i, n, m) for(int i = (n); i < (m); i ++)
#define pb push_back
#define st first
#define nd second
#define pq priority_queue
#define all(x) begin(x), end(x)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
const ll inf = 1e18;
const ld eps = 1e-13;
const ll mod = 1e9+7;
const int i_inf = 1e9;
const int mxn = 1e5;
mt19937 _rand(time(NULL));
clock_t timer = clock();
int n, m;
vector<pii> g[mxn];
int ans[mxn];
int dep[mxn];
bool vis[mxn];
bool bridge[mxn];
void dfs0(int u, int ed){
vis[u] = true;
int mindepth = dep[u];
for(auto e : g[u]){
if(e.nd == ed) continue;
if(!vis[e.st]){
dep[e.st] = dep[u] + 1;
dfs0(e.st, e.nd);
}
mindepth = min(mindepth, dep[e.st]);
}
if(mindepth < dep[u]){
bridge[ed] = true;
dep[u] = mindepth;
}
}
void solve(){
cin >> n >> m;
fr(i, 0, m){
int u, v;
cin >> u >> v;
--u, --v;
if(u == v){
continue;
}
g[u].pb({v, i});
g[v].pb({u, i});
}
fr(i, 0, n){
if(vis[i]) continue;
dfs0(i, -1);
}
fr(i, 0, m){
cout<<"B";
}
cout<<endl;
}
int main(){
solve();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
2688 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
2688 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
2688 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |