#include #include #include using namespace std; typedef long long ll; int main() { ll n, m; cin >> n >> m; n--; ll brojac2 = 0; ll brojac1 = 0; brojac1 += n; brojac1 += n - 1; ll i = 2; while (i * i <= n) { ll a = sqrt(n); ll kk = n/i; ll gg = a/i; ll cc = 2*(kk - (i - 2) - 1); cc--; brojac1 += cc; i++; } brojac2 += m; brojac2 += m - 1; i = 2; while (i * i <= m) { ll a = sqrt(m); ll kk = m/i; ll gg = a/i; ll cc = 2*(kk - (i - 2) - 1); cc--; brojac2 += cc; i++; } cout< #include #include using namespace std; typedef long long ll; int totalBridges = 0; int totalComponents = 0; vector low; vector dfs_num; vector parent; int N, M; vector graf[int(1e5)+10]; vector articulation_map; vector ap; vector bridges[int(1e5)+10]; void articulation_points(int u){ static int dfs_num_cnt = 0; low[u] = dfs_num[u] = ++dfs_num_cnt; int children = 0; for(int i=0;i 1) { articulation_map[u] = true; } else if (parent[u] != -1 && low[v] >= dfs_num[u]) { articulation_map[u] = true; } if (low[v] > dfs_num[u]) { bridges.push_back({u, v}); } } else if (v != parent[u]) { low[u] = min(low[u], dfs_num[v]); } } } void bridg_find(){ for(int i=0;i> a >> b; graf[a].push_back(b); graf[b].push_back(a); } low.assign(N,-1); dfs_num.assign(N,-1); parent.assign(N, -1); articulation_map.assign(N, false); for(int i = 0;i> N >> M; cin >> Q; bridg_find(); cout << totalComponents; for(int i=0;i> c; int sum = 0; for(int k=0;k> j; if(articulation_map[j]){ sum++; } } cout << totalComponents - sum << endl; sum = 0; } return 0; } */