結果

問題 No.1147 土偶Ⅱ
ユーザー iiljjiiljj
提出日時 2020-08-07 09:41:14
言語 Ruby
(3.3.0)
結果
AC  
実行時間 223 ms / 500 ms
コード長 188 bytes
コンパイル時間 47 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 13,440 KB
最終ジャッジ日時 2024-04-19 18:05:53
合計ジャッジ時間 3,567 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
13,056 KB
testcase_01 AC 95 ms
13,056 KB
testcase_02 AC 96 ms
13,184 KB
testcase_03 AC 99 ms
12,928 KB
testcase_04 AC 105 ms
13,440 KB
testcase_05 AC 97 ms
13,056 KB
testcase_06 AC 131 ms
13,312 KB
testcase_07 AC 168 ms
13,312 KB
testcase_08 AC 95 ms
13,184 KB
testcase_09 AC 126 ms
13,440 KB
testcase_10 AC 105 ms
13,312 KB
testcase_11 AC 223 ms
13,440 KB
testcase_12 AC 128 ms
13,312 KB
testcase_13 AC 100 ms
13,312 KB
testcase_14 AC 198 ms
13,184 KB
testcase_15 AC 129 ms
13,440 KB
testcase_16 AC 105 ms
13,312 KB
testcase_17 AC 94 ms
12,928 KB
testcase_18 AC 95 ms
13,056 KB
testcase_19 AC 133 ms
13,312 KB
testcase_20 AC 94 ms
13,056 KB
testcase_21 AC 90 ms
12,928 KB
testcase_22 AC 115 ms
13,440 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require'matrix'
f=->{gets.split.map &:to_i}
n,m=f[]
x=Matrix.zero n
m.times{a,b=f[];x[a-1,b-1]=x[b-1,a-1]=1}
x=x**2-x*n
p [*0..n-1].combination(3).count{x[_1,_2]<1&&x[_2,_3]<1&&x[_3,_1]<1}
0