結果

問題 No.488 四角関係
ユーザー tossytossy
提出日時 2017-02-24 22:43:10
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 28 ms / 5,000 ms
コード長 1,049 bytes
コンパイル時間 1,456 ms
コンパイル使用メモリ 164,472 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-30 23:31:37
合計ジャッジ時間 2,470 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
4,376 KB
testcase_01 AC 10 ms
4,384 KB
testcase_02 AC 10 ms
4,376 KB
testcase_03 AC 5 ms
4,376 KB
testcase_04 AC 6 ms
4,376 KB
testcase_05 AC 15 ms
4,380 KB
testcase_06 AC 18 ms
4,376 KB
testcase_07 AC 28 ms
4,376 KB
testcase_08 AC 28 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 4 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 3 ms
4,376 KB
testcase_13 AC 4 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 1 ms
4,380 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define INF 2147483600
#define long long long // for codeforces

int d[50][50];

int main(){
  int n,m;
  cin>>n>>m;
  rep(i,m){
    int a,b;
    cin>>a>>b;
    d[a][b]=1;
    d[b][a]=1;
  }

  int ans=0;
  rep(i,n) rep(j,n) if(i!=j) rep(k,n) if(k!=i && k!=j) rep(l,n) if(l!=i && l!=j && l!=k){
    if(d[i][j]==1 && d[j][k]==1 && d[k][l]==1 && d[l][i]==1
       && d[i][k]==0 && d[j][l]==0) ans++;
  }

  cout << ans/8 << endl;

  return 0;
}
0