結果
問題 | No.488 四角関係 |
ユーザー |
![]() |
提出日時 | 2017-02-24 23:14:14 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 24 ms / 5,000 ms |
コード長 | 579 bytes |
コンパイル時間 | 733 ms |
コンパイル使用メモリ | 66,500 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2025-01-02 23:50:53 |
合計ジャッジ時間 | 2,058 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
#include <iostream>#include <vector>#include <algorithm>#include <string>#include <queue>using namespace std;#define rep(i,n) for(int i=0;i<n;i++)bool E[50][50];int main(){int n, m; cin >> n >> m;for (int i = 0; i < m; i++) {int a, b; cin >> a >> b;E[a][b] = true;E[b][a] = true;}int ans = 0;rep(a, n)rep(b, n){rep(c, n)rep(d, n) {if (a == b || a == c || a == d || b == c || b == d || c == d)continue;if (E[a][b] && E[a][d] && E[c][b] && E[c][d] && !E[a][c] && !E[b][d]) {ans++;}}}cout << ans/8 << endl;return 0;}