結果
問題 | No.488 四角関係 |
ユーザー |
![]() |
提出日時 | 2017-08-05 11:40:16 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 889 ms / 5,000 ms |
コード長 | 656 bytes |
コンパイル時間 | 1,591 ms |
コンパイル使用メモリ | 163,712 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-11 20:34:53 |
合計ジャッジ時間 | 25,353 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
#include <bits/stdc++.h> #define FOR(i,bg,ed) for(ll i=(bg);i<(ed);i++) #define REP(i,n) FOR(i,0,n) #define MOD 1000000007 #define int long long using namespace std; typedef long long ll; typedef vector<vector<ll>> mat; const int INF = 1e9; signed main() { int N, M; int a, b; int g[55][55] = {}; cin >> N >> M; REP(i,M) { cin >> a >> b; g[a][b] = g[b][a] = 1; } int ans = 0; REP(i,50) REP(j,50) REP(k,50) REP(l,50) { if ((set<int>{i, j, k, l}).size() == 4 && g[i][j] && g[j][k] && g[k][l] && g[l][i] && !g[i][k] && !g[j][l]) { ans++; } } cout << ans / 8 << endl; }