CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 06:14:25 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=261a93059910c8700cbf3f48eb6cb769abfd667d12547bba038bf1c05317a505a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%222lWOX2qV_XeD3OIxLeo-j7heuTJ86zLz%22%3B%7D; HttpOnly; Path=/
cf-ray: 98cc3795da198087-BLR
#include<iostream>#include<vector>#include<algorithm>#include<set>#inclu - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<vector>
- #include<algorithm>
- #include<set>
- #include<map>
- #include<fstream>
- using namespace std;
- const int maxn = 300113;
- vector<int> gr[maxn];
- bool used[maxn];
- int tin[maxn];
- int fup[maxn];
- int times = 0;
- map<pair<int, int>, int> d;
- map<pair<int, int>, int> kratnrebro;
- vector<pair<int, int>> qw;
- ifstream in("bridges.in");
- ofstream out("bridges.out");
- #define mp make_pair
- //#define in cin
- //#define out cout
- void dfs(int v, int p = -1)
- {
- used[v] = 1;
- tin[v] = fup[v] = times++;
- for (int i = 0; i < gr[v].size(); i++)
- {
- int to = gr[v][i];
- if (to == p) continue;
- if (used[to])
- {
- fup[v] = min(fup[v], tin[to]);
- }
- else
- {
- dfs(to, v);
- fup[v] = min(fup[v], fup[to]);
- if (fup[to] > tin[v] && kratnrebro[mp(v, to)] == 1)
- {
- pair<int, int> outr = mp(v, to);
- qw.push_back(outr);
- }
- }
- }
- }
- int main()
- {
- int n, m;
- in >> n >> m;
- int ap, bp;
- for (int i = 0; i < m; i++)
- {
- in >> ap >> bp;
- gr[ap].push_back(bp);
- gr[bp].push_back(ap);
- d[mp(ap, bp)] = i + 1;
- d[mp(bp, ap)] = i + 1;
- kratnrebro[mp(ap, bp)] += 1;
- kratnrebro[mp(bp, ap)] += 1;
- }
- for (int i = 1; i <= n; i++)
- {
- if (!used[i])
- {
- dfs(i);
- }
- }
- out << qw.size() << endl;
- for (int i = 0; i < qw.size(); i++)
- {
- out << d[mp(qw[i].first, qw[i].second)] << " ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐✅ Trading Profit Method ✅ NEVER SEEN BEFORE...
JavaScript | 1 sec ago | 0.24 KB
-
⭐ Instant BTC Profit Method ✅ NEVER SEEN BEFO...
JavaScript | 10 sec ago | 0.24 KB
-
⭐✅ MAKE $2000 INSTANTLY ✅ NEVER SEEN BEFORE ⭐...
JavaScript | 20 sec ago | 0.24 KB
-
⭐ Free Crypto Method ✅ NEVER SEEN BEFORE ⭐⭐⭐
JavaScript | 31 sec ago | 0.24 KB
-
✅⭐ Make huge profits on trading ✅ NEVER SEEN...
JavaScript | 42 sec ago | 0.24 KB
-
⭐✅ Marketplace Glitch ✅ Working ✅ NEVER SEEN...
JavaScript | 51 sec ago | 0.24 KB
-
✅⭐ Make $2500 in 15 minutes ✅ NEVER SEEN BEFO...
JavaScript | 1 min ago | 0.24 KB
-
⭐ Instant BTC Profit Method ✅ NEVER SEEN BEFO...
JavaScript | 1 min ago | 0.24 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand