結果

問題 No.1147 土偶Ⅱ
ユーザー iiljjiiljj
提出日時 2020-08-07 03:13:24
言語 Ruby
(3.3.0)
結果
AC  
実行時間 257 ms / 500 ms
コード長 224 bytes
コンパイル時間 40 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 13,568 KB
最終ジャッジ日時 2024-04-27 10:32:57
合計ジャッジ時間 4,449 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
13,184 KB
testcase_01 AC 108 ms
13,184 KB
testcase_02 AC 109 ms
13,184 KB
testcase_03 AC 110 ms
13,056 KB
testcase_04 AC 122 ms
13,440 KB
testcase_05 AC 111 ms
13,056 KB
testcase_06 AC 145 ms
13,312 KB
testcase_07 AC 197 ms
13,440 KB
testcase_08 AC 111 ms
13,440 KB
testcase_09 AC 136 ms
13,568 KB
testcase_10 AC 122 ms
13,568 KB
testcase_11 AC 257 ms
13,312 KB
testcase_12 AC 150 ms
13,568 KB
testcase_13 AC 118 ms
13,184 KB
testcase_14 AC 229 ms
13,312 KB
testcase_15 AC 148 ms
13,440 KB
testcase_16 AC 121 ms
13,440 KB
testcase_17 AC 106 ms
13,056 KB
testcase_18 AC 109 ms
13,312 KB
testcase_19 AC 155 ms
13,312 KB
testcase_20 AC 106 ms
13,056 KB
testcase_21 AC 107 ms
13,056 KB
testcase_22 AC 136 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=(Matrix.build(n){1}-x).hadamard_product x**2
p [*0..n-1].combination(3).count{x[_1,_2]<1&&x[_2,_3]<1&&x[_3,_1]<1}
0