結果

問題 No.488 四角関係
ユーザー pluto77pluto77
提出日時 2017-02-27 09:36:56
言語 Python2
(2.7.18)
結果
AC  
実行時間 264 ms / 5,000 ms
コード長 474 bytes
コンパイル時間 64 ms
コンパイル使用メモリ 6,596 KB
実行使用メモリ 6,104 KB
最終ジャッジ日時 2023-09-02 12:38:06
合計ジャッジ時間 2,830 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
5,948 KB
testcase_01 AC 84 ms
5,864 KB
testcase_02 AC 120 ms
6,104 KB
testcase_03 AC 46 ms
5,916 KB
testcase_04 AC 70 ms
6,004 KB
testcase_05 AC 143 ms
6,056 KB
testcase_06 AC 254 ms
5,856 KB
testcase_07 AC 264 ms
5,888 KB
testcase_08 AC 260 ms
5,940 KB
testcase_09 AC 11 ms
6,060 KB
testcase_10 AC 34 ms
6,088 KB
testcase_11 AC 12 ms
5,868 KB
testcase_12 AC 22 ms
5,956 KB
testcase_13 AC 32 ms
6,060 KB
testcase_14 AC 15 ms
5,928 KB
testcase_15 AC 12 ms
6,048 KB
testcase_16 AC 11 ms
6,048 KB
testcase_17 AC 12 ms
5,944 KB
testcase_18 AC 12 ms
5,860 KB
testcase_19 AC 11 ms
5,880 KB
testcase_20 AC 11 ms
5,916 KB
testcase_21 AC 11 ms
5,860 KB
testcase_22 AC 11 ms
6,000 KB
testcase_23 AC 11 ms
5,988 KB
testcase_24 AC 11 ms
5,852 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki_488

n,m=map(int,raw_input().split())
ls=[[0 for i in xrange(51)] for j in xrange(51)]
for i in xrange(m):
 a,b=map(int,raw_input().split())
 ls[a][b]=ls[b][a]=1
res=0
for i in xrange(n):
 for j in xrange(i+1,n):
  for k in xrange(j+1,n):
   for l in xrange(k+1,n):
    x1=ls[i][j]+ls[i][k]+ls[i][l]
    x2=ls[j][k]+ls[j][l]+ls[j][i]
    x3=ls[k][l]+ls[k][i]+ls[k][j]
    x4=ls[l][i]+ls[l][j]+ls[l][k]
    if x1==2 and x2==2 and x3==2 and x4==2:
     res+=1
print res
0