結果

問題 No.630 門松グラフ
ユーザー tailstails
提出日時 2018-01-05 21:52:55
言語 Perl
(5.38.2)
結果
AC  
実行時間 880 ms / 1,500 ms
コード長 353 bytes
コンパイル時間 1,014 ms
コンパイル使用メモリ 5,372 KB
実行使用メモリ 22,576 KB
最終ジャッジ日時 2023-08-24 20:41:24
合計ジャッジ時間 6,143 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
5,028 KB
testcase_01 AC 6 ms
5,196 KB
testcase_02 AC 6 ms
5,088 KB
testcase_03 AC 6 ms
5,140 KB
testcase_04 AC 6 ms
5,132 KB
testcase_05 AC 6 ms
5,108 KB
testcase_06 AC 6 ms
5,196 KB
testcase_07 AC 6 ms
5,180 KB
testcase_08 AC 6 ms
5,200 KB
testcase_09 AC 6 ms
5,252 KB
testcase_10 AC 6 ms
5,136 KB
testcase_11 AC 6 ms
5,204 KB
testcase_12 AC 6 ms
5,168 KB
testcase_13 AC 6 ms
5,168 KB
testcase_14 AC 6 ms
5,200 KB
testcase_15 AC 6 ms
5,288 KB
testcase_16 AC 6 ms
5,136 KB
testcase_17 AC 6 ms
5,032 KB
testcase_18 AC 6 ms
5,136 KB
testcase_19 AC 6 ms
5,148 KB
testcase_20 AC 122 ms
22,576 KB
testcase_21 AC 6 ms
5,260 KB
testcase_22 AC 120 ms
22,556 KB
testcase_23 AC 6 ms
5,176 KB
testcase_24 AC 538 ms
17,696 KB
testcase_25 AC 6 ms
5,136 KB
testcase_26 AC 154 ms
17,796 KB
testcase_27 AC 880 ms
17,644 KB
testcase_28 AC 116 ms
21,944 KB
testcase_29 AC 104 ms
20,072 KB
testcase_30 AC 125 ms
20,388 KB
testcase_31 AC 116 ms
18,752 KB
testcase_32 AC 58 ms
13,044 KB
testcase_33 AC 64 ms
11,772 KB
testcase_34 AC 96 ms
16,472 KB
testcase_35 AC 71 ms
12,760 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

($n,$m)=glob<>;
$a=$n>>1;
$b=$n-$a;
if($m<$n-1||$m>$a*$b){
    print"NO\n";
    exit;
}
print"YES\n";
print join($",1..$n),$/;

for(1..$m){
    if($_<$n){
	$u=$_+1>>1;     # 1   1   2   2
	$v=$n-($_>>1);  # n n-1 n-1 n-2
    }else{
	do{
	    $u=int(rand($a)+1);
	    $v=int(rand($b)+1+$a);
	}while$h{$u,$v};
    }
    $h{$u,$v}=1;
    print"$u $v\n";
}
0