結果

問題 No.1144 Triangles
ユーザー lavoxlavox
提出日時 2021-06-11 21:22:31
言語 Java21
(openjdk 21)
結果
AC  
実行時間 2,308 ms / 3,000 ms
コード長 660 bytes
コンパイル時間 4,560 ms
コンパイル使用メモリ 74,504 KB
実行使用メモリ 60,288 KB
最終ジャッジ日時 2023-08-21 11:22:53
合計ジャッジ時間 35,635 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
56,048 KB
testcase_01 AC 113 ms
55,416 KB
testcase_02 AC 114 ms
55,800 KB
testcase_03 AC 115 ms
55,888 KB
testcase_04 AC 2,294 ms
59,984 KB
testcase_05 AC 2,284 ms
59,548 KB
testcase_06 AC 2,290 ms
57,812 KB
testcase_07 AC 2,286 ms
59,980 KB
testcase_08 AC 2,308 ms
59,740 KB
testcase_09 AC 117 ms
56,232 KB
testcase_10 AC 115 ms
55,724 KB
testcase_11 AC 118 ms
55,772 KB
testcase_12 AC 114 ms
55,824 KB
testcase_13 AC 116 ms
55,376 KB
testcase_14 AC 2,052 ms
60,112 KB
testcase_15 AC 2,020 ms
59,988 KB
testcase_16 AC 2,190 ms
60,192 KB
testcase_17 AC 2,194 ms
60,288 KB
testcase_18 AC 2,197 ms
59,992 KB
testcase_19 AC 323 ms
56,988 KB
testcase_20 AC 153 ms
56,116 KB
testcase_21 AC 154 ms
55,932 KB
testcase_22 AC 2,092 ms
57,916 KB
testcase_23 AC 230 ms
56,940 KB
testcase_24 AC 2,052 ms
59,992 KB
testcase_25 AC 631 ms
57,840 KB
testcase_26 AC 219 ms
56,600 KB
testcase_27 AC 2,098 ms
59,940 KB
testcase_28 AC 468 ms
58,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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]));
				}
			}
		}

		System.out.println(ans % MOD);
	}
}
0