結果

問題 No.1147 土偶Ⅱ
ユーザー iiljjiiljj
提出日時 2020-08-07 09:28:33
言語 Ruby
(3.3.0)
結果
AC  
実行時間 282 ms / 500 ms
コード長 218 bytes
コンパイル時間 199 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 13,440 KB
最終ジャッジ日時 2024-04-19 18:05:42
合計ジャッジ時間 4,469 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
12,928 KB
testcase_01 AC 100 ms
12,800 KB
testcase_02 AC 100 ms
12,800 KB
testcase_03 AC 94 ms
12,800 KB
testcase_04 AC 120 ms
13,312 KB
testcase_05 AC 109 ms
13,056 KB
testcase_06 AC 154 ms
13,184 KB
testcase_07 AC 218 ms
13,184 KB
testcase_08 AC 116 ms
13,056 KB
testcase_09 AC 143 ms
13,440 KB
testcase_10 AC 127 ms
13,056 KB
testcase_11 AC 282 ms
12,928 KB
testcase_12 AC 162 ms
13,184 KB
testcase_13 AC 123 ms
13,184 KB
testcase_14 AC 245 ms
13,056 KB
testcase_15 AC 157 ms
13,440 KB
testcase_16 AC 124 ms
13,056 KB
testcase_17 AC 107 ms
12,928 KB
testcase_18 AC 110 ms
12,928 KB
testcase_19 AC 161 ms
13,312 KB
testcase_20 AC 108 ms
12,928 KB
testcase_21 AC 105 ms
12,800 KB
testcase_22 AC 130 ms
13,184 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=(Matrix.build(n){1}-x).hadamard_product x**2
p [*0..n-1].combination(3).count{x[_1,_2]+x[_2,_3]+x[_3,_1]<1}
0