結果
問題 | No.488 四角関係 |
ユーザー |
![]() |
提出日時 | 2025-02-22 21:24:58 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 31 ms / 5,000 ms |
コード長 | 597 bytes |
コンパイル時間 | 1,262 ms |
コンパイル使用メモリ | 161,816 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-02-22 21:25:01 |
合計ジャッジ時間 | 2,479 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
#include<bits/stdc++.h>const int N=60; bool g[N][N];int main() {//freopen("rec.in","r",stdin);//freopen("rec.out","w",stdout);std::ios::sync_with_stdio(false),std::cin.tie(nullptr);int n,m,u,v,cnt=0; std::cin>>n>>m;while(m--) std::cin>>u>>v,g[u][v]=g[v][u]=true;for(int a=0;a<n;a++)for(int b=0;b<n;b++)for(int c=0;c<n;c++)for(int d=0;d<n;d++)if(a!=b&&a!=c&&a!=d&&b!=c&&b!=d&&c!=d&&g[a][b]&&g[b][c]&&g[c][d]&&g[d][a]&&!g[a][c]&&!g[b][d])cnt++;std::cout<<cnt/8;return 0;}