結果

問題 No.1147 土偶Ⅱ
ユーザー %20%20
提出日時 2020-08-07 10:41:54
言語 Ruby
(3.3.0)
結果
AC  
実行時間 225 ms / 500 ms
コード長 166 bytes
コンパイル時間 186 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 13,440 KB
最終ジャッジ日時 2024-04-19 18:06:04
合計ジャッジ時間 3,709 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
13,184 KB
testcase_01 AC 95 ms
13,056 KB
testcase_02 AC 95 ms
12,928 KB
testcase_03 AC 93 ms
13,184 KB
testcase_04 AC 108 ms
13,440 KB
testcase_05 AC 94 ms
12,928 KB
testcase_06 AC 125 ms
13,440 KB
testcase_07 AC 174 ms
13,312 KB
testcase_08 AC 98 ms
13,312 KB
testcase_09 AC 123 ms
13,440 KB
testcase_10 AC 107 ms
13,440 KB
testcase_11 AC 225 ms
13,440 KB
testcase_12 AC 131 ms
13,184 KB
testcase_13 AC 101 ms
13,312 KB
testcase_14 AC 202 ms
13,440 KB
testcase_15 AC 143 ms
13,312 KB
testcase_16 AC 103 ms
13,440 KB
testcase_17 AC 91 ms
13,184 KB
testcase_18 AC 99 ms
13,312 KB
testcase_19 AC 140 ms
13,440 KB
testcase_20 AC 92 ms
13,056 KB
testcase_21 AC 91 ms
13,056 KB
testcase_22 AC 113 ms
13,440 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{x[_1,_2]<1&&x[_2,_3]<1&&x[_3,_1]<1}
0