結果

問題 No.408 五輪ピック
ユーザー 👑 hos.lyrichos.lyric
提出日時 2019-01-26 23:45:00
言語 Ruby
(3.3.0)
結果
AC  
実行時間 296 ms / 5,000 ms
コード長 258 bytes
コンパイル時間 124 ms
コンパイル使用メモリ 11,940 KB
実行使用メモリ 21,260 KB
最終ジャッジ日時 2023-10-19 16:53:36
合計ジャッジ時間 6,379 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
16,092 KB
testcase_01 AC 89 ms
16,092 KB
testcase_02 AC 90 ms
16,092 KB
testcase_03 AC 88 ms
16,092 KB
testcase_04 AC 89 ms
16,088 KB
testcase_05 AC 168 ms
18,056 KB
testcase_06 AC 150 ms
18,344 KB
testcase_07 AC 160 ms
19,344 KB
testcase_08 AC 148 ms
17,564 KB
testcase_09 AC 144 ms
17,844 KB
testcase_10 AC 146 ms
17,936 KB
testcase_11 AC 142 ms
18,068 KB
testcase_12 AC 184 ms
19,472 KB
testcase_13 AC 165 ms
17,920 KB
testcase_14 AC 109 ms
16,468 KB
testcase_15 AC 168 ms
18,352 KB
testcase_16 AC 172 ms
18,448 KB
testcase_17 AC 172 ms
18,596 KB
testcase_18 AC 176 ms
18,388 KB
testcase_19 AC 188 ms
19,684 KB
testcase_20 AC 121 ms
17,184 KB
testcase_21 AC 105 ms
16,540 KB
testcase_22 AC 144 ms
17,920 KB
testcase_23 AC 272 ms
21,260 KB
testcase_24 AC 296 ms
19,748 KB
testcase_25 AC 176 ms
17,788 KB
testcase_26 AC 211 ms
20,664 KB
testcase_27 AC 188 ms
17,788 KB
testcase_28 AC 147 ms
17,504 KB
testcase_29 AC 151 ms
17,504 KB
testcase_30 AC 89 ms
16,092 KB
testcase_31 AC 90 ms
16,092 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,m=gets.split.map &:to_i
r=(0..n)
g=r.map{[]}
m.times{u,v=gets.split.map &:to_i;g[u]<<v;g[v]<<u}
z=r.map{}
g[1].each{|v|z[v]=1}
l=g.map{|h|h.select{|v|z[v]}.take(3)}
puts r.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