結果
問題 | No.488 四角関係 |
ユーザー |
|
提出日時 | 2017-06-16 08:02:40 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 988 bytes |
コンパイル時間 | 689 ms |
コンパイル使用メモリ | 82,772 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-01 06:32:15 |
合計ジャッジ時間 | 1,628 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
#define _USE_MATH_DEFINES #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<string> #include<iostream> #include<cctype> #include<cstdio> #include<vector> #include<stack> #include<queue> #include <algorithm> #include<math.h> #include<set> #include<map> #include <sstream> #include<iomanip> //#include<bits/stdc++.h> using namespace std; int f[55][55]; int main() { int n, m; cin >> n >> m; for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; //a--; b--; f[a][b] = 1; f[b][a] = 1; } int y = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { for (int k = j + 1; k < n; k++) { for (int h = k + 1; h < n; h++) { int a, b, c, d; a = f[i][j] + f[i][k] + f[i][h]; b = f[j][i] + f[j][k] + f[j][h]; c = f[k][j] + f[k][i] + f[k][h]; d = f[h][j] + f[h][k] + f[h][i]; //cout << a << b << c << d << endl; if (a == 2 && b == 2 && c == 2 && d == 2)y++; } } } } cout << y << endl; return 0; }