結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,168 KB
testcase_01 WA -
testcase_02 AC 81 ms
15,040 KB
testcase_03 AC 79 ms
15,136 KB
testcase_04 AC 79 ms
15,284 KB
testcase_05 AC 79 ms
15,076 KB
testcase_06 AC 79 ms
15,284 KB
testcase_07 AC 82 ms
15,248 KB
testcase_08 AC 80 ms
15,212 KB
testcase_09 AC 79 ms
15,296 KB
testcase_10 AC 82 ms
15,176 KB
testcase_11 AC 79 ms
15,216 KB
testcase_12 AC 79 ms
15,220 KB
testcase_13 AC 81 ms
15,176 KB
testcase_14 WA -
testcase_15 AC 79 ms
14,988 KB
testcase_16 AC 80 ms
15,304 KB
testcase_17 AC 82 ms
15,132 KB
testcase_18 AC 80 ms
15,312 KB
testcase_19 AC 81 ms
15,260 KB
testcase_20 AC 79 ms
15,300 KB
testcase_21 WA -
testcase_22 AC 82 ms
15,304 KB
testcase_23 AC 83 ms
15,144 KB
testcase_24 AC 88 ms
15,268 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 85 ms
15,472 KB
testcase_28 WA -
testcase_29 AC 86 ms
15,256 KB
testcase_30 AC 86 ms
15,440 KB
testcase_31 AC 89 ms
15,468 KB
testcase_32 AC 91 ms
15,504 KB
testcase_33 WA -
testcase_34 AC 85 ms
15,268 KB
testcase_35 AC 86 ms
15,432 KB
testcase_36 AC 86 ms
15,336 KB
testcase_37 WA -
testcase_38 AC 87 ms
15,396 KB
testcase_39 AC 89 ms
15,452 KB
testcase_40 WA -
testcase_41 AC 82 ms
15,300 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*~-y/2>0
} ? :YES : :NO
0