結果

問題 No.488 四角関係
ユーザー kotatsugamekotatsugame
提出日時 2017-10-09 07:40:10
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 33 ms / 5,000 ms
コード長 359 bytes
コンパイル時間 1,320 ms
コンパイル使用メモリ 64,632 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-28 13:59:05
合計ジャッジ時間 1,675 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,816 KB
testcase_01 AC 11 ms
6,940 KB
testcase_02 AC 13 ms
6,944 KB
testcase_03 AC 6 ms
6,944 KB
testcase_04 AC 8 ms
6,944 KB
testcase_05 AC 18 ms
6,940 KB
testcase_06 AC 23 ms
6,944 KB
testcase_07 AC 33 ms
6,940 KB
testcase_08 AC 32 ms
6,940 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 5 ms
6,940 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 4 ms
6,940 KB
testcase_13 AC 4 ms
6,940 KB
testcase_14 AC 2 ms
6,940 KB
testcase_15 AC 2 ms
6,940 KB
testcase_16 AC 2 ms
6,944 KB
testcase_17 AC 2 ms
6,944 KB
testcase_18 AC 2 ms
6,940 KB
testcase_19 AC 2 ms
6,944 KB
testcase_20 AC 2 ms
6,940 KB
testcase_21 AC 2 ms
6,940 KB
testcase_22 AC 2 ms
6,940 KB
testcase_23 AC 2 ms
6,940 KB
testcase_24 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
int G[50][50],n,m,cnt;
main()
{
	cin>>n>>m;
	for(int i=0;i<m;i++)
	{
		int a,b;cin>>a>>b;G[a][b]=G[b][a]=1;
	}
	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++)
	{
		cnt+=i!=j&&i!=k&&i!=l&&j!=k&&j!=l&&k!=l&&G[i][j]&&G[j][k]&&G[k][l]&&G[l][i]&&!G[i][k]&&!G[j][l];
	}
	cout<<cnt/8<<endl;
}
0