結果

問題 No.1144 Triangles
ユーザー tailstails
提出日時 2020-08-03 17:32:10
言語 Perl
(5.38.2)
結果
TLE  
実行時間 -
コード長 367 bytes
コンパイル時間 496 ms
コンパイル使用メモリ 5,236 KB
実行使用メモリ 10,572 KB
最終ジャッジ日時 2023-10-11 12:19:42
合計ジャッジ時間 6,030 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,680 KB
testcase_01 AC 3 ms
4,708 KB
testcase_02 AC 3 ms
4,568 KB
testcase_03 AC 3 ms
4,648 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Unquoted string "inf" may clash with future reserved word at Main.pl line 7.
Main.pl syntax OK

ソースコード

diff #

$n=<>;
@z=map{/ /;[$`+0,$'+0]}<>;

for$i(0..$n-1){
	$ix=$z[$i][0];
	$iy=$z[$i][1];
	@a=map{ $x=$_->[0]-$ix; $y=$_->[1]-$iy; if($y<0){($x,$y)=(-$x,-$y)} if($y==0){$x=abs$x} [$x,$y,$y==0?inf:$x/$y]}@z;
	@a=sort{$a->[2]<=>$b->[2]}@a;
	$sx=0;
	$sy=0;
	for(@a){
		$s=($s-($sx*$_->[1]-$sy*$_->[0]))%(1e9+7);
		$sx+=$_->[0];
		$sy+=$_->[1];
	}
}

print $s*333333336%(1e9+7)
0