Submission #675616

#TimeUsernameProblemLanguageResultExecution timeMemory
675616penguin133Pipes (CEOI15_pipes)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define pi pair<int, int> #define pii pair<int, pi> #define fi first #define se second #define getchar_unlocked _getchar_nolock int ret[100005], dep[100005], vis[100005]; vector<int>v[100005]; int n, m; inline int read() { int v = 0; char ch = getchar_unlocked(); while ((ch & 16) == 0) ch = getchar_unlocked(); while (ch & 16){ v = (v * 10) + (ch & 15); ch = getchar_unlocked(); } return v; } vector<pi>ans; void dfs(int x, int p, int d){ if(vis[x])return; vis[x] = 1; dep[x] = d; ret[x] = dep[x]; bool f = 0; for(auto i : v[x]){ if(i == p && !f){ f = 1; continue; } if(vis[i]){ ret[x] = min(ret[x], dep[i]); continue; } dfs(i, x, d + 1); if(ret[i] > dep[x])cout << i << " " << x << '\n'; ret[x] = min(ret[x], ret[i]); } } int32_t main(){ //ios::sync_with_stdio(0);cin.tie(0); n = read(), m = read(); for(int i=1;i<=m;i++){ int x = read(), y = read(); v[x].push_back(y); v[y].push_back(x); } for(int i=1;i<=n;i++)if(!vis[i])dfs(i, -1, 1); }

Compilation message (stderr)

pipes.cpp: In function 'long long int read()':
pipes.cpp:9:26: error: '_getchar_nolock' was not declared in this scope; did you mean 'getchar_unlocked'?
    9 | #define getchar_unlocked _getchar_nolock
      |                          ^~~~~~~~~~~~~~~
pipes.cpp:18:15: note: in expansion of macro 'getchar_unlocked'
   18 |     char ch = getchar_unlocked();
      |               ^~~~~~~~~~~~~~~~