結果

問題 No.1447 Greedy MtSaka
ユーザー たらこたらこ
提出日時 2021-03-31 14:12:20
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,132 bytes
コンパイル時間 3,572 ms
コンパイル使用メモリ 227,464 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-21 08:51:09
合計ジャッジ時間 4,531 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using namespace std;
using ll=long long;
using ld=long double;
#define rep(i,n) for(ll i=0 ; i<(n) ; i++)
#define rrep(i,n) for(ll i=1 ; i<=(n) ; i++)
#define vi(a,b) vector<int> a(b)
#define vll(a,b) vector<ll> a(b)
#define vd(a,b) vector<double> a(b)
#define vs(a,b) vector<string> a(b)
#define vc(a,b) vector<char> a(b)
#define ALL(v) v.begin(),v.end()
#define rever(v); reverse(v.begin(), v.end());
#define sor(v); sort(v.begin(), v.end());
#define zip(v) sort(ALL(v)),v.erase(unique(ALL(v)),v.end()) //重複削除
#define MAX(v) *max_element(ALL(v))
#define MIN(v) *min_element(ALL(v))
void YesNo(bool a){if(a){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}}
void YESNO(bool a){if(a){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}}
#define coutdouble(a,b) cout << fixed << setprecision(a) << double(b) <<endl
#define mod 998244353
#define MOD 1000000007 //10^9+7

int main(){
  int n;
  cin>>n;
  vi(x,n+1);
  vi(y,n+1);
  rep(i,n)cin>>x[i]>>y[i];
  x[n]=x[0];
  y[n]=y[0];
  ll sum=0;
  rep(i,n){
    sum+=x[i]*y[i+1]-x[i+1]*y[i];
  }
  cout<<abs(sum)<<endl;
}
0