CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 18:31:35 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=fa12d579643d8dfa42ec30ff288fbc2ced2b74d88191825507ab0f71dad08dd9a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%2201pIC1WWVTBe-CfaJAYUtmr8VjPIGCvs%22%3B%7D; HttpOnly; Path=/
cf-ray: 98d06f6eab42f473-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
-
✅⭐ Make huge profits on trading ⭐⭐ W
JavaScript | 6 sec ago | 0.24 KB
-
⭐✅ Jack's Profit Method ✅ NEVER SEEN BEF...
JavaScript | 8 sec ago | 0.24 KB
-
⭐⭐⭐Make $15OO in 2O minutesV E⭐⭐
Java | 11 sec ago | 0.10 KB
-
⭐⭐Exchange Exploit⭐⭐ 9
JavaScript | 12 sec ago | 0.24 KB
-
⭐✅ Marketplace Glitch ✅ Working ✅ NEVER SEEN...
JavaScript | 16 sec ago | 0.24 KB
-
⭐✅ Online Marketplace Exploit ✅ NEVER SEEN BE...
JavaScript | 17 sec ago | 0.24 KB
-
✅⭐ Make huge profits on trading ⭐⭐ 6
JavaScript | 22 sec ago | 0.24 KB
-
⭐⭐⭐Make $1500 in 20 minutes⭐⭐
Java | 22 sec ago | 0.10 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