結果

問題 No.1447 Greedy MtSaka
ユーザー kkkk97368086
提出日時 2021-12-08 13:12:35
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 345 bytes
コンパイル時間 1,619 ms
コンパイル使用メモリ 168,480 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-16 05:16:30
合計ジャッジ時間 2,513 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main()
{
	int N;
	cin >> N;
	vector<int> X( N );
	vector<int> Y( N );
	for( int i = 0; i < N; i++ ) {
		cin >> X[i] >> Y[i];
	}

	int ans = 0;
	for( int i = 1; i < N - 1; i++ ) {
		ans += abs( (X[i] - X[0]) * (Y[i + 1] - Y[0]) - (X[i + 1] - X[0]) * (Y[i] - Y[0]) );
	}

	cout << ans << endl;
}
0