Submission #974436

#TimeUsernameProblemLanguageResultExecution timeMemory
974436vjudge1Duathlon (APIO18_duathlon)C++17
Compilation error
0 ms0 KiB
#pragma GCC optimize("O3,Ofast,unroll-loops") #include <bits/stdc++.h> #define lli long long int #define ld long double #define pb push_back #define MP make_pair #define REP(i, n) for(int i = 0; (i) < (n); (i)++) #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() using namespace std; void fastio() { ios_base::sync_with_stdio(false); cin.tie(NULL); } const int N = 55; const int INF = 1e9 + 500; int n, m; array<vector<int>, N> adj; array<int, N> vis inline bool dfs(int node, int l, int t) { if(l == node) return 0; if(node == t) return 1; vis[node] = 1; for(auto c : adj[node]) { if(vis[c]) continue; if(dfs(c, l, t)) { return 1; } } return 0; } void solve() { cin >> n >> m; REP(i, m) { int u, v; cin >> u >> v; adj[u].pb(v); adj[v].pb(u); } int ans = 0; for(int i = 1; i<=n; i++) { for(int j = 1; j <= n; j++) { for(int k = 1; k <= n; k++) { if(i == j || j == k || i == k) continue; bool f = 1; for(int l = 1; l <= n; l++) { if(l == j) continue; fill(vis.begin(), vis.begin() + n + 1, 0); bool x = 0; if(dfs(i, l, j)) x = 1; fill(vis.begin(), vis.begin() + n + 1, 0); if(dfs(k, l, j)) x = 1; if(!x) { f = 0; break; } } ans += f; } } } cout << ans << "\n"; } signed main() { fastio(); solve(); }

Compilation message (stderr)

count_triplets.cpp:24:1: error: expected initializer before 'inline'
   24 | inline bool dfs(int node, int l, int t) {
      | ^~~~~~
count_triplets.cpp: In function 'void solve()':
count_triplets.cpp:53:26: error: 'vis' was not declared in this scope
   53 |                     fill(vis.begin(), vis.begin() + n + 1, 0);
      |                          ^~~
count_triplets.cpp:55:24: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
   55 |                     if(dfs(i, l, j)) x = 1;
      |                        ^~~
      |                        ffs
count_triplets.cpp:57:24: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
   57 |                     if(dfs(k, l, j)) x = 1;
      |                        ^~~
      |                        ffs