結果
問題 | No.1144 Triangles |
ユーザー | lavox |
提出日時 | 2021-06-11 21:19:06 |
言語 | Java21 (openjdk 21) |
結果 |
TLE
|
実行時間 | - |
コード長 | 676 bytes |
コンパイル時間 | 3,816 ms |
コンパイル使用メモリ | 73,908 KB |
実行使用メモリ | 64,124 KB |
最終ジャッジ日時 | 2023-08-21 11:16:19 |
合計ジャッジ時間 | 8,121 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 117 ms
63,380 KB |
testcase_01 | AC | 116 ms
55,572 KB |
testcase_02 | AC | 116 ms
55,776 KB |
testcase_03 | AC | 121 ms
55,696 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 | -- | - |
ソースコード
import java.util.Scanner; public class Main { static final int MOD = 1000000007; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.next()); long[] x = new long[n]; long[] y = new long[n]; for ( int i = 0 ; i < n ; i++ ) { x[i] = Long.parseLong(sc.next()); y[i] = Long.parseLong(sc.next()); } sc.close(); long ans = 0; for ( int i = 0 ; i < n ; i++ ) { for ( int j = i + 1 ; j < n ; j++ ) { for ( int k = j + 1 ; k < n ; k++ ) { ans += Math.abs((x[k] - x[i]) * (y[j] - y[i]) - (y[k] - y[i]) * (x[j] - x[i])); ans = ans % MOD; } } } System.out.println(ans); } }