結果

問題 No.408 五輪ピック
ユーザー 👑 hos.lyrichos.lyric
提出日時 2019-01-26 23:41:47
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 278 bytes
コンパイル時間 40 ms
コンパイル使用メモリ 11,932 KB
実行使用メモリ 20,700 KB
最終ジャッジ日時 2023-10-19 16:42:12
合計ジャッジ時間 6,687 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
16,116 KB
testcase_01 AC 85 ms
16,116 KB
testcase_02 AC 85 ms
16,116 KB
testcase_03 AC 84 ms
16,116 KB
testcase_04 AC 89 ms
16,116 KB
testcase_05 AC 160 ms
17,816 KB
testcase_06 AC 147 ms
18,364 KB
testcase_07 AC 154 ms
19,368 KB
testcase_08 AC 143 ms
17,592 KB
testcase_09 AC 143 ms
17,872 KB
testcase_10 AC 140 ms
17,960 KB
testcase_11 AC 140 ms
18,088 KB
testcase_12 AC 178 ms
19,496 KB
testcase_13 AC 161 ms
17,940 KB
testcase_14 AC 105 ms
16,492 KB
testcase_15 AC 162 ms
18,072 KB
testcase_16 AC 165 ms
18,472 KB
testcase_17 AC 166 ms
18,624 KB
testcase_18 AC 171 ms
18,416 KB
testcase_19 AC 177 ms
19,712 KB
testcase_20 AC 118 ms
17,208 KB
testcase_21 AC 101 ms
16,568 KB
testcase_22 AC 140 ms
17,948 KB
testcase_23 AC 190 ms
20,316 KB
testcase_24 WA -
testcase_25 AC 167 ms
17,812 KB
testcase_26 AC 206 ms
20,700 KB
testcase_27 AC 185 ms
17,812 KB
testcase_28 AC 145 ms
17,528 KB
testcase_29 AC 145 ms
17,528 KB
testcase_30 WA -
testcase_31 AC 86 ms
16,116 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,m=gets.split.map &:to_i
g=(0..n).map{[]}
m.times{
  u,v=gets.split.map &:to_i
  g[u]<<v
  g[v]<<u
}
z=(0..n).map{}
g[1].each{|v|z[v]=1}
l=g.map{|h|h.select{|v|z[v]}.take(3)}
puts (0..n).any?{|u|g[u].any?{|v|
  l[u].any?{|w|l[v].any?{|x|
    w!=x&&w!=v&&x!=u
  }}
}}?:YES: :NO
0