結果

問題 No.1447 Greedy MtSaka
ユーザー MtSakaMtSaka
提出日時 2021-03-12 01:51:36
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 295 bytes
コンパイル時間 1,793 ms
コンパイル使用メモリ 166,028 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-07 07:34:05
合計ジャッジ時間 2,367 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 2 ms
5,376 KB
testcase_10 WA -
testcase_11 AC 1 ms
5,376 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define rep(i,s,n) for(int i=s;i<n;i++)
using namespace std;
int main(){
  int n;
  cin>>n;
  int x[n],y[n];
  rep(i,0,n){
    cin>>x[i]>>y[i];
  }
  double ans=0;
  rep(i,1,n-1){
    ans+=abs((x[i]-x[0])*(y[i+1]-y[0])-(y[i]-y[0])*(x[i+1]-x[0]));
  }
  cout<<ans<<endl;
}
0