제출 #516852

#제출 시각아이디문제언어결과실행 시간메모리
516852shmad철인 이종 경기 (APIO18_duathlon)C++17
0 / 100
3 ms588 KiB
#pragma GCC optimize("O3", "unroll-loops") #pragma GCC target("avx2", "bmi", "bmi2", "lzcnt", "popcnt") #include <bits/stdc++.h> #define int long long #define vt vector #define pb push_back #define all(x) (x).begin(), (x).end() #define sz(x) (int)(x).size() #define ff first #define ss second #define dbg(x) cerr << #x << " = " << x << '\n' using namespace std; using ll = long long; using pii = pair<int, int>; using vvi = vt< vt<int> >; const int N = 1e6 + 5, mod = 1e9 + 7, inf = 1e18 + 7, B = 500, LIM = (1ll << 60); const double eps = 1e-6; vt<int> g[100], used(100); bool ok; void dfs (int v, int s, int c, int f, bool check = 0) { used[v] = 1; if (v == f) { ok |= check; return; } if (v == c) check = 1; for (auto to: g[v]) { if (!used[to]) { if (to == f && !check) continue; dfs(to, s, c, f, check); used[to] = 0; } } } void solve () { int n, m; cin >> n >> m; for (int i = 1; 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++) { for (int k = 1; k <= n; k++) { if (i == j || i == k || j == k) continue; ok = 0; fill(all(used), 0); dfs(i, i, j, k); if (ok) ans++; } } } cout << ans; cout << '\n'; } bool testcases = 0; signed main() { #ifndef ONLINE_JUDGE freopen(".in", "r", stdin); freopen(".out", "w", stdout); #endif cin.tie(0) -> sync_with_stdio(0); int test = 1; if (testcases) cin >> test; for (int cs = 1; cs <= test; cs++) { solve(); } }

컴파일 시 표준 에러 (stderr) 메시지

count_triplets.cpp: In function 'int main()':
count_triplets.cpp:71:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   71 |  freopen(".in", "r", stdin);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~
count_triplets.cpp:72:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   72 |  freopen(".out", "w", stdout);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...