結果
問題 |
No.1144 Triangles
|
ユーザー |
![]() |
提出日時 | 2020-08-03 17:32:10 |
言語 | Perl (5.40.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 367 bytes |
コンパイル時間 | 526 ms |
コンパイル使用メモリ | 7,068 KB |
実行使用メモリ | 13,884 KB |
最終ジャッジ日時 | 2024-09-13 11:07:40 |
合計ジャッジ時間 | 5,229 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | TLE * 1 -- * 24 |
コンパイルメッセージ
Unquoted string "inf" may clash with future reserved word at Main.pl line 7. Main.pl syntax OK
ソースコード
$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)