結果

問題 No.408 五輪ピック
ユーザー 👑 hos.lyrichos.lyric
提出日時 2019-01-27 00:00:12
言語 Ruby
(3.3.0)
結果
AC  
実行時間 253 ms / 5,000 ms
コード長 248 bytes
コンパイル時間 376 ms
コンパイル使用メモリ 11,968 KB
実行使用メモリ 23,688 KB
最終ジャッジ日時 2023-10-19 20:19:18
合計ジャッジ時間 6,601 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
16,148 KB
testcase_01 AC 85 ms
16,148 KB
testcase_02 AC 85 ms
16,148 KB
testcase_03 AC 86 ms
16,148 KB
testcase_04 AC 85 ms
16,148 KB
testcase_05 AC 201 ms
21,432 KB
testcase_06 AC 161 ms
19,212 KB
testcase_07 AC 187 ms
21,868 KB
testcase_08 AC 168 ms
19,860 KB
testcase_09 AC 166 ms
20,008 KB
testcase_10 AC 152 ms
19,420 KB
testcase_11 AC 150 ms
19,596 KB
testcase_12 AC 202 ms
22,016 KB
testcase_13 AC 198 ms
20,944 KB
testcase_14 AC 110 ms
16,924 KB
testcase_15 AC 200 ms
21,452 KB
testcase_16 AC 208 ms
22,056 KB
testcase_17 AC 208 ms
22,028 KB
testcase_18 AC 211 ms
22,012 KB
testcase_19 AC 220 ms
22,292 KB
testcase_20 AC 124 ms
17,688 KB
testcase_21 AC 106 ms
16,952 KB
testcase_22 AC 142 ms
19,108 KB
testcase_23 AC 228 ms
23,688 KB
testcase_24 AC 253 ms
22,616 KB
testcase_25 AC 202 ms
21,224 KB
testcase_26 AC 226 ms
23,204 KB
testcase_27 AC 211 ms
21,212 KB
testcase_28 AC 162 ms
19,316 KB
testcase_29 AC 159 ms
19,356 KB
testcase_30 AC 86 ms
16,148 KB
testcase_31 AC 88 ms
16,148 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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