結果

問題 No.408 五輪ピック
ユーザー 👑 hos.lyrichos.lyric
提出日時 2019-01-26 23:42:51
言語 Ruby
(3.3.0)
結果
AC  
実行時間 294 ms / 5,000 ms
コード長 285 bytes
コンパイル時間 479 ms
コンパイル使用メモリ 11,924 KB
実行使用メモリ 21,252 KB
最終ジャッジ日時 2023-10-19 16:47:39
合計ジャッジ時間 7,064 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
16,092 KB
testcase_01 AC 90 ms
16,092 KB
testcase_02 AC 90 ms
16,092 KB
testcase_03 AC 96 ms
16,092 KB
testcase_04 AC 87 ms
16,092 KB
testcase_05 AC 167 ms
18,052 KB
testcase_06 AC 152 ms
18,340 KB
testcase_07 AC 165 ms
19,344 KB
testcase_08 AC 146 ms
17,560 KB
testcase_09 AC 142 ms
17,844 KB
testcase_10 AC 140 ms
17,936 KB
testcase_11 AC 139 ms
18,064 KB
testcase_12 AC 175 ms
19,472 KB
testcase_13 AC 163 ms
17,924 KB
testcase_14 AC 105 ms
16,468 KB
testcase_15 AC 163 ms
18,324 KB
testcase_16 AC 165 ms
18,448 KB
testcase_17 AC 166 ms
18,596 KB
testcase_18 AC 170 ms
18,392 KB
testcase_19 AC 178 ms
19,688 KB
testcase_20 AC 117 ms
17,276 KB
testcase_21 AC 101 ms
16,544 KB
testcase_22 AC 140 ms
17,920 KB
testcase_23 AC 265 ms
21,252 KB
testcase_24 AC 294 ms
19,748 KB
testcase_25 AC 167 ms
17,788 KB
testcase_26 AC 200 ms
20,664 KB
testcase_27 AC 184 ms
17,788 KB
testcase_28 AC 143 ms
17,464 KB
testcase_29 AC 140 ms
17,516 KB
testcase_30 AC 84 ms
16,092 KB
testcase_31 AC 84 ms
16,092 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|
    [1,u,v,w,x].uniq.size>4
  }}
}}?:YES: :NO
0