結果

問題 No.629 グラフの中に眠る門松列
ユーザー cielciel
提出日時 2018-01-08 19:03:35
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 216 bytes
コンパイル時間 109 ms
コンパイル使用メモリ 11,332 KB
実行使用メモリ 15,572 KB
最終ジャッジ日時 2023-08-25 00:43:01
合計ジャッジ時間 5,394 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,120 KB
testcase_01 AC 84 ms
15,036 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 82 ms
15,292 KB
testcase_07 AC 82 ms
15,352 KB
testcase_08 AC 83 ms
15,124 KB
testcase_09 WA -
testcase_10 AC 82 ms
15,152 KB
testcase_11 AC 82 ms
15,364 KB
testcase_12 WA -
testcase_13 AC 84 ms
15,120 KB
testcase_14 WA -
testcase_15 AC 82 ms
15,140 KB
testcase_16 AC 84 ms
15,192 KB
testcase_17 AC 83 ms
15,028 KB
testcase_18 AC 82 ms
15,248 KB
testcase_19 AC 82 ms
15,036 KB
testcase_20 AC 83 ms
15,160 KB
testcase_21 AC 88 ms
15,140 KB
testcase_22 AC 86 ms
15,248 KB
testcase_23 AC 86 ms
15,364 KB
testcase_24 AC 89 ms
15,488 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 91 ms
15,532 KB
testcase_28 AC 84 ms
15,140 KB
testcase_29 AC 88 ms
15,320 KB
testcase_30 AC 90 ms
15,548 KB
testcase_31 AC 88 ms
15,284 KB
testcase_32 AC 89 ms
15,336 KB
testcase_33 AC 91 ms
15,544 KB
testcase_34 AC 88 ms
15,316 KB
testcase_35 AC 89 ms
15,196 KB
testcase_36 AC 90 ms
15,348 KB
testcase_37 AC 90 ms
15,456 KB
testcase_38 AC 90 ms
15,396 KB
testcase_39 AC 87 ms
15,204 KB
testcase_40 AC 87 ms
15,472 KB
testcase_41 AC 88 ms
15,572 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n
Main.rb:1: warning: assigned but unused variable - m
Syntax OK

ソースコード

diff #

(n,m),a,*q=$<.map{|e|e.split.map &:to_i}
h=Hash.new{|h,k|h[k]=[]}
q.each{|u,v|h[u-1]<<v-1;h[v-1]<<u-1}
puts h.any?{|k,v|
	x=y=0
	v.each{|e|
		x+=1 if a[k]<a[e]
		y+=1 if a[k]>a[e]
	}
	x*~-x/2+y*~-x/2>0
} ? :YES : :NO
0