結果
問題 | No.1447 Greedy MtSaka |
ユーザー |
|
提出日時 | 2021-03-12 14:18:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 311 bytes |
コンパイル時間 | 1,692 ms |
コンパイル使用メモリ | 166,168 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-29 22:32:34 |
合計ジャッジ時間 | 2,355 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
#include<bits/stdc++.h> #define rep(i,s,n) for(int i=s;i<n;i++) using namespace std; using ll=long long; int main(){ int n; cin>>n; int x[n],y[n]; rep(i,0,n){ cin>>x[i]>>y[i]; } ll 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; }