結果
問題 |
No.488 四角関係
|
ユーザー |
![]() |
提出日時 | 2017-03-08 04:23:33 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,370 bytes |
コンパイル時間 | 974 ms |
コンパイル使用メモリ | 103,452 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-23 20:51:13 |
合計ジャッジ時間 | 1,874 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 22 |
ソースコード
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<ctime> #include<cctype> #include<climits> #include<iostream> #include<string> #include<vector> #include<map> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<memory> #include<functional> using namespace std; long pow_mod(long x, long y, long mod) { long tmp = 1; x %= mod; if (y > 0) { tmp = pow_mod(x, y / 2, mod); if (y % 2) { tmp = (((tmp * tmp) % mod) * x) % mod; } else { tmp = (tmp * tmp) % mod; } } return tmp; } int main() { cin.tie(0); ios::sync_with_stdio(false); int n, m; cin >> n >> m; int a, b; vector<vector<int>> ab(n,vector<int>(n)); for (int i = 0; i < m; i++) { cin >> a >> b; ab[a][b] = ab[b][a] = 1; } int ans = 0; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { for (int k = 0; k < n; k++) { for (int l = 0; l < n; l++) { int x = ab[i][j] + ab[i][k] + ab[i][l]; int xx = ab[j][i] + ab[j][k] + ab[j][l]; int xxx = ab[k][i] + ab[k][j] + ab[k][l]; int xxxx = ab[l][i] + ab[l][j] + ab[l][k]; if (x == 2 && xx == 2 && xxx == 2 && xxxx == 2) { ans++; } } } } } cout << ans << endl; return 0; }