結果

問題 No.629 グラフの中に眠る門松列
ユーザー tails
提出日時 2018-01-05 21:35:29
言語 Perl
(5.40.0)
結果
AC  
実行時間 26 ms / 4,000 ms
コード長 242 bytes
コンパイル時間 467 ms
コンパイル使用メモリ 6,016 KB
実行使用メモリ 7,424 KB
最終ジャッジ日時 2024-12-23 06:22:57
合計ジャッジ時間 2,376 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 6
other AC * 36
権限があれば一括ダウンロードができます
コンパイルメッセージ
Name "main::m" used only once: possible typo at Main.pl line 1.
Main.pl syntax OK

ソースコード

diff #

($n,$m)=glob<>;
@a=(0,glob<>);
for(<>){
    ($u,$v)=glob<>;
    $$u{$a[$v]-$a[$u]}=1;
    $$v{$a[$u]-$a[$v]}=1;
}
for(1..$n){
    @a=sort{$a<=>$b}keys%$_;
    if(@a>1){
	if($a[1]<0||$a[-2]>0){
	    print"YES";
	    exit;
	}
    }
}
print"NO";
0