結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,180 KB
testcase_01 WA -
testcase_02 AC 81 ms
15,176 KB
testcase_03 AC 83 ms
15,152 KB
testcase_04 AC 79 ms
15,268 KB
testcase_05 AC 81 ms
15,344 KB
testcase_06 AC 79 ms
15,176 KB
testcase_07 AC 80 ms
15,152 KB
testcase_08 AC 79 ms
15,328 KB
testcase_09 AC 79 ms
15,344 KB
testcase_10 AC 81 ms
15,348 KB
testcase_11 AC 79 ms
15,180 KB
testcase_12 AC 78 ms
15,252 KB
testcase_13 AC 80 ms
15,148 KB
testcase_14 WA -
testcase_15 AC 81 ms
15,020 KB
testcase_16 AC 82 ms
15,112 KB
testcase_17 AC 82 ms
15,072 KB
testcase_18 AC 80 ms
15,020 KB
testcase_19 AC 77 ms
15,344 KB
testcase_20 AC 79 ms
15,148 KB
testcase_21 WA -
testcase_22 AC 82 ms
15,168 KB
testcase_23 AC 85 ms
15,180 KB
testcase_24 AC 86 ms
15,284 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 90 ms
15,328 KB
testcase_28 WA -
testcase_29 AC 85 ms
15,240 KB
testcase_30 AC 86 ms
15,424 KB
testcase_31 AC 87 ms
15,348 KB
testcase_32 AC 88 ms
15,400 KB
testcase_33 WA -
testcase_34 AC 86 ms
15,412 KB
testcase_35 AC 86 ms
15,280 KB
testcase_36 AC 87 ms
15,384 KB
testcase_37 WA -
testcase_38 AC 84 ms
15,380 KB
testcase_39 AC 82 ms
15,180 KB
testcase_40 WA -
testcase_41 AC 83 ms
15,508 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|
	h0=Hash.new 0
	h1=Hash.new 0
	v.each{|e|
		h0[e]+=1 if a[k]<a[e]
		h1[e]+=1 if a[k]>a[e]
	}
	h0.size>1||h1.size>1
} ? :YES : :NO
0