結果

問題 No.959 tree and fire
ユーザー iiljj
提出日時 2020-08-07 09:27:48
言語 Ruby
(3.4.1)
結果
RE  
実行時間 -
コード長 218 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 817,408 KB
最終ジャッジ日時 2024-09-22 17:51:03
合計ジャッジ時間 4,267 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other RE * 14 MLE * 1 -- * 39
権限があれば一括ダウンロードができます
コンパイルメッセージ
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