結果
問題 |
No.488 四角関係
|
ユーザー |
|
提出日時 | 2025-02-25 22:52:07 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 21 ms / 5,000 ms |
コード長 | 1,053 bytes |
コンパイル時間 | 1,671 ms |
コンパイル使用メモリ | 161,644 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2025-02-25 22:52:10 |
合計ジャッジ時間 | 2,819 ms |
ジャッジサーバーID (参考情報) |
judge7 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:16:11: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 16 | scanf ("%d%d", &n, &m); | ~~~~~~^~~~~~~~~~~~~~~~ main.cpp:19:25: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 19 | int u, v; scanf ("%d%d", &u, &v); | ~~~~~~^~~~~~~~~~~~~~~~
ソースコード
# include <bits/stdc++.h> using namespace std; typedef long long ll; // # define int long long # define lc u << 1 # define rc u << 1 | 1 # define fi first # define se second const int N = 55, M = N * N; int n, m; int g[N][N]; signed main () { // freopen ("rec.in", "r", stdin); freopen ("rec.out", "w", stdout); scanf ("%d%d", &n, &m); for (int a = 1; a <= m; a ++ ) { int u, v; scanf ("%d%d", &u, &v); g[u][v] = g[v][u] = 1; } int ans = 0; for (int a = 0; a < n; a ++ ) { for (int b = 0; b < n; b ++ ) { if (a == b) continue; for (int c = 0; c < n; c ++ ) { if (c == a || c == b) continue; for (int d = 0; d < n; d ++ ) { if (d == a || d == b || d == c) continue; if (g[a][b] && g[b][c] && g[c][d] && g[d][a] && !g[a][c] && !g[b][d]) ans ++ ; } } } } printf ("%d\n", ans / 8); return 0; }