Submission #217788

#TimeUsernameProblemLanguageResultExecution timeMemory
217788VimmerDuathlon (APIO18_duathlon)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define F first #define S second #define sz(x) int(x.size()) #define pb push_back #define N 300005 #define M ll(998244353) using namespace std; typedef long double ld; typedef long long ll; typedef short int si; vector <int> g[51]; bool mk[51]; vector <int> vr; set <int> se; void dostig(int v, int to) { if (mk[v]) return; if (v == to) { for (auto it : vr) se.insert(it); return; } mk[v] = 1; vr.pb(v); bool f = 0; for (auto it : g[v]) dostig(it, to); mk[v] = 0; vr.pop_back(); return f; } int main() { ios_base::sync_with_stdio(0); istream::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, m; cin >> n >> m; for (int i = 0; i < m; i++) { int x, y; cin >> x >> y; g[x].pb(y); g[y].pb(x); } int ans = 0; for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) { if (i == j) continue; se.clear(); dostig(i, j); if (sz(se) != 0) ans += sz(se) - 1; } cout << ans << endl; }

Compilation message (stderr)

count_triplets.cpp: In function 'void dostig(int, int)':
count_triplets.cpp:48:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
     return f;
            ^