結果

問題 No.408 五輪ピック
ユーザー 👑 hos.lyrichos.lyric
提出日時 2019-01-26 23:58:52
言語 Ruby
(3.3.0)
結果
AC  
実行時間 291 ms / 5,000 ms
コード長 251 bytes
コンパイル時間 70 ms
コンパイル使用メモリ 11,876 KB
実行使用メモリ 21,776 KB
最終ジャッジ日時 2023-10-19 20:18:33
合計ジャッジ時間 6,615 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
16,060 KB
testcase_01 AC 85 ms
16,060 KB
testcase_02 AC 85 ms
16,060 KB
testcase_03 AC 85 ms
16,060 KB
testcase_04 AC 89 ms
16,060 KB
testcase_05 AC 166 ms
18,024 KB
testcase_06 AC 147 ms
18,156 KB
testcase_07 AC 159 ms
19,192 KB
testcase_08 AC 145 ms
17,508 KB
testcase_09 AC 146 ms
17,764 KB
testcase_10 AC 143 ms
17,800 KB
testcase_11 AC 140 ms
17,948 KB
testcase_12 AC 181 ms
19,328 KB
testcase_13 AC 165 ms
17,876 KB
testcase_14 AC 106 ms
16,436 KB
testcase_15 AC 169 ms
18,308 KB
testcase_16 AC 172 ms
18,408 KB
testcase_17 AC 174 ms
18,528 KB
testcase_18 AC 179 ms
18,292 KB
testcase_19 AC 182 ms
19,552 KB
testcase_20 AC 116 ms
17,056 KB
testcase_21 AC 102 ms
16,512 KB
testcase_22 AC 141 ms
17,640 KB
testcase_23 AC 278 ms
21,776 KB
testcase_24 AC 291 ms
20,268 KB
testcase_25 AC 171 ms
17,756 KB
testcase_26 AC 209 ms
20,472 KB
testcase_27 AC 193 ms
17,756 KB
testcase_28 AC 152 ms
17,760 KB
testcase_29 AC 148 ms
17,844 KB
testcase_30 AC 92 ms
16,060 KB
testcase_31 AC 87 ms
16,060 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={}
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