結果

問題 No.408 五輪ピック
ユーザー 👑 hos.lyrichos.lyric
提出日時 2019-01-26 23:46:16
言語 Ruby
(3.3.0)
結果
AC  
実行時間 286 ms / 5,000 ms
コード長 256 bytes
コンパイル時間 40 ms
コンパイル使用メモリ 11,932 KB
実行使用メモリ 21,280 KB
最終ジャッジ日時 2023-10-19 16:57:08
合計ジャッジ時間 6,084 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
16,116 KB
testcase_01 AC 85 ms
16,116 KB
testcase_02 AC 85 ms
16,116 KB
testcase_03 AC 85 ms
16,116 KB
testcase_04 AC 84 ms
16,116 KB
testcase_05 AC 164 ms
18,080 KB
testcase_06 AC 146 ms
18,368 KB
testcase_07 AC 154 ms
19,368 KB
testcase_08 AC 140 ms
17,588 KB
testcase_09 AC 141 ms
17,872 KB
testcase_10 AC 139 ms
17,960 KB
testcase_11 AC 136 ms
18,092 KB
testcase_12 AC 173 ms
19,496 KB
testcase_13 AC 162 ms
17,944 KB
testcase_14 AC 104 ms
16,492 KB
testcase_15 AC 161 ms
18,376 KB
testcase_16 AC 166 ms
18,476 KB
testcase_17 AC 167 ms
18,620 KB
testcase_18 AC 170 ms
18,412 KB
testcase_19 AC 177 ms
19,708 KB
testcase_20 AC 114 ms
17,208 KB
testcase_21 AC 101 ms
16,568 KB
testcase_22 AC 137 ms
17,944 KB
testcase_23 AC 263 ms
21,280 KB
testcase_24 AC 286 ms
19,772 KB
testcase_25 AC 165 ms
17,812 KB
testcase_26 AC 197 ms
20,688 KB
testcase_27 AC 181 ms
17,812 KB
testcase_28 AC 142 ms
17,528 KB
testcase_29 AC 145 ms
17,528 KB
testcase_30 AC 83 ms
16,116 KB
testcase_31 AC 94 ms
16,116 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