結果

問題 No.1147 土偶Ⅱ
ユーザー %20%20
提出日時 2020-08-07 11:51:52
言語 Ruby
(3.3.0)
結果
AC  
実行時間 244 ms / 500 ms
コード長 162 bytes
コンパイル時間 465 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 13,568 KB
最終ジャッジ日時 2024-04-19 18:06:09
合計ジャッジ時間 4,663 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
12,928 KB
testcase_01 AC 90 ms
12,928 KB
testcase_02 AC 93 ms
13,056 KB
testcase_03 AC 90 ms
13,184 KB
testcase_04 AC 106 ms
13,312 KB
testcase_05 AC 91 ms
12,928 KB
testcase_06 AC 126 ms
13,568 KB
testcase_07 AC 178 ms
13,184 KB
testcase_08 AC 93 ms
13,056 KB
testcase_09 AC 116 ms
13,184 KB
testcase_10 AC 104 ms
13,312 KB
testcase_11 AC 244 ms
13,440 KB
testcase_12 AC 134 ms
13,312 KB
testcase_13 AC 102 ms
13,312 KB
testcase_14 AC 214 ms
13,440 KB
testcase_15 AC 132 ms
13,440 KB
testcase_16 AC 104 ms
13,440 KB
testcase_17 AC 95 ms
12,928 KB
testcase_18 AC 94 ms
13,056 KB
testcase_19 AC 136 ms
13,312 KB
testcase_20 AC 92 ms
12,928 KB
testcase_21 AC 90 ms
13,056 KB
testcase_22 AC 114 ms
13,312 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#!ruby -nrmatrix
x=Matrix.zero 1+n=$_.to_i
$<.map{x[*(a,b=_1.split.map &:to_i)]=x[b,a]=1}
x=x*x-x*n
p [*1..n].combination(3).count{|e|i=3;e.all?{x[_1,e[i-=2]]<1}}
0